From 27617d6fb4b836c52c78fd950acf412e49d0e96b Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 28 二月 2025 09:32:00 +0800
Subject: [PATCH] 在库项目查询bug
---
system/src/main/resources/mapper/system/SysDictDataMapper.xml | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/system/src/main/resources/mapper/system/SysDictDataMapper.xml b/system/src/main/resources/mapper/system/SysDictDataMapper.xml
index 1bd884a..a821325 100644
--- a/system/src/main/resources/mapper/system/SysDictDataMapper.xml
+++ b/system/src/main/resources/mapper/system/SysDictDataMapper.xml
@@ -18,10 +18,11 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
+ <result property="parentId" column="parent_id" />
</resultMap>
<sql id="selectDictDataVo">
- select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
+ select dict_code, dict_sort,parent_id, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
</sql>
@@ -33,6 +34,9 @@
</if>
<if test="dictLabel != null and dictLabel != ''">
AND dict_label like concat('%', #{dictLabel}, '%')
+ </if>
+ <if test="parentId != null">
+ AND parent_id = #{parentId}
</if>
<if test="status != null and status != ''">
AND status = #{status}
@@ -75,6 +79,7 @@
update sys_dict_data
<set>
<if test="dictSort != null">dict_sort = #{dictSort},</if>
+ <if test="parentId != null">parent_id = #{parentId},</if>
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
@@ -93,9 +98,15 @@
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
</update>
+ <select id="selectDictDataByValue" parameterType="string" resultMap="SysDictDataResult">
+ <include refid="selectDictDataVo"/>
+ where dict_value = #{dictValue} AND parent_id = (SELECT dict_code FROM sys_dict_data WHERE dict_value = #{parentValue} AND dict_type = #{dictType}) AND dict_type = #{dictType}
+ </select>
+
<insert id="insertDictData" parameterType="SysDictData">
insert into sys_dict_data(
<if test="dictSort != null">dict_sort,</if>
+ <if test="parentId != null">parent_id,</if>
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
<if test="dictValue != null and dictValue != ''">dict_value,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
@@ -108,6 +119,7 @@
create_time
)values(
<if test="dictSort != null">#{dictSort},</if>
+ <if test="parentId != null">#{parentId},</if>
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
--
Gitblit v1.8.0