From ffa764f4f9b37416341ae6f0ea35fce14b27a732 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Mon, 21 Apr 2025 17:22:28 +0800 Subject: [PATCH] =?UTF-8?q?4.21=20=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/gss/domain/ProductCategory.java | 27 +++++++++++++++++++ .../mapper/gss/ProductCategoryMapper.xml | 18 +++++++++++-- sql/gss/产品分类表.sql | 2 ++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java b/ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java index 1b0975b..8a8e030 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java +++ b/ruoyi-system/src/main/java/com/ruoyi/gss/domain/ProductCategory.java @@ -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 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 .append("categoryCode", getCategoryCode()) .append("categoryName", getCategoryName()) .append("categoryNameEn", getCategoryNameEn()) + .append("productLine", getProductLine()) + .append("productLineCode", getProductLineCode()) .append("parentId", getParentId()) .append("ancestors", getAncestors()) .append("categoryLevel", getCategoryLevel()) diff --git a/ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml b/ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml index 896dbbe..f24a3f2 100644 --- a/ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/gss/ProductCategoryMapper.xml @@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -24,7 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 @@ -38,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND category_name like concat('%', #{categoryName}, '%') + + AND product_line = #{productLine} + + + AND product_line_code = #{productLineCode} + AND category_level = #{categoryLevel} @@ -82,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" category_code, category_name, category_name_en, + product_line, + product_line_code, parent_id, ancestors, category_level, @@ -110,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" category_code = #{categoryCode}, category_name = #{categoryName}, category_name_en = #{categoryNameEn}, + product_line = #{productLine}, + product_line_code = #{productLineCode}, parent_id = #{parentId}, ancestors = #{ancestors}, category_level = #{categoryLevel}, @@ -147,7 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/sql/gss/产品分类表.sql b/sql/gss/产品分类表.sql index 76cd265..74b4f29 100644 --- a/sql/gss/产品分类表.sql +++ b/sql/gss/产品分类表.sql @@ -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小类)',