tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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.cloudroam.mapper.SysDictItemMapperCustom">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.cloudroam.bo.SysDictItemBO">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="label" property="label" />
        <result column="value" property="value" />
        <result column="sort" property="sort" />
        <result column="dict_id" property="dictId" />
 
        <result column="name" property="name" />
        <result column="remark" property="remark" />
 
    </resultMap>
 
    <select id="selectSysDictItemWithDictList" resultMap="BaseResultMap">
 
        select d.`name`,d.remark,i.id,i.label,i.`value`,i.sort,i.dict_id
        from sys_dict d
        left join sys_dict_item i
        on d.id=i.dict_id
        where d.is_deleted=0
          and i.is_deleted=0
        <if test=" dictId !=null and dictId !='' ">
            and i.dict_id=#{dictId}
        </if>
        <if test=" keyword !=null and keyword !='' ">
            and ( i.label like concat('%',#{keyword},'%') or i.value like concat('%',#{keyword},'%') )
        </if>
        <if test=" dictType !=null and dictType !='' ">
            and d.name = #{dictType}
        </if>
 
        order by d.remark,i.sort asc
 
    </select>
 
 
</mapper>