linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
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">