SysDictDataMapper.xml
6.08 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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="cn.com.polysoft.template.dao.system.SysDictDataMapper">
<resultMap id="BaseResultMap" type="cn.com.polysoft.template.entity.system.SysDictData">
<id column="dict_code" jdbcType="VARCHAR" property="dictCode"/>
<result column="dict_sort" jdbcType="INTEGER" property="dictSort"/>
<result column="dict_label" jdbcType="VARCHAR" property="dictLabel"/>
<result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
<result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
<result column="is_default" jdbcType="CHAR" property="isDefault"/>
<result column="status" jdbcType="CHAR" property="status"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="DATE" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="DATE" property="updateTime"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Base_Column_List">
dict_code
, dict_sort, dict_label, dict_value, dict_type, is_default, "status", create_by,
create_time, update_by, update_time, remark
</sql>
<select id="selectSysDictDataByDictCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from "sys_dict_data"
where dict_code = #{dictCode,jdbcType=VARCHAR}
ORDER BY dict_sort
</select>
<select id="selectSysDictDataByDictType" resultType="cn.com.polysoft.template.entity.system.SysDictData">
select
<include refid="Base_Column_List"/>
from "sys_dict_data"
where dict_type = #{dictType,jdbcType=VARCHAR}
ORDER BY dict_sort
</select>
<delete id="deleteSysDictDataByDictCode" parameterType="java.lang.String">
delete
from "sys_dict_data"
where dict_code = #{dictCode,jdbcType=VARCHAR}
</delete>
<insert id="insertSysDictData" keyColumn="dict_code" keyProperty="dictCode"
parameterType="cn.com.polysoft.template.entity.system.SysDictData" useGeneratedKeys="true">
insert into "sys_dict_data"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dictSort != null">
dict_sort,
</if>
<if test="dictLabel != null">
dict_label,
</if>
<if test="dictValue != null">
dict_value,
</if>
<if test="dictType != null">
dict_type,
</if>
<if test="isDefault != null">
is_default,
</if>
<if test="status != null">
"status",
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dictSort != null">
#{dictSort,jdbcType=INTEGER},
</if>
<if test="dictLabel != null">
#{dictLabel,jdbcType=VARCHAR},
</if>
<if test="dictValue != null">
#{dictValue,jdbcType=VARCHAR},
</if>
<if test="dictType != null">
#{dictType,jdbcType=VARCHAR},
</if>
<if test="isDefault != null">
#{isDefault,jdbcType=CHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=DATE},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=DATE},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateSysDictData" parameterType="cn.com.polysoft.template.entity.system.SysDictData">
update "sys_dict_data"
<set>
<if test="dictSort != null">
dict_sort = #{dictSort,jdbcType=INTEGER},
</if>
<if test="dictLabel != null">
dict_label = #{dictLabel,jdbcType=VARCHAR},
</if>
<if test="dictValue != null">
dict_value = #{dictValue,jdbcType=VARCHAR},
</if>
<if test="dictType != null">
dict_type = #{dictType,jdbcType=VARCHAR},
</if>
<if test="isDefault != null">
is_default = #{isDefault,jdbcType=CHAR},
</if>
<if test="status != null">
"status" = #{status,jdbcType=CHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=DATE},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=DATE},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where dict_code = #{dictCode,jdbcType=VARCHAR}
</update>
</mapper>