From 764d883b5ea3bdc06abbec548b6df0511e567978 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Tue, 03 Sep 2024 09:46:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/binlog' into binlog
---
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
index f6c85d6..9264842 100644
--- a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
@@ -15,11 +15,12 @@
<result column="is_deleted" property="isDeleted"/>
</resultMap>
- <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
+ <resultMap id="treeNodeResultMap" type="org.springblade.modules.system.entity.TreeNodeTwo">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
+ <result column="remark" property="remark"/>
<result column="key" property="key"/>
</resultMap>
@@ -37,11 +38,53 @@
</select>-->
<select id="getList" resultMap="dictResultMap">
- select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0
+ SELECT
+ id,
+ tenant_id,
+ parent_id,
+ CODE,
+ dict_key,
+ dict_value,
+ sort,
+ remark
+ FROM
+ blade_dict_biz
+ WHERE
+ CODE = #{param1}
+ and parent_id > 0
+ and is_sealed = 0
+ and is_deleted = 0
+ <if test="param2!=null">
+ and parent_id = #{param2}
+ </if>
</select>
<select id="tree" resultMap="treeNodeResultMap">
- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0
+ SELECT
+ id,
+ parent_id,
+ dict_value AS title,
+ id AS "value",
+ dict_key AS "key",
+ remark,
+ (
+ SELECT
+ CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
+ FROM
+ blade_dict_biz
+ WHERE
+ parent_id = id and is_deleted = 0
+ ) AS hasChildren
+ FROM
+ blade_dict_biz
+ <where>
+ <if test="param1 != null and param1 != ''">
+ CODE = #{param1}
+ and parent_id > 0
+ </if>
+ and is_deleted = 0
+ </where>
+
</select>
<select id="parentTree" resultMap="treeNodeResultMap">
--
Gitblit v1.9.3