| 
														
															@@ -2,11 +2,10 @@ package com.fs.hisStore.mapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.fs.common.annotation.Log; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.fs.common.enums.BusinessType; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.his.param.FsStoreProductListSParam; 
														 | 
														
														 | 
														
															 import com.fs.his.param.FsStoreProductListSParam; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.his.vo.FsStoreProductListSVO; 
														 | 
														
														 | 
														
															 import com.fs.his.vo.FsStoreProductListSVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.his.vo.OptionsVO; 
														 | 
														
														 | 
														
															 import com.fs.his.vo.OptionsVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.hisStore.config.MedicalMallConfig; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.hisStore.domain.FsStoreProductRuleScrm; 
														 | 
														
														 | 
														
															 import com.fs.hisStore.domain.FsStoreProductRuleScrm; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.statis.dto.ModifyMoreDTO; 
														 | 
														
														 | 
														
															 import com.fs.statis.dto.ModifyMoreDTO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.hisStore.domain.FsStoreProductScrm; 
														 | 
														
														 | 
														
															 import com.fs.hisStore.domain.FsStoreProductScrm; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -220,11 +219,16 @@ public interface FsStoreProductScrmMapper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select({"<script> " + 
														 | 
														
														 | 
														
															     @Select({"<script> " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "select p.* from fs_store_product_scrm p  " + 
														 | 
														
														 | 
														
															             "select p.* from fs_store_product_scrm p  " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             //新增审核状态及所属店铺审核状态 
														 | 
														
														 | 
														
															             //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where p.is_del=0 and p.is_show=1  and p.is_audit = '1'" + 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where p.is_del=0 and p.is_show=1  " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and p.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "and p.product_id=#{productId} " + 
														 | 
														
														 | 
														
															             "and p.product_id=#{productId} " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "</script>"}) 
														 | 
														
														 | 
														
															             "</script>"}) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId, String storeId,@Param("config") MedicalMallConfig config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Update("update fs_store_product_scrm set stock=stock-#{num}, sales=sales+#{num}" + 
														 | 
														
														 | 
														
															     @Update("update fs_store_product_scrm set stock=stock-#{num}, sales=sales+#{num}" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             " where product_id=#{productId} and stock >= #{num}") 
														 | 
														
														 | 
														
															             " where product_id=#{productId} and stock >= #{num}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     int decProductAttrStock(@Param("productId")Long productId, @Param("num")Integer cartNum); 
														 | 
														
														 | 
														
															     int decProductAttrStock(@Param("productId")Long productId, @Param("num")Integer cartNum); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -232,28 +236,63 @@ public interface FsStoreProductScrmMapper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             " where product_id=#{productId}") 
														 | 
														
														 | 
														
															             " where product_id=#{productId}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     int incStockDecSales( @Param("num")Long num, @Param("productId")Long productId); 
														 | 
														
														 | 
														
															     int incStockDecSales( @Param("num")Long num, @Param("productId")Long productId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
														
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where p.is_del=0 and p.is_show=1 and p.is_audit = '1'  and  p.is_new=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where p.is_del=0 and p.is_show=1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and p.is_audit = '1'  " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and  p.is_new=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count,@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
														
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where p.is_del=0 and p.is_show=1 and p.is_audit = '1'  and  p.is_hot=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where p.is_del=0 and p.is_show=1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and p.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and  p.is_hot=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count,@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
														
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where p.is_del=0 and p.is_show=1 and p.is_audit = '1' and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where p.is_del=0 and p.is_show=1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and p.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count,@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select("SELECT COUNT(*) OVER (PARTITION BY fsp.product_name) AS storeCount,p1.storeIds,fsp.* " + 
														 | 
														
														 | 
														
															     @Select("SELECT COUNT(*) OVER (PARTITION BY fsp.product_name) AS storeCount,p1.storeIds,fsp.* " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "FROM fs_store_product_scrm fsp " + 
														 | 
														
														 | 
														
															             "FROM fs_store_product_scrm fsp " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "left join (select GROUP_CONCAT(distinct fsp1.store_id SEPARATOR ',' ) AS storeIds,fsp1.product_name " + 
														 | 
														
														 | 
														
															             "left join (select GROUP_CONCAT(distinct fsp1.store_id SEPARATOR ',' ) AS storeIds,fsp1.product_name " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "from  fs_store_product_scrm fsp1 group by fsp1.product_name) p1 on p1.product_name = fsp.product_name "+ 
														 | 
														
														 | 
														
															             "from  fs_store_product_scrm fsp1 group by fsp1.product_name) p1 on p1.product_name = fsp.product_name "+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "inner join fs_store_scrm fs on fs.store_id = fsp.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where fsp.is_del=0 and fsp.is_show=1 and fsp.is_audit = '1' and fsp.is_best=1 and fsp.is_display=1 order by fsp.sort desc,fsp.product_id desc") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "inner join fs_store_scrm fs on fs.store_id = fsp.store_id " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and fs.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where fsp.is_del=0 and fsp.is_show=1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and fsp.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and fsp.is_best=1 and fsp.is_display=1 order by fsp.sort desc,fsp.product_id desc") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
														
														 | 
														
															     @Select("select p.* from fs_store_product_scrm p " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            "where p.is_del=0 and p.is_show=1 and p.is_audit = '1'  and  p.is_good=1 and p.is_display=1 order by p.sort desc") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "where p.is_del=0 and p.is_show=1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and p.is_audit = '1'" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "and  p.is_good=1 and p.is_display=1 order by p.sort desc") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select({"<script> " + 
														 | 
														
														 | 
														
															     @Select({"<script> " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "select count(1) from fs_store_product_scrm  " + 
														 | 
														
														 | 
														
															             "select count(1) from fs_store_product_scrm  " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "where 1=1 " + 
														 | 
														
														 | 
														
															             "where 1=1 " + 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -358,8 +397,11 @@ public interface FsStoreProductScrmMapper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Select({"<script> " + 
														 | 
														
														 | 
														
															     @Select({"<script> " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "select p.* from fs_store_product_scrm p " + 
														 | 
														
														 | 
														
															             "select p.* from fs_store_product_scrm p " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //新增审核状态及所属店铺审核状态 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "<if test='config.isAudit == \"1\" '>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
														
														 | 
														
															             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            "</if>" + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "where find_in_set(p.product_id,#{ids})  " + 
														 | 
														
														 | 
														
															             "where find_in_set(p.product_id,#{ids})  " + 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             "</script>"}) 
														 | 
														
														 | 
														
															             "</script>"}) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds,@Param("config") MedicalMallConfig  config); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 |