You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
3.7 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysTreeDictDataMapper">
<resultMap type="com.ruoyi.system.domain.SysTreeDictData" id="TreeDictDataResult">
<id property="id" column="id"/>
<result property="label" column="label"/>
<result property="code" column="code"/>
<result property="remark" column="remark"/>
<result property="pid" column="pid"/>
<result property="orderNum" column="order_num"/>
<result property="levelCode" column="level_code"/>
<result property="levelDepth" column="level_depth"/>
<result property="isLeaf" column="is_leaf"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="treeDict" column="tree_dict"/>
<result property="path" column="path"/>
<result property="icon" column="icon"/>
</resultMap>
<sql id="selectTreeDictDataVo">
SELECT
o.id as id,
o.label as label,
o.tree_dict as tree_dict,
o.code as code,
o.remark as remark,
o.pid as pid,
o.order_num as order_num,
o.level_code as level_code,
o.level_depth as level_depth,
o.is_leaf as is_leaf,
o.path as path,
o.icon as icon
FROM sys_tree_dict_data o
LEFT JOIN sys_user u ON u.user_id = o.create_by
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
</sql>
<select id="selectTreeDictDataPage" parameterType="com.ruoyi.system.domain.SysTreeDictData"
resultMap="TreeDictDataResult">
<include refid="selectTreeDictDataVo"/>
<where>
o.del_flag = 0
<if test="entity.id != null and entity.id != ''">and o.id = #{entity.id}</if>
<if test="entity.treeDict != null and entity.treeDict != ''">and o.tree_dict = #{entity.treeDict}</if>
<if test="entity.label != null and entity.label != ''">and o.label like concat('%', #{label}, '%')</if>
<if test="entity.path != null and entity.path != ''">and o.path = #{entity.path}</if>
<if test="entity.isLeaf != null and entity.isLeaf != ''">and is_leaf = #{entity.isLeaf}</if>
<if test="entity.icon != null and entity.icon != ''">and o.icon = #{entity.icon}</if>
<!-- 数据范围过滤
${entity.params.dataScope}-->
</where>
order by o.order_num asc, o.level_code asc
</select>
<select id="selectTreeDictDataList" parameterType="com.ruoyi.system.domain.SysTreeDictData"
resultMap="TreeDictDataResult">
<include refid="selectTreeDictDataVo"/>
<where>
o.del_flag = 0
<if test="entity.id != null and entity.id != ''">and o.id = #{entity.id}</if>
<if test="entity.treeDict != null and entity.treeDict != ''">and o.tree_dict = #{entity.treeDict}</if>
<if test="entity.label != null and entity.label != ''">and o.LABEL like concat('%', #{label}, '%')</if>
<if test="entity.path != null and entity.path != ''">and o.path = #{entity.path}</if>
<if test="entity.isLeaf != null and entity.isLeaf != ''">and o.is_leaf = #{entity.isLeaf}</if>
<if test="entity.icon != null and entity.icon != ''">and o.icon = #{entity.icon}</if>
<!-- 数据范围过滤
${entity.params.dataScope}-->
</where>
order by o.order_num asc, o.level_code asc
</select>
</mapper>