Bladeren bron

代码提交

cxd 6 maanden geleden
bovenliggende
commit
bc44fa69c1

+ 17 - 29
gqy-system/src/main/java/com/gqy/document/domain/DcSpec.java

@@ -27,31 +27,11 @@ public class DcSpec extends BaseEntity {
 
     /** 文档块id */
     @Excel(name = "文档块id")
-    private Integer ps_dck_id;
-
-    /** 状态  0正常,1停用,2删除  */
-    private Integer ps_status;
-
+    private Integer dcb_id;
 
     /** 所属分类*/
     private String ps_category;
 
-    public String getPs_category() {
-        return ps_category;
-    }
-    public void setPs_category(String ps_category) {
-        this.ps_category = ps_category;
-    }
-
-
-
-    public Integer getPs_status() {
-        return ps_status;
-    }
-    public void setPs_status(Integer ps_status) {
-        this.ps_status = ps_status;
-    }
-
     public Integer getPs_id() {
         return ps_id;
     }
@@ -60,14 +40,22 @@ public class DcSpec extends BaseEntity {
         this.ps_id = ps_id;
     }
 
+    public Integer getPs_p_id() {
+        return ps_p_id;
+    }
 
+    public void setPs_p_id(Integer ps_p_id) {
+        this.ps_p_id = ps_p_id;
+    }
 
     public String getPs_no() {
         return ps_no;
     }
+
     public void setPs_no(String ps_no) {
         this.ps_no = ps_no;
     }
+
     public String getPs_name() {
         return ps_name;
     }
@@ -76,19 +64,19 @@ public class DcSpec extends BaseEntity {
         this.ps_name = ps_name;
     }
 
-    public Integer getPs_dck_id() {
-        return ps_dck_id;
+    public Integer getDcb_id() {
+        return dcb_id;
     }
 
-    public void setPs_dck_id(Integer ps_dck_id) {
-        this.ps_dck_id = ps_dck_id;
+    public void setDcb_id(Integer dcb_id) {
+        this.dcb_id = dcb_id;
     }
 
-    public Integer getPs_p_id() {
-        return ps_p_id;
+    public String getPs_category() {
+        return ps_category;
     }
 
-    public void setPs_p_id(Integer ps_p_id) {
-        this.ps_p_id = ps_p_id;
+    public void setPs_category(String ps_category) {
+        this.ps_category = ps_category;
     }
 }

+ 1 - 4
gqy-system/src/main/java/com/gqy/document/service/IDcSpecService.java

@@ -48,10 +48,7 @@ public interface IDcSpecService {
      */
     public int insertDcSpecParam(Map maps);
 
-    /**
-     * 修改产品规格
-     */
-    public int updateDcSpec(DcSpec dcSpec);
+
 
     /**
      * 修改规格 包括 规格参数

+ 1 - 4
gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java

@@ -94,7 +94,7 @@ public class DcSpecServiceImpl implements IDcSpecService {
             String ps_no = maps.get("ps_no").toString();
             dcSpec.setPs_no(ps_no);
             dcSpec.setPs_name(maps.get("ps_name").toString());
-            dcSpec.setPs_status(Integer.valueOf(UserStatus.OK.getCode()));
+         //   dcSpec.setPs_status(Integer.valueOf(UserStatus.OK.getCode()));
             dcSpec.setPs_category(maps.get("ps_category").toString());
             dcSpecMapper.insertDcSpec(dcSpec);
 
@@ -114,9 +114,6 @@ public class DcSpecServiceImpl implements IDcSpecService {
         return 0;
     }
 
-    public int updateDcSpec(DcSpec dcSpec) {
-        return dcSpecMapper.updateDcSpec(dcSpec);
-    }
 
 
     /**

+ 3 - 3
gqy-system/src/main/resources/mapper/document/DcProductMapper.xml

@@ -30,9 +30,9 @@
 
     <!-- 先查询所有规格参数名称 -->
     <select id="selectAllParamNames" resultType="string">
-        SELECT DISTINCT ps_name
+        SELECT DISTINCT psp_name
         FROM dc_ps_param
-        ORDER BY ps_name
+        ORDER BY psp_name
     </select>
 
     <!-- 动态构建SQL的查询 -->
@@ -43,7 +43,7 @@
         p.dcp_name,
         p.dcp_model,
         <foreach item="paramName" collection="paramNames" separator=",">
-            MAX(CASE WHEN param.ps_name = #{paramName} THEN spec.ps_value END) as "${paramName}"
+            MAX(CASE WHEN param.psp_name = #{paramName} THEN spec.psp_value END) as "${paramName}"
         </foreach>
         FROM
         dc_product p

+ 2 - 2
gqy-system/src/main/resources/mapper/document/DcPsParamMapper.xml

@@ -25,10 +25,10 @@
         s.ps_p_id,
         s.ps_no,
         s.ps_name,
-        s.ps_dck_id,
+        s.dcb_id,
         s.ps_category
         FROM dc_ps_param p
-        LEFT JOIN dc_spec s ON p.psp_mode = s.ps_no
+        LEFT JOIN dc_p_spec s ON p.psp_mode = s.ps_no
         <where>
             <if test="ps_name != null and ps_name != ''">
                 AND s.ps_name like concat('%', #{ps_name}, '%')

+ 25 - 21
gqy-system/src/main/resources/mapper/document/DcSpecMapper.xml

@@ -7,35 +7,23 @@
         <result property="ps_p_id"   column="ps_p_id"   />
         <result property="ps_no"     column="ps_no"     />
         <result property="ps_name"   column="ps_name"   />
-        <result property="ps_status"   column="ps_status"   />
-        <result property="ps_dck_id" column="ps_dck_id" />
         <result property="ps_category" column="ps_category" />
+        <result property="dcb_id" column="dcb_id" />
+
     </resultMap>
 
     <sql id="selectDcSpecVo">
-        select ps_id, ps_p_id, ps_no, ps_name, ps_dck_id,ps_category from dc_spec
+        select ps_id, ps_p_id, ps_no, ps_name, dcb_id,ps_category from dc_p_spec
     </sql>
 
-    <select id="selectDcSpecList" parameterType="DcSpec" resultMap="DcSpecResult">
-        <include refid="selectDcSpecVo"/>
-        <where>
-            <if test="ps_p_id != null  and ps_p_id != ''"> and ps_p_id = #{ps_p_id}</if>
-            <if test="ps_no != null  and ps_no != ''"> and ps_no = #{pa_no}</if>
-            <if test="ps_name != null  and ps_name != ''"> and ps_name like concat('%', #{ps_name}, '%')</if>
-            <if test="ps_dck_id != null "> and ps_dck_id = #{ps_dck_id}</if>
-        </where>
-    </select>
-
-    <!-- 其他SQL语句的参数名也需要相应修改 -->
-
 
     <insert id="insertDcSpec" parameterType="DcSpec" useGeneratedKeys="true" keyProperty="ps_id">
-        insert into dc_spec
+        insert into dc_p_spec
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="ps_p_id != null and ps_p_id != ''">ps_p_id,</if>
             <if test="ps_no != null and ps_no != ''">ps_no,</if>
             <if test="ps_name != null and ps_name != ''">ps_name,</if>
-            <if test="ps_dck_id != null">ps_dck_id,</if>
+            <if test="dcb_id != null">dcb_id,</if>
             <if test="ps_category != null">ps_category,</if>
 
         </trim>
@@ -43,18 +31,34 @@
             <if test="ps_p_id != null and ps_p_id != ''">#{ps_p_id},</if>
             <if test="ps_no != null and ps_no != ''">#{ps_no},</if>
             <if test="ps_name != null and ps_name != ''">#{ps_name},</if>
-            <if test="ps_dck_id != null">#{ps_dck_id},</if>
+            <if test="dcb_id != null">#{dcb_id},</if>
             <if test="ps_category != null">#{ps_category},</if>
         </trim>
     </insert>
 
+
+    <select id="selectDcSpecList" parameterType="DcSpec" resultMap="DcSpecResult">
+        <include refid="selectDcSpecVo"/>
+        <where>
+            <if test="ps_p_id != null  and ps_p_id != ''"> and ps_p_id = #{ps_p_id}</if>
+            <if test="ps_no != null  and ps_no != ''"> and ps_no = #{pa_no}</if>
+            <if test="ps_name != null  and ps_name != ''"> and ps_name like concat('%', #{ps_name}, '%')</if>
+            <if test="dcb_id != null "> and dcb_id = #{dcb_id}</if>
+        </where>
+    </select>
+
+    <!-- 其他SQL语句的参数名也需要相应修改 -->
+
+
+
+
     <update id="updateDcSpec" parameterType="DcSpec">
-        update dc_spec
+        update dc_p_spec
         <trim prefix="SET" suffixOverrides=",">
             <if test="ps_p_id != null">ps_p_id = #{ps_p_id},</if>
             <if test="ps_no != null">ps_no = #{ps_no},</if>
             <if test="ps_name != null">ps_name = #{ps_name},</if>
-            <if test="ps_dck_id != null">ps_dck_id = #{ps_dck_id},</if>
+            <if test="dcb_id != null">dcb_id = #{dcb_id},</if>
             <if test="ps_category != null">ps_category = #{ps_category},</if>
         </trim>
         where ps_id = #{ps_id}
@@ -68,7 +72,7 @@
 
 
     <delete id="deleteDcSpecById" parameterType="Integer">
-        delete from dc_spec where ps_id = #{ps_id}
+        delete from dc_p_spec where ps_id = #{ps_id}
     </delete>
 
 </mapper>

+ 14 - 2
创建表语句.txt

@@ -353,7 +353,7 @@ CREATE TABLE `dc_system` (
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   `update_time` datetime DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`sys_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='系统表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='系统表';
 
 
 ===========规格管理
@@ -365,7 +365,7 @@ CREATE TABLE `dc_ps_param` (
   `psp_value` varchar(200) DEFAULT NULL COMMENT '参数值',
   `dcb_id` int DEFAULT '0' COMMENT '文档块id',
   PRIMARY KEY (`psp_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='产品参数表';
+)  COMMENT='产品参数表';
 
 
 ------ 创建产品表
@@ -399,3 +399,15 @@ CREATE TABLE `dc_work_system` (
 
 
 
+CREATE TABLE `dc_p_spec` (
+  `ps_id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '产品规格主键',
+  `ps_p_id` bigint(19) NOT NULL DEFAULT '0' COMMENT '产品主表键',
+  `ps_no` varchar(64) DEFAULT NULL COMMENT '规格编号(编码)box.xt',
+  `ps_name` varchar(200) DEFAULT NULL COMMENT '规格名称/描述',
+  `dcb_id` bigint(19) DEFAULT '0' COMMENT '关联知识id',
+  PRIMARY KEY (`ps_id`),
+  KEY `idx_ps_p_id` (`ps_p_id`) COMMENT '产品ID索引'
+) COMMENT='产品规格表';
+
+
+