提交 | 用户 | 时间
|
a6316e
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
A |
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.billion.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 date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
|
37 |
</if> |
|
38 |
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
|
39 |
and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
|
40 |
</if> |
|
41 |
</where> |
|
42 |
</select> |
|
43 |
|
|
44 |
<select id="selectDictTypeAll" resultMap="SysDictTypeResult"> |
|
45 |
<include refid="selectDictTypeVo"/> |
|
46 |
</select> |
|
47 |
|
|
48 |
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> |
|
49 |
<include refid="selectDictTypeVo"/> |
|
50 |
where dict_id = #{dictId} |
|
51 |
</select> |
|
52 |
|
|
53 |
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> |
|
54 |
<include refid="selectDictTypeVo"/> |
|
55 |
where dict_type = #{dictType} |
|
56 |
</select> |
|
57 |
|
|
58 |
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> |
|
59 |
<include refid="selectDictTypeVo"/> |
|
60 |
where dict_type = #{dictType} limit 1 |
|
61 |
</select> |
|
62 |
|
|
63 |
<delete id="deleteDictTypeById" parameterType="Long"> |
|
64 |
delete from sys_dict_type where dict_id = #{dictId} |
|
65 |
</delete> |
|
66 |
|
|
67 |
<delete id="deleteDictTypeByIds" parameterType="Long"> |
|
68 |
delete from sys_dict_type where dict_id in |
|
69 |
<foreach collection="array" item="dictId" open="(" separator="," close=")"> |
|
70 |
#{dictId} |
|
71 |
</foreach> |
|
72 |
</delete> |
|
73 |
|
|
74 |
<update id="updateDictType" parameterType="SysDictType"> |
|
75 |
update sys_dict_type |
|
76 |
<set> |
|
77 |
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> |
|
78 |
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> |
|
79 |
<if test="status != null">status = #{status},</if> |
|
80 |
<if test="remark != null">remark = #{remark},</if> |
|
81 |
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
|
82 |
update_time = sysdate() |
|
83 |
</set> |
|
84 |
where dict_id = #{dictId} |
|
85 |
</update> |
|
86 |
|
|
87 |
<insert id="insertDictType" parameterType="SysDictType"> |
|
88 |
insert into sys_dict_type( |
|
89 |
<if test="dictName != null and dictName != ''">dict_name,</if> |
|
90 |
<if test="dictType != null and dictType != ''">dict_type,</if> |
|
91 |
<if test="status != null">status,</if> |
|
92 |
<if test="remark != null and remark != ''">remark,</if> |
|
93 |
<if test="createBy != null and createBy != ''">create_by,</if> |
|
94 |
create_time |
|
95 |
)values( |
|
96 |
<if test="dictName != null and dictName != ''">#{dictName},</if> |
|
97 |
<if test="dictType != null and dictType != ''">#{dictType},</if> |
|
98 |
<if test="status != null">#{status},</if> |
|
99 |
<if test="remark != null and remark != ''">#{remark},</if> |
|
100 |
<if test="createBy != null and createBy != ''">#{createBy},</if> |
|
101 |
sysdate() |
|
102 |
) |
|
103 |
</insert> |
|
104 |
|
|
105 |
</mapper> |