|
@@ -86,8 +86,15 @@ public interface FsStoreProductMapper
|
|
|
"<if test = 'maps.specialProducts != null '> " +
|
|
"<if test = 'maps.specialProducts != null '> " +
|
|
|
"and p.special_products =#{maps.specialProducts} " +
|
|
"and p.special_products =#{maps.specialProducts} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test = 'maps.productKind != null '> " +
|
|
|
|
|
- "and p.product_kind =#{maps.productKind} " +
|
|
|
|
|
|
|
+ "<if test = 'maps.productKind != null and maps.productKind !=\"\" '> " +
|
|
|
|
|
+ "and FIND_IN_SET(#{maps.productKind}, p.product_kind) " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.productKindList != null and maps.productKindList.length > 0 '> " +
|
|
|
|
|
+ "and (\n" +
|
|
|
|
|
+ " <foreach collection=\"maps.productKindList\" item=\"item\" separator=\" or \">\n" +
|
|
|
|
|
+ " FIND_IN_SET(#{item}, p.product_kind)\n" +
|
|
|
|
|
+ " </foreach>\n" +
|
|
|
|
|
+ " )" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
" order by p.product_id desc "+
|
|
" order by p.product_id desc "+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
@@ -120,7 +127,14 @@ public interface FsStoreProductMapper
|
|
|
"and p.warehouse_code =#{maps.warehouseCode} " +
|
|
"and p.warehouse_code =#{maps.warehouseCode} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.productKind != null '> " +
|
|
"<if test = 'maps.productKind != null '> " +
|
|
|
- "and p.product_kind =#{maps.productKind} " +
|
|
|
|
|
|
|
+ "and FIND_IN_SET(#{maps.productKind}, p.product_kind) " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.productKindList != null and maps.productKindList.length > 0 '> " +
|
|
|
|
|
+ "and (\n" +
|
|
|
|
|
+ " <foreach collection=\"maps.productKindList\" item=\"item\" separator=\" or \">\n" +
|
|
|
|
|
+ " FIND_IN_SET(#{item}, p.product_kind)\n" +
|
|
|
|
|
+ " </foreach>\n" +
|
|
|
|
|
+ " )" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
" order by p.product_id desc "+
|
|
" order by p.product_id desc "+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
@@ -128,10 +142,10 @@ public interface FsStoreProductMapper
|
|
|
|
|
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind) </if>" +
|
|
|
" order by sort desc limit #{count}" +
|
|
" order by sort desc limit #{count}" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(@Param("count") int count, @Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(@Param("count") int count, @Param("productKind") String productKind);
|
|
|
@Select("select * from fs_store_product where is_del=0 and is_show=1 order by sort desc limit #{count}")
|
|
@Select("select * from fs_store_product where is_del=0 and is_show=1 order by sort desc limit #{count}")
|
|
|
List<FsStoreProductListQueryVO> selectFsStoreProductByCateIdQuery(Long cateId);
|
|
List<FsStoreProductListQueryVO> selectFsStoreProductByCateIdQuery(Long cateId);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
@@ -150,7 +164,14 @@ public interface FsStoreProductMapper
|
|
|
"and p.special_products =#{maps.specialProducts} " +
|
|
"and p.special_products =#{maps.specialProducts} " +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.productKind != null '> " +
|
|
"<if test = 'maps.productKind != null '> " +
|
|
|
- "and p.product_kind =#{maps.productKind} " +
|
|
|
|
|
|
|
+ "and FIND_IN_SET(#{maps.productKind}, p.product_kind) " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ "<if test = 'maps.productKindList != null and maps.productKindList.length > 0 '> " +
|
|
|
|
|
+ "and (\n" +
|
|
|
|
|
+ " <foreach collection=\"maps.productKindList\" item=\"item\" separator=\" or \">\n" +
|
|
|
|
|
+ " FIND_IN_SET(#{item}, p.product_kind)\n" +
|
|
|
|
|
+ " </foreach>\n" +
|
|
|
|
|
+ " )" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\" '> " +
|
|
"<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\" '> " +
|
|
|
"order by p.sort desc " +
|
|
"order by p.sort desc " +
|
|
@@ -175,9 +196,9 @@ public interface FsStoreProductMapper
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select p.* from fs_store_product p " +
|
|
"select p.* from fs_store_product p " +
|
|
|
"where is_del=0 and is_show=1 and product_id=#{productId} " +
|
|
"where is_del=0 and is_show=1 and product_id=#{productId} " +
|
|
|
- "<if test = 'productKind != null'> and p.product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, p.product_kind) </if>" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- FsStoreProductQueryVO selectFsStoreProductByIdQuery(@Param("productId") Long productId, @Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ FsStoreProductQueryVO selectFsStoreProductByIdQuery(@Param("productId") Long productId, @Param("productKind") String productKind);
|
|
|
@Update("update fs_store_product set stock=stock-#{num}, sales=sales+#{num}" +
|
|
@Update("update fs_store_product 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);
|
|
@@ -194,34 +215,34 @@ public interface FsStoreProductMapper
|
|
|
List<FsStoreProductListQueryVO> selectFsStoreProductHotQuerySp(int count);
|
|
List<FsStoreProductListQueryVO> selectFsStoreProductHotQuerySp(int count);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind)</if>" +
|
|
|
" order by sort desc limit #{count}" +
|
|
" order by sort desc limit #{count}" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(@Param("count") int count, @Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(@Param("count") int count, @Param("productKind") String productKind);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind) </if>" +
|
|
|
" order by sort desc" +
|
|
" order by sort desc" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("productKind") String productKind);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 and special_products=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_best=1 and is_display=1 and special_products=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind) </if>" +
|
|
|
" order by sort desc" +
|
|
" order by sort desc" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuerySp(@Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuerySp(@Param("productKind") String productKind);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind) </if>" +
|
|
|
" order by sort desc" +
|
|
" order by sort desc" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("productKind") String productKind);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 and special_products=1 " +
|
|
"select * from fs_store_product where is_del=0 and is_show=1 and is_good=1 and is_display=1 and special_products=1 " +
|
|
|
- "<if test = 'productKind != null'> and product_kind = #{productKind} </if>" +
|
|
|
|
|
|
|
+ "<if test = 'productKind != null'> and FIND_IN_SET(#{productKind}, product_kind) </if>" +
|
|
|
" order by sort desc" +
|
|
" order by sort desc" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuerySp(@Param("productKind") Integer productKind);
|
|
|
|
|
|
|
+ List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuerySp(@Param("productKind") String productKind);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select count(1) from fs_store_product " +
|
|
"select count(1) from fs_store_product " +
|
|
|
"where 1=1 " +
|
|
"where 1=1 " +
|
|
@@ -266,4 +287,4 @@ public interface FsStoreProductMapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+}
|