“djh”
4 天以前 f99d902db3c31e57229439962abd2746bb06868d
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
<?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.exam.system.mapper.SysDictTypeMapper">
    <resultMap id="SysDictTypeResult" type="com.gkhy.exam.common.domain.entity.SysDictType">
        <id     property="id"     column="id"     />
        <result property="name"   column="name"   />
        <result property="dictType"   column="dict_type"   />
        <result property="status"     column="status"      />
        <result property="createBy"   column="create_by"   />
        <result property="createTime" column="create_time" />
        <result property="updateBy"   column="update_by"   />
        <result property="updateTime" column="update_time" />
    </resultMap>
 
    <sql id="selectDictTypeVo">
        select id, name, dict_type, status, create_by, create_time, remark
        from sys_dict_type
    </sql>
 
    <select id="selectDictTypeList" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        <where>
            <if test="name!=null and name!=''">
                and name like concat('%',#{name},'%')
            </if>
            <if test="status!=null">
                and status = #{status}
            </if>
            <if test="dictType!=null and dictType!=''">
                and dict_type like concat('%',#{dictType},'%')
            </if>
            <if test="params.beginTime!=null and params.beginTime!=''">
                and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
            </if>
            <if test="params.endTime!=null and params.endTime!=''">
                and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
            </if>
        </where>
    </select>
 
    <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        where dict_type = #{dictType}
    </select>
 
    <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        where dict_type = #{dictType} limit 1
    </select>
</mapper>