ソースを参照

修复购物车显示和keyword关键词搜索

xw 1 日 前
コミット
c3ad0a3727

+ 3 - 0
fs-service/src/main/java/com/fs/his/mapper/FsIntegralGoodsMapper.java

@@ -85,6 +85,9 @@ public interface FsIntegralGoodsMapper
             "<if test = 'maps.goodsType != null and maps.goodsType != 0     '> " +
             "and g.goods_type = #{maps.goodsType}  " +
             "</if>" +
+            "<if test = 'maps.keyword != null and maps.keyword != \"\"'> " +
+            "and g.goods_name like CONCAT('%',#{maps.keyword},'%') " +
+            "</if>" +
             " order by g.goods_id desc "+
             "</script>"})
     List<FsIntegralGoodsListUVO> selectFsIntegralGoodsListUVO(@Param("maps")FsIntegralGoodsListUParam param);

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsIntegralGoodsScrmMapper.java

@@ -80,6 +80,9 @@ public interface FsIntegralGoodsScrmMapper
             "<if test = 'maps.goodsType != null and maps.goodsType != 0     '> " +
             "and g.goods_type = #{maps.goodsType}  " +
             "</if>" +
+            "<if test = 'maps.keyword != null and maps.keyword != \"\"'> " +
+            "and g.goods_name like CONCAT('%',#{maps.keyword},'%') " +
+            "</if>" +
             " order by g.goods_id desc "+
             "</script>"})
     List<FsIntegralGoodsListUVO> selectFsIntegralGoodsListUVO(@Param("maps")FsIntegralGoodsListUParam param);

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -101,10 +101,10 @@ public interface FsStoreCartScrmMapper
     void updateIsPay(String cartIds);
 
 
-    @Select("select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c inner join fs_store_product_scrm p on p.product_id=c.product_id inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{userId}")
+    @Select("select count(*) from fs_store_cart_scrm c inner join fs_store_product_scrm p on p.product_id=c.product_id inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{userId}")
     Integer selectFsStoreCartCountByUserId(long userId);
     @Select({"<script> " +
-            "select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c  " +
+            "select count(*) from fs_store_cart_scrm c  " +
             "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 " +
             "<if test = 'maps.userId != null     '> " +
             "and c.user_id =#{maps.userId} " +