Browse Source

4.21 提交

dev
xiaoyu 3 weeks ago
parent
commit
ffa764f4f9
  1. 27
      ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java
  2. 18
      ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml
  3. 2
      sql/gss/产品分类表.sql

27
ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java

@ -24,6 +24,14 @@ public class ProductCategory extends TreeEntity @@ -24,6 +24,14 @@ public class ProductCategory extends TreeEntity
@Excel(name = "分类英文名称")
private String categoryNameEn;
/** 产品线 */
@Excel(name = "产品线")
private String productLine;
/** 产品线编码 */
@Excel(name = "产品线编码")
private String productLineCode;
/** 分类级别(1大类 2中类 3小类) */
@Excel(name = "分类级别", readConverterExp = "1=大类,2=中类,3=小类")
private String categoryLevel;
@ -91,6 +99,23 @@ public class ProductCategory extends TreeEntity @@ -91,6 +99,23 @@ public class ProductCategory extends TreeEntity
this.delFlag = delFlag;
}
// 添加 getter 和 setter 方法
public String getProductLine() {
return productLine;
}
public void setProductLine(String productLine) {
this.productLine = productLine;
}
public String getProductLineCode() {
return productLineCode;
}
public void setProductLineCode(String productLineCode) {
this.productLineCode = productLineCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -98,6 +123,8 @@ public class ProductCategory extends TreeEntity @@ -98,6 +123,8 @@ public class ProductCategory extends TreeEntity
.append("categoryCode", getCategoryCode())
.append("categoryName", getCategoryName())
.append("categoryNameEn", getCategoryNameEn())
.append("productLine", getProductLine())
.append("productLineCode", getProductLineCode())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("categoryLevel", getCategoryLevel())

18
ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml

@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="categoryCode" column="category_code" />
<result property="categoryName" column="category_name" />
<result property="categoryNameEn" column="category_name_en" />
<result property="productLine" column="product_line" />
<result property="productLineCode" column="product_line_code"/>
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="categoryLevel" column="category_level" />
@ -24,7 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -24,7 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 修改基础查询SQL -->
<sql id="selectProductCategoryVo">
select category_id, category_name, category_code, parent_id, ancestors,
select category_id, category_name, category_code, category_name_en,
product_line, product_line_code, parent_id, ancestors,
category_level, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark
from dhc_product_category
</sql>
@ -38,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -38,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="categoryName != null and categoryName != ''">
AND category_name like concat('%', #{categoryName}, '%')
</if>
<if test="productLine != null and productLine != ''">
AND product_line = #{productLine}
</if>
<if test="productLineCode != null and productLineCode != ''">
AND product_line_code = #{productLineCode}
</if>
<if test="categoryLevel != null and categoryLevel != ''">
AND category_level = #{categoryLevel}
</if>
@ -82,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -82,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="categoryCode != null">category_code,</if>
<if test="categoryName != null">category_name,</if>
<if test="categoryNameEn != null">category_name_en,</if>
<if test="productLine != null">product_line,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="parentId != null">parent_id,</if>
<if test="ancestors != null">ancestors,</if>
<if test="categoryLevel != null">category_level,</if>
@ -110,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -110,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="categoryCode != null">category_code = #{categoryCode},</if>
<if test="categoryName != null">category_name = #{categoryName},</if>
<if test="categoryNameEn != null">category_name_en = #{categoryNameEn},</if>
<if test="productLine != null">product_line = #{productLine},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="categoryLevel != null">category_level = #{categoryLevel},</if>
@ -147,7 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -147,7 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 修改校验分类编码唯一性查询 -->
<select id="checkProductCategoryCodeUnique" parameterType="String" resultMap="ProductCategoryResult">
select category_id, category_name, category_code, parent_id, ancestors, status
select category_id, category_code, category_name, product_line, product_line_code,
parent_id, ancestors, status
from dhc_product_category
where category_code = #{categoryCode} limit 1
</select>

2
sql/gss/产品分类表.sql

@ -3,6 +3,8 @@ CREATE TABLE `dhc_product_category` ( @@ -3,6 +3,8 @@ CREATE TABLE `dhc_product_category` (
`category_code` varchar(10) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类编码',
`category_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
`category_name_en` varchar(200) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '分类英文名称',
`product_line` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品线',
`product_line_code` varchar(10) COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品线编码',
`parent_id` bigint DEFAULT '0' COMMENT '父分类ID',
`ancestors` varchar(500) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '祖级列表',
`category_level` char(1) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类级别(1大类 2中类 3小类)',

Loading…
Cancel
Save