heheng
2025-03-27 5d2cfd4562f74496a5263db3451c1e78ff53aead
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
43
44
<?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.gkhy.assess.system.mapper.SysDictDataMapper">
 
    <sql id="selectDictDataVo">
        select d.id, d.sort, d.label, d.value, d.dict_type,d.is_default, d.status, d.create_time, d.remark
        from sys_dict_data d
    </sql>
 
    <update id="updateDictDataDictType">
        update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
    </update>
 
    <select id="countDictDataByType" resultType="java.lang.Integer">
        select count(1) from sys_dict_data where dict_type=#{dictType} and del_flag=0
    </select>
 
    <select id="getDictDataByType" resultType="com.gkhy.assess.system.domain.SysDictData">
        <include refid="selectDictDataVo"/>
        where d.dict_type=#{dictType} and d.status=0 and d.del_flag=0
        order by d.sort asc
    </select>
 
    <select id="getDictDataById" resultType="com.gkhy.assess.system.domain.SysDictData">
        <include refid="selectDictDataVo"/>
        where d.id=#{dictId}
    </select>
 
    <select id="dictDataList" resultType="com.gkhy.assess.system.domain.SysDictData">
        <include refid="selectDictDataVo"/>
        <where>
            and del_flag=0
            <if test="dictType != null and dictType != ''">
                AND dict_type = #{dictType}
            </if>
            <if test="label != null and label != ''">
                AND label like concat('%', #{label}, '%')
            </if>
            <if test="status != null">
                AND status = #{status}
            </if>
        </where>
    </select>
</mapper>