| | |
| | | <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> |
| | | |
| | |
| | | </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"> |