From 1b278d23d36d35e0f7902e171385d33a445d05c1 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Tue, 10 Jun 2025 18:21:33 +0800 Subject: [PATCH] =?UTF-8?q?product=5Fmapping=EF=BC=8Cuser=5Fdevice=5Fbind?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9sql=E5=92=8C=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/common/modules/sync/ProductMapping.java | 12 ++++++++++++ .../mall/common/modules/sync/StoreDbConfig.java | 5 +++++ sql/shop/dev/20250522_ddl.sql | 2 ++ sql/shop/dev/20250602_ddl.sql | 4 +++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java index 9786763f..7402121e 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/ProductMapping.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -12,6 +13,7 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; import java.util.List; import static com.baomidou.mybatisplus.annotation.FieldStrategy.NOT_EMPTY; @@ -54,6 +56,16 @@ public class ProductMapping implements Serializable { @ApiModelProperty("排序值") private Integer sortOrder; + @TableField("create_time") + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @TableField("update_time") + @ApiModelProperty(value = "更新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + /** * 生成唯一键:productName + storeId + specValue + specUnit diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/StoreDbConfig.java b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/StoreDbConfig.java index 7c979547..65ee871c 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/sync/StoreDbConfig.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/sync/StoreDbConfig.java @@ -84,4 +84,9 @@ public class StoreDbConfig implements Serializable { @TableField("remark") @ApiModelProperty(value = "备注信息") private String remark; + + @TableField("refresh_time") + @ApiModelProperty(value = "刷新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date refreshTime; } \ No newline at end of file diff --git a/sql/shop/dev/20250522_ddl.sql b/sql/shop/dev/20250522_ddl.sql index 2c157fb4..bfdb5b0c 100644 --- a/sql/shop/dev/20250522_ddl.sql +++ b/sql/shop/dev/20250522_ddl.sql @@ -6,6 +6,8 @@ CREATE TABLE `user_device_bind` ( `os_type` varchar(16) NOT NULL COMMENT '手机系统类型 (Android/iOS)', `bind_time` datetime NOT NULL COMMENT '绑定时间', `last_active` datetime NOT NULL COMMENT '最后活跃时间', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_user_id` (`user_id`), KEY `idx_cid` (`cid`), diff --git a/sql/shop/dev/20250602_ddl.sql b/sql/shop/dev/20250602_ddl.sql index cef2dea8..dce4f690 100644 --- a/sql/shop/dev/20250602_ddl.sql +++ b/sql/shop/dev/20250602_ddl.sql @@ -6,6 +6,8 @@ CREATE TABLE `product_mapping` ( `description` text , `sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序值', `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '店铺编号', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_product_name` (`product_name`) USING BTREE, KEY `idx_store_id` (`store_id`) USING BTREE @@ -18,7 +20,7 @@ alter table shop_product_base add column `unit_price` DECIMAL(18,4) NOT NULL COM alter table shop_base_product_spec add column `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '店铺编号'; alter table shop_base_product_spec add index `store_id` (`store_id`) USING BTREE; -INSERT INTO mall_dev.shop_base_product_state +INSERT INTO shop_base_product_state (product_state_id, product_state_name, product_state_text_1, product_state_text_2, product_state_remark) VALUES(1003, 'PRODUCT_STATE_OFF_THE_SHELF_UNCHECK', '下架未分配商品', '同步数据未分配', '');