Parcourir la source

去除旧语法b2c-good

tsurumure il y a 1 mois
Parent
commit
ae8afe71ac

+ 59 - 59
src/main/java/com/backendsys/entity/B2c/B2cGoodDTO.java

@@ -1,59 +1,59 @@
-package com.backendsys.entity.B2c;
-
-import com.backendsys.entity.validator.RangeArray;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import lombok.Data;
-
-@Data
-public class B2cGoodDTO {
-    public static interface Detail{}
-    public static interface Create{}
-    public static interface Update{}
-    public static interface Delete{}
-
-    /**
-     * b2c_goods
-     */
-    private Long id;
-    @NotNull(message = "商品ID不能为空", groups = { B2cGoodDTO.Detail.class, B2cGoodDTO.Update.class, B2cGoodDTO.Delete.class })
-    private Long good_id;
-
-    @NotNull(message = "商品分类ID不能为空", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private Long category_id;
-    private String category_name;
-
-    private Long brand_id;
-    private String brand_name;
-    private Long unit_id;
-    private String unit_name;
-
-    @NotBlank(message = "商品名称不能为空", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    @Size(max = 50, message = "商品名称长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String good_name;
-
-    @Size(max = 200, message = "商品描述长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String good_description;
-
-    @Size(max = 10000, message = "商品内容长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String good_content;
-
-    @Size(max = 1000, message = "商品缩略图地址长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String good_thumb;
-
-    @Size(max = 10000, message = "商品图片地址长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String good_images;
-
-    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String meta_keyword;
-    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private String meta_description;
-
-    @RangeArray(message="商品状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class })
-    private Integer status;
-
-    private Integer del_flag;
-    private String create_time;
-    private String update_time;
-}
+//package com.backendsys.entity.B2c;
+//
+//import com.backendsys.entity.validator.RangeArray;
+//import jakarta.validation.constraints.NotBlank;
+//import jakarta.validation.constraints.NotNull;
+//import jakarta.validation.constraints.Size;
+//import lombok.Data;
+//
+//@Data
+//public class B2cGoodDTO {
+//    public static interface Detail{}
+//    public static interface Create{}
+//    public static interface Update{}
+//    public static interface Delete{}
+//
+//    /**
+//     * b2c_goods
+//     */
+//    private Long id;
+//    @NotNull(message = "商品ID不能为空", groups = { Detail.class, Update.class, Delete.class })
+//    private Long good_id;
+//
+//    @NotNull(message = "商品分类ID不能为空", groups = { Create.class, Update.class })
+//    private Long category_id;
+//    private String category_name;
+//
+//    private Long brand_id;
+//    private String brand_name;
+//    private Long unit_id;
+//    private String unit_name;
+//
+//    @NotBlank(message = "商品名称不能为空", groups = { Create.class, Update.class })
+//    @Size(max = 50, message = "商品名称长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String good_name;
+//
+//    @Size(max = 200, message = "商品描述长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String good_description;
+//
+//    @Size(max = 10000, message = "商品内容长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String good_content;
+//
+//    @Size(max = 1000, message = "商品缩略图地址长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String good_thumb;
+//
+//    @Size(max = 10000, message = "商品图片地址长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String good_images;
+//
+//    @Size(max = 100, message = "关键词长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String meta_keyword;
+//    @Size(max = 200, message = "关键词描述长度不超过 {max} 字符", groups = { Create.class, Update.class })
+//    private String meta_description;
+//
+//    @RangeArray(message="商品状态取值有误,范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { Create.class, Update.class })
+//    private Integer status;
+//
+//    private Integer del_flag;
+//    private String create_time;
+//    private String update_time;
+//}

+ 9 - 9
src/main/java/com/backendsys/entity/B2c/B2cGoodSpecSkuDTO.java

@@ -17,26 +17,26 @@ public class B2cGoodSpecSkuDTO {
      * b2c_goods_spec_sku
      */
     private Long id;
-    @NotNull(message = "商品SKU_ID不能为空", groups = { B2cGoodSpecSkuDTO.Detail.class, B2cGoodSpecSkuDTO.Update.class, B2cGoodSpecSkuDTO.Delete.class })
+    @NotNull(message = "商品SKU_ID不能为空", groups = { Detail.class, Update.class, Delete.class })
     private Long good_spec_sku_id;
 
     // 编辑时,商品ID 不允许修改,保证数据视图显示一致性
-    @NotNull(message = "商品ID不能为空", groups = { B2cGoodSpecSkuDTO.Create.class })
+    @NotNull(message = "商品ID不能为空", groups = { Create.class })
     private Long good_id;
 
-    @NotEmpty(message = "规格ID不能为空", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
+    @NotEmpty(message = "规格ID不能为空", groups = { Create.class, Update.class })
     private String spec_ids;
 
-    @NotNull(message = "商品规格金额不能为空", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
-    @Digits(integer = 9, fraction = 2, message = "商品规格金额最多支持 {integer} 位数字且小数点后最多 {fraction} 位", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
+    @NotNull(message = "商品规格金额不能为空", groups = { Create.class, Update.class })
+    @Digits(integer = 9, fraction = 2, message = "商品规格金额最多支持 {integer} 位数字且小数点后最多 {fraction} 位", groups = { Create.class, Update.class })
     private BigDecimal price;
 
-    @NotNull(message = "商品规格库存不能为空", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
-    @Min(value = 0, message = "商品规格库存必须大于等于0", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
-    @Max(value = 999999999, message = "商品规格库存必须小于等于 {max} 字符", groups = { B2cGoodSpecSkuDTO.Create.class, B2cGoodSpecSkuDTO.Update.class })
+    @NotNull(message = "商品规格库存不能为空", groups = { Create.class, Update.class })
+    @Min(value = 0, message = "商品规格库存必须大于等于0", groups = { Create.class, Update.class })
+    @Max(value = 999999999, message = "商品规格库存必须小于等于 {max} 字符", groups = { Create.class, Update.class })
     private Long stock;
 
-    @RangeArray(message="是否启用商品库存取值有误,范围应是(-1无限, 1有限)", value = {"-1", "1"}, groups = { B2cGoodDTO.Create.class, B2cGoodDTO.Update.class})
+    @RangeArray(message="是否启用商品库存取值有误,范围应是(-1无限, 1有限)", value = {"-1", "1"}, groups = { Create.class, Update.class})
     private Integer is_stock;
 
 

+ 16 - 16
src/main/java/com/backendsys/mapper/B2c/B2cGoodMapper.java

@@ -1,16 +1,16 @@
-package com.backendsys.mapper.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface B2cGoodMapper {
-    List<Map<String, Object>> queryGoodList(B2cGoodDTO b2cGoodDTO);
-    Map<String, Object> queryGoodDetail(Long good_id);
-    long insertGood(B2cGoodDTO b2cGoodDTO);
-    long deleteGood(B2cGoodDTO b2cGoodDTO);
-    long updateGood(B2cGoodDTO b2cGoodDTO);
-}
+//package com.backendsys.mapper.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface B2cGoodMapper {
+//    List<Map<String, Object>> queryGoodList(B2cGoodDTO b2cGoodDTO);
+//    Map<String, Object> queryGoodDetail(Long good_id);
+//    long insertGood(B2cGoodDTO b2cGoodDTO);
+//    long deleteGood(B2cGoodDTO b2cGoodDTO);
+//    long updateGood(B2cGoodDTO b2cGoodDTO);
+//}

+ 157 - 157
src/main/java/com/backendsys/mapper/B2c/B2cGoodMapper.xml

@@ -1,168 +1,168 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.B2c.B2cGoodMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.B2c.B2cGoodMapper">-->
 
-    <sql id="includeGoods">
-        g.id id,
-        g.id good_id,
+<!--    <sql id="includeGoods">-->
+<!--        g.id id,-->
+<!--        g.id good_id,-->
 
-        g.category_id category_id,
-        gc.category_name category_name,
-        COALESCE(g.brand_id, '') brand_id,
-        COALESCE(gb.brand_name, '') brand_name,
-        COALESCE(g.unit_id, '') unit_id,
-        COALESCE(gu.unit_name, '') unit_name,
+<!--        g.category_id category_id,-->
+<!--        gc.category_name category_name,-->
+<!--        COALESCE(g.brand_id, '') brand_id,-->
+<!--        COALESCE(gb.brand_name, '') brand_name,-->
+<!--        COALESCE(g.unit_id, '') unit_id,-->
+<!--        COALESCE(gu.unit_name, '') unit_name,-->
 
-        g.good_name good_name,
-        COALESCE(g.good_description, '') good_description,
-        g.good_content good_content,
-        COALESCE(g.good_thumb, '') good_thumb,
-        COALESCE(g.good_images, '') good_images,
-        COALESCE(g.meta_keyword, '') meta_keyword,
-        COALESCE(g.meta_description, '') meta_description,
-        g.status status,
-        g.create_time create_time,
-        g.update_time update_time
-    </sql>
-    <resultMap id="resultMapGoods" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="good_id" column="good_id" javaType="java.lang.Long"/>
-        <result property="category_id" column="category_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name"/>
-        <result property="brand_id" column="brand_id" javaType="java.lang.Long"/>
-        <result property="brand_name" column="brand_name"/>
-        <result property="unit_id" column="unit_id" javaType="java.lang.Long"/>
-        <result property="unit_name" column="unit_name"/>
-        <result property="good_name" column="good_name" />
-        <result property="good_description" column="good_description" />
-        <result property="good_thumb" column="good_thumb" />
-        <result property="meta_keyword" column="meta_keyword" />
-        <result property="meta_description" column="meta_description" />
-        <result property="status" column="status" javaType="java.lang.Integer"/>
-        <result property="create_time" column="create_time" />
-        <result property="update_time" column="update_time" />
-        <collection select="querySpecById" property="spec_sku" javaType="java.util.List" ofType="java.util.LinkedHashMap" column="{goodId=id}">
-            <id property="id" column="spec_id" />
-            <result property="good_id" column="good_id" />
-            <result property="spec_ids" column="spec_ids" />
-            <result property="stock" column="stock" />
-            <result property="price" column="price" />
-            <result property="is_stock" column="is_stock" />
-        </collection>
-    </resultMap>
+<!--        g.good_name good_name,-->
+<!--        COALESCE(g.good_description, '') good_description,-->
+<!--        g.good_content good_content,-->
+<!--        COALESCE(g.good_thumb, '') good_thumb,-->
+<!--        COALESCE(g.good_images, '') good_images,-->
+<!--        COALESCE(g.meta_keyword, '') meta_keyword,-->
+<!--        COALESCE(g.meta_description, '') meta_description,-->
+<!--        g.status status,-->
+<!--        g.create_time create_time,-->
+<!--        g.update_time update_time-->
+<!--    </sql>-->
+<!--    <resultMap id="resultMapGoods" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="good_id" column="good_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name"/>-->
+<!--        <result property="brand_id" column="brand_id" javaType="java.lang.Long"/>-->
+<!--        <result property="brand_name" column="brand_name"/>-->
+<!--        <result property="unit_id" column="unit_id" javaType="java.lang.Long"/>-->
+<!--        <result property="unit_name" column="unit_name"/>-->
+<!--        <result property="good_name" column="good_name" />-->
+<!--        <result property="good_description" column="good_description" />-->
+<!--        <result property="good_thumb" column="good_thumb" />-->
+<!--        <result property="meta_keyword" column="meta_keyword" />-->
+<!--        <result property="meta_description" column="meta_description" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer"/>-->
+<!--        <result property="create_time" column="create_time" />-->
+<!--        <result property="update_time" column="update_time" />-->
+<!--        <collection select="querySpecById" property="spec_sku" javaType="java.util.List" ofType="java.util.LinkedHashMap" column="{goodId=id}">-->
+<!--            <id property="id" column="spec_id" />-->
+<!--            <result property="good_id" column="good_id" />-->
+<!--            <result property="spec_ids" column="spec_ids" />-->
+<!--            <result property="stock" column="stock" />-->
+<!--            <result property="price" column="price" />-->
+<!--            <result property="is_stock" column="is_stock" />-->
+<!--        </collection>-->
+<!--    </resultMap>-->
 
-    <!-- [嵌套查询] 商品规格SKU -->
-    <select id="querySpecById" resultType="java.util.LinkedHashMap">
-        SELECT gss.id, gss.good_id, gss.spec_ids, gss.stock, gss.price, gss.is_stock
---          , CONCAT(gs.spec_name, ',', gs.spec_value) AS specs
-        FROM b2c_goods_spec_sku gss
---             JOIN b2c_goods_spec gs ON FIND_IN_SET(gs.id, gss.spec_ids) > 0
-        WHERE good_id = #{goodId}
-    </select>
+<!--    &lt;!&ndash; [嵌套查询] 商品规格SKU &ndash;&gt;-->
+<!--    <select id="querySpecById" resultType="java.util.LinkedHashMap">-->
+<!--        SELECT gss.id, gss.good_id, gss.spec_ids, gss.stock, gss.price, gss.is_stock-->
+<!--&#45;&#45;          , CONCAT(gs.spec_name, ',', gs.spec_value) AS specs-->
+<!--        FROM b2c_goods_spec_sku gss-->
+<!--&#45;&#45;             JOIN b2c_goods_spec gs ON FIND_IN_SET(gs.id, gss.spec_ids) > 0-->
+<!--        WHERE good_id = #{goodId}-->
+<!--    </select>-->
 
-    <resultMap id="resultMapGoodsDetail" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="good_id" column="good_id" javaType="java.lang.Long"/>
-        <result property="category_id" column="category_id" javaType="java.lang.Long"/>
-        <result property="category_name" column="category_name"/>
-        <result property="brand_id" column="brand_id" javaType="java.lang.Long"/>
-        <result property="brand_name" column="brand_name"/>
-        <result property="unit_id" column="unit_id" javaType="java.lang.Long"/>
-        <result property="unit_name" column="unit_name"/>
-        <result property="good_name" column="good_name" />
-        <result property="good_content" column="good_content" />
-        <result property="good_description" column="good_description" />
-        <result property="good_thumb" column="good_thumb" />
-        <result property="good_images" column="good_images" />
-        <result property="meta_keyword" column="meta_keyword" />
-        <result property="meta_description" column="meta_description" />
-        <result property="status" column="status" javaType="java.lang.Integer"/>
-        <result property="create_time" column="create_time" />
-        <result property="update_time" column="update_time" />
-    </resultMap>
+<!--    <resultMap id="resultMapGoodsDetail" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="good_id" column="good_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
+<!--        <result property="category_name" column="category_name"/>-->
+<!--        <result property="brand_id" column="brand_id" javaType="java.lang.Long"/>-->
+<!--        <result property="brand_name" column="brand_name"/>-->
+<!--        <result property="unit_id" column="unit_id" javaType="java.lang.Long"/>-->
+<!--        <result property="unit_name" column="unit_name"/>-->
+<!--        <result property="good_name" column="good_name" />-->
+<!--        <result property="good_content" column="good_content" />-->
+<!--        <result property="good_description" column="good_description" />-->
+<!--        <result property="good_thumb" column="good_thumb" />-->
+<!--        <result property="good_images" column="good_images" />-->
+<!--        <result property="meta_keyword" column="meta_keyword" />-->
+<!--        <result property="meta_description" column="meta_description" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer"/>-->
+<!--        <result property="create_time" column="create_time" />-->
+<!--        <result property="update_time" column="update_time" />-->
+<!--    </resultMap>-->
 
-    <select id="queryGoodList" resultMap="resultMapGoods">
-        SELECT DISTINCT
-        <include refid="includeGoods" />
-        FROM b2c_goods g
-            LEFT JOIN b2c_goods_category gc ON g.category_id = gc.id
-            LEFT JOIN b2c_goods_brand gb ON g.brand_id = gb.id
-            LEFT JOIN b2c_goods_unit gu ON g.unit_id = gu.id
-        <where>
-            <if test="good_name != null and good_name != ''">
-                AND g.good_name LIKE CONCAT('%', #{good_name}, '%')
-            </if>
-            <if test="category_id != null and category_id != ''">
-                AND g.category_id = #{category_id}
-            </if>
-            <if test="brand_id != null and brand_id != ''">
-                AND g.brand_id = #{brand_id}
-            </if>
-            <if test="status != null and status != ''">
-                AND g.status = #{status}
-            </if>
-        </where>
-        ORDER BY create_time DESC
-    </select>
+<!--    <select id="queryGoodList" resultMap="resultMapGoods">-->
+<!--        SELECT DISTINCT-->
+<!--        <include refid="includeGoods" />-->
+<!--        FROM b2c_goods g-->
+<!--            LEFT JOIN b2c_goods_category gc ON g.category_id = gc.id-->
+<!--            LEFT JOIN b2c_goods_brand gb ON g.brand_id = gb.id-->
+<!--            LEFT JOIN b2c_goods_unit gu ON g.unit_id = gu.id-->
+<!--        <where>-->
+<!--            <if test="good_name != null and good_name != ''">-->
+<!--                AND g.good_name LIKE CONCAT('%', #{good_name}, '%')-->
+<!--            </if>-->
+<!--            <if test="category_id != null and category_id != ''">-->
+<!--                AND g.category_id = #{category_id}-->
+<!--            </if>-->
+<!--            <if test="brand_id != null and brand_id != ''">-->
+<!--                AND g.brand_id = #{brand_id}-->
+<!--            </if>-->
+<!--            <if test="status != null and status != ''">-->
+<!--                AND g.status = #{status}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--        ORDER BY create_time DESC-->
+<!--    </select>-->
 
-    <select id="queryGoodDetail" resultMap="resultMapGoodsDetail">
-        SELECT
-        <include refid="includeGoods" />
-        FROM b2c_goods g
-            LEFT JOIN b2c_goods_category gc ON g.category_id = gc.id
-            LEFT JOIN b2c_goods_brand gb ON g.brand_id = gb.id
-            LEFT JOIN b2c_goods_unit gu ON g.unit_id = gu.id
-        WHERE g.id = #{good_id}
-    </select>
+<!--    <select id="queryGoodDetail" resultMap="resultMapGoodsDetail">-->
+<!--        SELECT-->
+<!--        <include refid="includeGoods" />-->
+<!--        FROM b2c_goods g-->
+<!--            LEFT JOIN b2c_goods_category gc ON g.category_id = gc.id-->
+<!--            LEFT JOIN b2c_goods_brand gb ON g.brand_id = gb.id-->
+<!--            LEFT JOIN b2c_goods_unit gu ON g.unit_id = gu.id-->
+<!--        WHERE g.id = #{good_id}-->
+<!--    </select>-->
 
-    <insert id="insertGood" parameterType="com.backendsys.entity.B2c.B2cGoodDTO"
-        useGeneratedKeys="true" keyProperty="good_id">
-        INSERT INTO b2c_goods (category_id, good_name
-        <if test="brand_id != null and brand_id != ''">, brand_id</if>
-        <if test="unit_id != null and unit_id != ''">, unit_id</if>
-        <if test="good_description != null and good_description != ''">, good_description</if>
-        <if test="good_content != null and good_content != ''">, good_content</if>
-        <if test="good_thumb != null and good_thumb != ''">, good_thumb</if>
-        <if test="good_images != null and good_images != ''">, good_images</if>
-        <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword</if>
-        <if test="meta_description != null and meta_description != ''">, meta_description</if>
-        <if test="status != null and status != ''">, status</if>
-        <if test="del_flag != null and del_flag != ''">, del_flag</if>
-        )
-        VALUES (#{category_id}, #{good_name}
-        <if test="brand_id != null and brand_id != ''">, #{brand_id}</if>
-        <if test="unit_id != null and unit_id != ''">, #{unit_id}</if>
-        <if test="good_description != null and good_description != ''">, #{good_description}</if>
-        <if test="good_content != null and good_content != ''">, #{good_content}</if>
-        <if test="good_thumb != null and good_thumb != ''">, #{good_thumb}</if>
-        <if test="good_images != null and good_images != ''">, #{good_images}</if>
-        <if test="meta_keyword != null and meta_keyword != ''">, #{meta_keyword}</if>
-        <if test="meta_description != null and meta_description != ''">, #{meta_description}</if>
-        <if test="status != null and status != ''">, #{status}</if>
-        <if test="del_flag != null and del_flag != ''">, #{del_flag}</if>
-        )
-    </insert>
+<!--    <insert id="insertGood" parameterType="com.backendsys.entity.B2c.B2cGoodDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="good_id">-->
+<!--        INSERT INTO b2c_goods (category_id, good_name-->
+<!--        <if test="brand_id != null and brand_id != ''">, brand_id</if>-->
+<!--        <if test="unit_id != null and unit_id != ''">, unit_id</if>-->
+<!--        <if test="good_description != null and good_description != ''">, good_description</if>-->
+<!--        <if test="good_content != null and good_content != ''">, good_content</if>-->
+<!--        <if test="good_thumb != null and good_thumb != ''">, good_thumb</if>-->
+<!--        <if test="good_images != null and good_images != ''">, good_images</if>-->
+<!--        <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword</if>-->
+<!--        <if test="meta_description != null and meta_description != ''">, meta_description</if>-->
+<!--        <if test="status != null and status != ''">, status</if>-->
+<!--        <if test="del_flag != null and del_flag != ''">, del_flag</if>-->
+<!--        )-->
+<!--        VALUES (#{category_id}, #{good_name}-->
+<!--        <if test="brand_id != null and brand_id != ''">, #{brand_id}</if>-->
+<!--        <if test="unit_id != null and unit_id != ''">, #{unit_id}</if>-->
+<!--        <if test="good_description != null and good_description != ''">, #{good_description}</if>-->
+<!--        <if test="good_content != null and good_content != ''">, #{good_content}</if>-->
+<!--        <if test="good_thumb != null and good_thumb != ''">, #{good_thumb}</if>-->
+<!--        <if test="good_images != null and good_images != ''">, #{good_images}</if>-->
+<!--        <if test="meta_keyword != null and meta_keyword != ''">, #{meta_keyword}</if>-->
+<!--        <if test="meta_description != null and meta_description != ''">, #{meta_description}</if>-->
+<!--        <if test="status != null and status != ''">, #{status}</if>-->
+<!--        <if test="del_flag != null and del_flag != ''">, #{del_flag}</if>-->
+<!--        )-->
+<!--    </insert>-->
 
-    <update id="updateGood" parameterType="com.backendsys.entity.B2c.B2cGoodDTO"
-        useGeneratedKeys="true" keyProperty="good_id">
-        UPDATE b2c_goods
-        SET category_id = #{category_id},
-            good_name = #{good_name}
-            <if test="brand_id != null and brand_id != ''">, brand_id = #{brand_id}</if>
-            <if test="unit_id != null and unit_id != ''">, unit_id = #{unit_id}</if>
-            <if test="good_description != null and good_description != ''">, good_description = #{good_description}</if>
-            <if test="good_content != null and good_content != ''">, good_content = #{good_content}</if>
-            <if test="good_thumb != null and good_thumb != ''">, good_thumb = #{good_thumb}</if>
-            <if test="good_images != null and good_images != ''">, good_images = #{good_images}</if>
-            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>
-            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>
-            <if test="status != null and status != ''">, status = #{status}</if>
-            <if test="del_flag != null and del_flag != ''">, del_flag = #{del_flag}</if>
-        WHERE id = #{good_id}
-    </update>
+<!--    <update id="updateGood" parameterType="com.backendsys.entity.B2c.B2cGoodDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="good_id">-->
+<!--        UPDATE b2c_goods-->
+<!--        SET category_id = #{category_id},-->
+<!--            good_name = #{good_name}-->
+<!--            <if test="brand_id != null and brand_id != ''">, brand_id = #{brand_id}</if>-->
+<!--            <if test="unit_id != null and unit_id != ''">, unit_id = #{unit_id}</if>-->
+<!--            <if test="good_description != null and good_description != ''">, good_description = #{good_description}</if>-->
+<!--            <if test="good_content != null and good_content != ''">, good_content = #{good_content}</if>-->
+<!--            <if test="good_thumb != null and good_thumb != ''">, good_thumb = #{good_thumb}</if>-->
+<!--            <if test="good_images != null and good_images != ''">, good_images = #{good_images}</if>-->
+<!--            <if test="meta_keyword != null and meta_keyword != ''">, meta_keyword = #{meta_keyword}</if>-->
+<!--            <if test="meta_description != null and meta_description != ''">, meta_description = #{meta_description}</if>-->
+<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
+<!--            <if test="del_flag != null and del_flag != ''">, del_flag = #{del_flag}</if>-->
+<!--        WHERE id = #{good_id}-->
+<!--    </update>-->
 
-    <delete id="deleteGood">
-        DELETE FROM b2c_goods WHERE id = #{good_id}
-    </delete>
+<!--    <delete id="deleteGood">-->
+<!--        DELETE FROM b2c_goods WHERE id = #{good_id}-->
+<!--    </delete>-->
 
-</mapper>
+<!--</mapper>-->

+ 13 - 13
src/main/java/com/backendsys/service/B2c/B2cGoodService.java

@@ -1,13 +1,13 @@
-package com.backendsys.service.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodDTO;
-
-import java.util.Map;
-
-public interface B2cGoodService {
-    Map<String, Object> queryGoodList(Integer pageNum, Integer pageSize, B2cGoodDTO b2cGoodDTO);
-    Map<String, Object> queryGoodDetail(Long good_id);
-    Map<String, Object> insertGood(B2cGoodDTO b2cGoodDTO);
-    Map<String, Object> updateGood(B2cGoodDTO b2cGoodDTO);
-    Map<String, Object> deleteGood(B2cGoodDTO b2cGoodDTO);
-}
+//package com.backendsys.service.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodDTO;
+//
+//import java.util.Map;
+//
+//public interface B2cGoodService {
+//    Map<String, Object> queryGoodList(Integer pageNum, Integer pageSize, B2cGoodDTO b2cGoodDTO);
+//    Map<String, Object> queryGoodDetail(Long good_id);
+//    Map<String, Object> insertGood(B2cGoodDTO b2cGoodDTO);
+//    Map<String, Object> updateGood(B2cGoodDTO b2cGoodDTO);
+//    Map<String, Object> deleteGood(B2cGoodDTO b2cGoodDTO);
+//}

+ 72 - 72
src/main/java/com/backendsys/service/B2c/B2cGoodServiceImpl.java

@@ -1,72 +1,72 @@
-package com.backendsys.service.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodDTO;
-import com.backendsys.mapper.B2c.B2cGoodMapper;
-import com.backendsys.utils.response.PageInfoResult;
-import com.github.pagehelper.PageHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class B2cGoodServiceImpl implements B2cGoodService {
-
-    @Autowired
-    private B2cGoodMapper b2cGoodMapper;
-
-    /**
-     * 查询 列表
-     */
-    public Map<String, Object> queryGoodList(Integer pageNum, Integer pageSize, B2cGoodDTO b2cGoodDTO) {
-        // 分页查询
-        if (pageNum != null && pageSize != null) {
-            PageHelper.startPage(pageNum, pageSize);
-            PageHelper.getLocalPage().setPageSizeZero(true);
-        }
-        // 分页输出 (自定义)
-        List<Map<String, Object>> list = b2cGoodMapper.queryGoodList(b2cGoodDTO);
-        PageInfoResult pageInfoResult = new PageInfoResult(list);
-        return pageInfoResult.toMap();
-    }
-
-    /**
-     * 查询 详情
-     */
-    @Override
-    public Map<String, Object> queryGoodDetail(Long good_id) {
-        return b2cGoodMapper.queryGoodDetail(good_id);
-    }
-
-    /**
-     * 创建
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> insertGood(B2cGoodDTO b2cGoodDTO) {
-        b2cGoodMapper.insertGood(b2cGoodDTO);
-        return Map.of("good_id", b2cGoodDTO.getGood_id());
-    }
-
-    /**
-     * 更新
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> updateGood(B2cGoodDTO b2cGoodDTO) {
-        b2cGoodMapper.updateGood(b2cGoodDTO);
-        return Map.of("good_id", b2cGoodDTO.getGood_id());
-    }
-
-    /**
-     * 删除
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> deleteGood(B2cGoodDTO b2cGoodDTO) {
-        b2cGoodMapper.deleteGood(b2cGoodDTO);
-        return Map.of("good_id", b2cGoodDTO.getGood_id());
-    }
-}
+//package com.backendsys.service.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodDTO;
+//import com.backendsys.mapper.B2c.B2cGoodMapper;
+//import com.backendsys.utils.response.PageInfoResult;
+//import com.github.pagehelper.PageHelper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Service
+//public class B2cGoodServiceImpl implements B2cGoodService {
+//
+//    @Autowired
+//    private B2cGoodMapper b2cGoodMapper;
+//
+//    /**
+//     * 查询 列表
+//     */
+//    public Map<String, Object> queryGoodList(Integer pageNum, Integer pageSize, B2cGoodDTO b2cGoodDTO) {
+//        // 分页查询
+//        if (pageNum != null && pageSize != null) {
+//            PageHelper.startPage(pageNum, pageSize);
+//            PageHelper.getLocalPage().setPageSizeZero(true);
+//        }
+//        // 分页输出 (自定义)
+//        List<Map<String, Object>> list = b2cGoodMapper.queryGoodList(b2cGoodDTO);
+//        PageInfoResult pageInfoResult = new PageInfoResult(list);
+//        return pageInfoResult.toMap();
+//    }
+//
+//    /**
+//     * 查询 详情
+//     */
+//    @Override
+//    public Map<String, Object> queryGoodDetail(Long good_id) {
+//        return b2cGoodMapper.queryGoodDetail(good_id);
+//    }
+//
+//    /**
+//     * 创建
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> insertGood(B2cGoodDTO b2cGoodDTO) {
+//        b2cGoodMapper.insertGood(b2cGoodDTO);
+//        return Map.of("good_id", b2cGoodDTO.getGood_id());
+//    }
+//
+//    /**
+//     * 更新
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> updateGood(B2cGoodDTO b2cGoodDTO) {
+//        b2cGoodMapper.updateGood(b2cGoodDTO);
+//        return Map.of("good_id", b2cGoodDTO.getGood_id());
+//    }
+//
+//    /**
+//     * 删除
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> deleteGood(B2cGoodDTO b2cGoodDTO) {
+//        b2cGoodMapper.deleteGood(b2cGoodDTO);
+//        return Map.of("good_id", b2cGoodDTO.getGood_id());
+//    }
+//}