Parcourir la source

feat: 添加明星产品和今日折扣

xdd il y a 1 mois
Parent
commit
cd9e6f866e

+ 11 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsStoreProduct.java

@@ -186,4 +186,15 @@ public class FsStoreProduct extends BaseEntity
     @Excel(name = "仓库代码")
     private String warehouseCode;
 
+
+    /**
+     * 明星产品
+     */
+    private Integer isStar;
+
+    /**
+     * 是否今日特价
+     */
+    private Integer isDiscountToday;
+
 }

+ 6 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsStoreProductMapper.java

@@ -143,6 +143,12 @@ public interface FsStoreProductMapper
             "<if test = 'maps.newOrder != null and maps.newOrder==\"desc\" '> " +
             "and p.is_new =1 order by p.create_time desc  " +
             "</if>" +
+            "<if test='maps.isStar != null'>" +
+            "and p.is_star = ${maps.isStar}" +
+            "</if>"+
+            "<if test='maps.isDiscountToday != null'>" +
+            "and p.is_discount_today = ${maps.isDiscountToday}" +
+            "</if>"+
             "</script>"})
     List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(@Param("maps")FsStoreProductQueryParam param);
     @Select({"<script> " +

+ 11 - 0
fs-service-system/src/main/java/com/fs/store/param/FsStoreProductQueryParam.java

@@ -21,6 +21,17 @@ public class FsStoreProductQueryParam extends BaseQueryParam implements Serializ
     private String priceOrder;
     @ApiModelProperty(value = "销量排序")
     private String salesOrder;
+
+    /**
+     * 明星产品
+     */
+    private Integer isStar;
+
+    /**
+     * 是否今日特价
+     */
+    private Integer isDiscountToday;
+
     @ApiModelProperty(value = "1 只显示商城展示的商品 0展示所有")
     private Integer isDisplay=1;
 

+ 12 - 2
fs-service-system/src/main/resources/mapper/store/FsStoreProductMapper.xml

@@ -48,10 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isDisplay"    column="is_display"    />
         <result property="tuiCateId"    column="tui_cate_id"    />
         <result property="video"    column="video"    />
+        <result property="isStar"    column="is_star"    />
+        <result property="isDiscountToday"    column="is_discount_today"    />
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
-        select product_id, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,is_display,tui_cate_id,warehouse_id,warehouse_code,video from fs_store_product
+        select product_id, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,is_display,tui_cate_id,warehouse_id,warehouse_code,video,is_star,is_discount_today from fs_store_product
     </sql>
 
     <select id="selectFsStoreProductList" parameterType="FsStoreProduct" resultMap="FsStoreProductResult">
@@ -97,6 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDisplay != null "> and is_display = #{isDisplay}</if>
             <if test="warehouseId != null"> and warehouse_id = #{warehouseId}</if>
             <if test="warehouseCode != null"> and warehouse_code = #{warehouseCode}</if>
+            <if test="isStar != null"> and is_star = ${isStar}</if>
+            <if test="isDiscountToday != null"> and is_discount_today = ${isDiscountToday}</if>
         </where>
     </select>
 
@@ -152,6 +156,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tuiCateId != null">tui_cate_id,</if>
             <if test="warehouseId != null">warehouse_id,</if>
             <if test="warehouseCode != null">warehouse_code,</if>
+            <if test="isStar != null">is_star,</if>
+            <if test="isDiscountToday != null">is_discount_today,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -198,7 +204,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tuiCateId != null">#{tuiCateId},</if>
             <if test="warehouseId != null">#{warehouseId},</if>
             <if test="warehouseCode != null">#{warehouseCode},</if>
-         </trim>
+            <if test="isStar != null">#{isStar},</if>
+            <if test="isDiscountToday != null">#{isDiscountToday},</if>
+        </trim>
     </insert>
 
     <update id="updateFsStoreProduct" parameterType="FsStoreProduct">
@@ -248,6 +256,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tuiCateId != null">tui_cate_id = #{tuiCateId},</if>
             <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
             <if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
+            <if test="isStar">is_star = #{isStar},</if>
+            <if test="isDiscountToday">is_discount_today = #{isDiscountToday},</if>
         </trim>
         where product_id = #{productId}
     </update>