cjl
2023-10-19 2a4a9ef52b0d76efb9712fd8d4268f658546f99f
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
<?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.moral.api.mapper.SysDictTypeMapper">
 
        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.moral.api.entity.SysDictType">
                    <id column="id" property="id" />
                    <result column="name" property="name" />
                    <result column="desc" property="desc" />
                    <result column="system" property="system" />
                    <result column="create_time" property="createTime" />
                    <result column="update_time" property="updateTime" />
                    <result column="is_delete" property="isDelete" />
        </resultMap>
    <select id="selectCodeList" resultType="com.moral.api.entity.SysDictData">
        select t1.id,t1.dict_type_id,t1.dataKey,t1.dataValue from sys_dict_type t
                             left join sys_dict_data t1 on t1.dict_type_id = t.id
        where t.is_delete = 0 and t.name = #{code} and t1.dataKey = #{id} and t1.is_delete = 0
        order by t1.create_time desc
    </select>
 
    <select id="selectIdList" resultType="com.moral.api.entity.SysDictData">
        select DISTINCT t1.id,t1.dict_type_id,t1.dataKey,t1.dataValue from sys_dict_type t
        left join sys_dict_data t1 on t1.dict_type_id = t.id
        where t.is_delete = 0 and t.name = #{code} and
        t1.dataKey in
        <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
            #{id}
        </foreach>
         and t1.is_delete = 0
        order by t1.create_time desc
    </select>
</mapper>