提交 | 用户 | 时间
|
fd2207
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
懒 |
2 |
<!DOCTYPE mapper |
|
3 |
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
4 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
5 |
<mapper namespace="com.jcdm.system.mapper.SysDictTypeMapper"> |
|
6 |
|
|
7 |
<resultMap type="SysDictType" id="SysDictTypeResult"> |
|
8 |
<id property="dictId" column="dict_id" /> |
|
9 |
<result property="dictName" column="dict_name" /> |
|
10 |
<result property="dictType" column="dict_type" /> |
|
11 |
<result property="status" column="status" /> |
|
12 |
<result property="createBy" column="create_by" /> |
|
13 |
<result property="createTime" column="create_time" /> |
|
14 |
<result property="updateBy" column="update_by" /> |
|
15 |
<result property="updateTime" column="update_time" /> |
|
16 |
</resultMap> |
|
17 |
|
|
18 |
<sql id="selectDictTypeVo"> |
|
19 |
select dict_id, dict_name, dict_type, status, create_by, create_time, remark |
|
20 |
from sys_dict_type |
|
21 |
</sql> |
|
22 |
|
|
23 |
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> |
|
24 |
<include refid="selectDictTypeVo"/> |
|
25 |
<where> |
|
26 |
<if test="dictName != null and dictName != ''"> |
|
27 |
AND dict_name like concat('%', #{dictName}, '%') |
|
28 |
</if> |
|
29 |
<if test="status != null and status != ''"> |
|
30 |
AND status = #{status} |
|
31 |
</if> |
|
32 |
<if test="dictType != null and dictType != ''"> |
|
33 |
AND dict_type like concat('%', #{dictType}, '%') |
|
34 |
</if> |
|
35 |
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
|
36 |
<!-- and <![CDATA[ create_time >= convert(datetime, #{params.beginTime}, 20)]]>--> |
|
37 |
and datediff(d, create_time, #{params.beginTime}) <![CDATA[<=]]> 0 |
|
38 |
</if> |
|
39 |
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
|
40 |
<!-- and <![CDATA[ create_time <= convert(datetime, #{params.endTime}, 20)]]>--> |
|
41 |
and datediff(d, create_time, #{params.endTime}) <![CDATA[>=]]> 0 |
|
42 |
</if> |
|
43 |
</where> |
|
44 |
</select> |
|
45 |
|
|
46 |
<select id="selectDictTypeAll" resultMap="SysDictTypeResult"> |
|
47 |
<include refid="selectDictTypeVo"/> |
|
48 |
</select> |
|
49 |
|
|
50 |
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> |
|
51 |
<include refid="selectDictTypeVo"/> |
|
52 |
where dict_id = #{dictId} |
|
53 |
</select> |
|
54 |
|
|
55 |
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> |
|
56 |
<include refid="selectDictTypeVo"/> |
|
57 |
where dict_type = #{dictType} |
|
58 |
</select> |
|
59 |
|
|
60 |
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> |
|
61 |
select top(1) dict_id, dict_name, dict_type, status, create_by, create_time, remark |
|
62 |
from sys_dict_type |
|
63 |
where dict_type = #{dictType} |
|
64 |
</select> |
|
65 |
|
|
66 |
<delete id="deleteDictTypeById" parameterType="Long"> |
|
67 |
delete from sys_dict_type where dict_id = #{dictId} |
|
68 |
</delete> |
|
69 |
|
|
70 |
<delete id="deleteDictTypeByIds" parameterType="Long"> |
|
71 |
delete from sys_dict_type where dict_id in |
|
72 |
<foreach collection="array" item="dictId" open="(" separator="," close=")"> |
|
73 |
#{dictId} |
|
74 |
</foreach> |
|
75 |
</delete> |
|
76 |
|
|
77 |
<update id="updateDictType" parameterType="SysDictType"> |
|
78 |
update sys_dict_type |
|
79 |
<set> |
|
80 |
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> |
|
81 |
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> |
|
82 |
<if test="status != null">status = #{status},</if> |
|
83 |
<if test="remark != null">remark = #{remark},</if> |
|
84 |
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
|
85 |
update_time = getdate() |
|
86 |
</set> |
|
87 |
where dict_id = #{dictId} |
|
88 |
</update> |
|
89 |
|
|
90 |
<insert id="insertDictType" parameterType="SysDictType"> |
|
91 |
insert into sys_dict_type( |
|
92 |
<if test="dictName != null and dictName != ''">dict_name,</if> |
|
93 |
<if test="dictType != null and dictType != ''">dict_type,</if> |
|
94 |
<if test="status != null">status,</if> |
|
95 |
<if test="remark != null and remark != ''">remark,</if> |
|
96 |
<if test="createBy != null and createBy != ''">create_by,</if> |
|
97 |
create_time |
|
98 |
)values( |
|
99 |
<if test="dictName != null and dictName != ''">#{dictName},</if> |
|
100 |
<if test="dictType != null and dictType != ''">#{dictType},</if> |
|
101 |
<if test="status != null">#{status},</if> |
|
102 |
<if test="remark != null and remark != ''">#{remark},</if> |
|
103 |
<if test="createBy != null and createBy != ''">#{createBy},</if> |
|
104 |
getdate() |
|
105 |
) |
|
106 |
</insert> |
|
107 |
|
|
108 |
</mapper> |