fix(entity): 修复ShopDealerSetting实体映射问题

- 添加TableField注解以正确映射数据库字段
- 将关键字字段名用反引号包围避免SQL语法冲突
- 更新XML映射文件中的字段引用为带反引号的形式
- 确保数据库查询与实体字段映射一致
This commit is contained in:
2026-02-05 15:08:55 +08:00
parent 093826435e
commit ee9ea88ce9
2 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.shop.entity; package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable; import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@@ -20,13 +21,15 @@ public class ShopDealerSetting implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Schema(description = "设置项标示") @Schema(description = "设置项标示")
@TableId(value = "key", type = IdType.INPUT) @TableId(value = "`key`", type = IdType.INPUT)
private String key; private String key;
@Schema(description = "设置项描述") @Schema(description = "设置项描述")
@TableField(value = "`describe`")
private String describe; private String describe;
@Schema(description = "设置内容(json格式)") @Schema(description = "设置内容(json格式)")
@TableField(value = "`values`")
private String values; private String values;
@Schema(description = "商城ID") @Schema(description = "商城ID")

View File

@@ -8,13 +8,13 @@
FROM shop_dealer_setting a FROM shop_dealer_setting a
<where> <where>
<if test="param.key != null"> <if test="param.key != null">
AND a.key = #{param.key} AND a.`key` = #{param.key}
</if> </if>
<if test="param.describe != null"> <if test="param.describe != null">
AND a.describe LIKE CONCAT('%', #{param.describe}, '%') AND a.`describe` LIKE CONCAT('%', #{param.describe}, '%')
</if> </if>
<if test="param.values != null"> <if test="param.values != null">
AND a.values LIKE CONCAT('%', #{param.values}, '%') AND a.`values` LIKE CONCAT('%', #{param.values}, '%')
</if> </if>
<if test="param.keywords != null"> <if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')