1.0
xin
2025-04-15 e718afd02965c6a4018506acb1ae99baca0c5645
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
45
46
47
48
49
50
51
52
53
<?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.oying.modules.system.mapper.DictDetailMapper">
<resultMap id="BaseResultMap" type="com.oying.modules.system.domain.DictDetail">
        <id column="detail_id" property="id" jdbcType="BIGINT"/>
        <result column="label" property="label" jdbcType="VARCHAR"/>
        <result column="value" property="value" jdbcType="VARCHAR"/>
        <result column="dict_sort" property="dictSort" jdbcType="INTEGER"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <association property="dict" javaType="com.oying.modules.system.domain.Dict">
            <id column="dict_id" property="id" jdbcType="BIGINT"/>
            <result column="name" property="name" jdbcType="VARCHAR"/>
        </association>
    </resultMap>
 
    <sql id="Base_Column_List">
        dd.detail_id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time, d.dict_id, d.name
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from sys_dict_detail dd, sys_dict d
        where dd.dict_id = d.dict_id
        <if test="criteria.dictName != null and criteria.dictName != ''">
            and d.name = #{criteria.dictName}
        </if>
        <if test="criteria.label != null and criteria.label != ''">
            and dd.label = #{criteria.label}
        </if>
        order by dd.dict_sort, dd.dict_id desc
    </select>
 
    <select id="findByDictName" resultMap="BaseResultMap">
        select <include refid="Base_Column_List"/>
        from sys_dict_detail dd, sys_dict d
        where dd.dict_id = d.dict_id
        <if test="name != null and name != ''">
            and d.name = #{name}
        </if>
        order by dd.dict_sort
    </select>
 
    <delete id="deleteByDictBatchIds">
        delete from sys_dict_detail
        where dict_id in
        <foreach collection="dictIds" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
</mapper>