From 589a3de1ee7852622d4c5432200a67a5bca5f77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Tue, 12 Nov 2024 09:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=8E=92=E5=BA=8F=E6=96=B9=E5=BC=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/entity/TbProductGroup.java | 13 +++++++++++++ .../resources/mapper/TbProductGroupMapper.xml | 18 +++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java index 1c5b0b6..7cf17fb 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java @@ -23,6 +23,11 @@ public class TbProductGroup implements Serializable { private String style; + /** + * 排序方式 0-默认 1-价格从高到低 2-销量由高到低 + */ + private String sortMode; + private Integer sort; private Long createdAt; @@ -186,4 +191,12 @@ public class TbProductGroup implements Serializable { public void setIsSale(Integer isSale) { this.isSale = isSale; } + + public String getSortMode() { + return sortMode; + } + + public void setSortMode(String sortMode) { + this.sortMode = sortMode; + } } \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductGroupMapper.xml b/src/main/resources/mapper/TbProductGroupMapper.xml index ef0d20b..4bd40bf 100644 --- a/src/main/resources/mapper/TbProductGroupMapper.xml +++ b/src/main/resources/mapper/TbProductGroupMapper.xml @@ -11,6 +11,7 @@ + @@ -21,7 +22,7 @@ - id, name, merchant_id, shop_id, pic, is_show, detail, style, sort, created_at, updated_at , use_time, sale_start_time, sale_end_time + id, name, merchant_id, shop_id, pic, is_show, detail, style, sort, sort_mode, created_at, updated_at , use_time, sale_start_time, sale_end_time product_ids @@ -41,12 +42,12 @@ insert into tb_product_group (id, name, merchant_id, shop_id, pic, is_show, - detail, style, sort, + detail, style, sort, sort_mode, created_at, updated_at, product_ids ) values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR}, #{isShow,jdbcType=TINYINT}, - #{detail,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{detail,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{sortMode,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{productIds,jdbcType=LONGVARCHAR} ) @@ -80,6 +81,9 @@ sort, + + sort_mode, + created_at, @@ -118,6 +122,9 @@ #{sort,jdbcType=INTEGER}, + + #{sortMode,jdbcType=INTEGER}, + #{createdAt,jdbcType=BIGINT}, @@ -156,6 +163,9 @@ sort = #{sort,jdbcType=INTEGER}, + + sort_mode = #{sort,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, @@ -178,6 +188,7 @@ detail = #{detail,jdbcType=VARCHAR}, style = #{style,jdbcType=VARCHAR}, sort = #{sort,jdbcType=INTEGER}, + sort_mode = #{sortMode,jdbcType=VARCHAR}, created_at = #{createdAt,jdbcType=BIGINT}, updated_at = #{updatedAt,jdbcType=BIGINT}, product_ids = #{productIds,jdbcType=LONGVARCHAR} @@ -193,6 +204,7 @@ detail = #{detail,jdbcType=VARCHAR}, style = #{style,jdbcType=VARCHAR}, sort = #{sort,jdbcType=INTEGER}, + sort_mode = #{sortMode,jdbcType=VARCHAR}, created_at = #{createdAt,jdbcType=BIGINT}, updated_at = #{updatedAt,jdbcType=BIGINT} where id = #{id,jdbcType=INTEGER}