From ee9ea88ce96c7836229699e1d16091368b997b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 5 Feb 2026 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(entity):=20=E4=BF=AE=E5=A4=8DShopDealerSett?= =?UTF-8?q?ing=E5=AE=9E=E4=BD=93=E6=98=A0=E5=B0=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加TableField注解以正确映射数据库字段 - 将关键字字段名用反引号包围避免SQL语法冲突 - 更新XML映射文件中的字段引用为带反引号的形式 - 确保数据库查询与实体字段映射一致 --- .../java/com/gxwebsoft/shop/entity/ShopDealerSetting.java | 5 ++++- .../gxwebsoft/shop/mapper/xml/ShopDealerSettingMapper.xml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerSetting.java b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerSetting.java index 9a9e360..710cf79 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerSetting.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerSetting.java @@ -1,6 +1,7 @@ package com.gxwebsoft.shop.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import io.swagger.v3.oas.annotations.media.Schema; @@ -20,13 +21,15 @@ public class ShopDealerSetting implements Serializable { private static final long serialVersionUID = 1L; @Schema(description = "设置项标示") - @TableId(value = "key", type = IdType.INPUT) + @TableId(value = "`key`", type = IdType.INPUT) private String key; @Schema(description = "设置项描述") + @TableField(value = "`describe`") private String describe; @Schema(description = "设置内容(json格式)") + @TableField(value = "`values`") private String values; @Schema(description = "商城ID") diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerSettingMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerSettingMapper.xml index 69d68d3..66e51a2 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerSettingMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerSettingMapper.xml @@ -8,13 +8,13 @@ FROM shop_dealer_setting a - AND a.key = #{param.key} + AND a.`key` = #{param.key} - AND a.describe LIKE CONCAT('%', #{param.describe}, '%') + AND a.`describe` LIKE CONCAT('%', #{param.describe}, '%') - AND a.values LIKE CONCAT('%', #{param.values}, '%') + AND a.`values` LIKE CONCAT('%', #{param.values}, '%') AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')