Kc01Dao.xml
4.44 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?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.thinkgem.jeesite.modules.reg.dao.bus.Kc01Dao">
<sql id="kc01Columns">
a.id AS "id",
a.akc002 AS "akc002",
a.akc003 AS "akc003",
a.akc004 AS "akc004",
a.akc005 AS "akc005",
a.akc006 AS "akc006",
a.akc007 AS "akc007",
a.akc008 AS "akc008",
a.akc009 AS "akc009",
a.akc010 AS "akc010",
a.akc011 AS "akc011",
a.akc013 AS "akc013",
a.akc012 AS "akc012",
a.akc014 AS "akc014",
a.akc015 AS "akc015",
a.akc016 AS "akc016",
a.akc017 AS "akc017",
a.akc018 AS "akc018"
</sql>
<sql id="kc01Joins">
</sql>
<select id="get" resultType="Kc01">
SELECT
<include refid="kc01Columns"/>
FROM kc01 a
<include refid="kc01Joins"/>
WHERE a.id = #{id}
</select>
<select id="findList" resultType="Kc01">
SELECT
<include refid="kc01Columns"/>
FROM kc01 a
<include refid="kc01Joins"/>
<where>
<if test="akc002 != null and akc002 != ''">
AND a.akc002 LIKE
<if test="dbName == 'oracle'">'%'||#{akc002}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{akc002}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{akc002},'%')</if>
</if>
<if test="akc003 != null and akc003 != ''">
AND a.akc003 = #{akc003}
</if>
<if test="akc004 != null and akc004 != ''">
AND a.akc004 LIKE
<if test="dbName == 'oracle'">'%'||#{akc004}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{akc004}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{akc004},'%')</if>
</if>
<if test="akc005 != null and akc005 != ''">
AND a.akc004 LIKE
<if test="dbName == 'oracle'">'%'||#{akc005}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{akc005}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{akc005},'%')</if>
</if>
<if test="akc006 != null and akc006 != ''">
AND a.akc006 = #{akc006}
</if>
<if test="akc008 != null and akc008 != ''">
<if test="akc008 == '13'">
AND (a.akc008 = '1' or a.akc008 = '3')
</if>
<if test="akc008 != '13'">
AND a.akc008 = #{akc008}
</if>
</if>
<if test="akc007 != null and akc007 != ''">
AND a.akc007 = #{akc007}
</if>
<if test="akc009 != null and akc009 != ''">
AND a.akc009 = #{akc009}
</if>
<if test="akc015 != null and akc015 != ''">
AND a.akc015 = #{akc015}
</if>
<if test="akc016 != null and akc016 != ''">
AND a.akc016 = #{akc016}
</if>
<if test="akc017 != null and akc017 != ''">
AND a.akc017 = #{akc017}
</if>
<if test="akc018 != null and akc018 != ''">
AND a.akc018 = #{akc018}
</if>
<if test="id != null and id != ''">
AND a.id = #{id}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.akc011 desc
</otherwise>
</choose>
</select>
<select id="getyhsxh" resultType="string">
select MAX(akc012) a from kc01 where akc012 is not null and akc014 = #{akc014}
</select>
<select id="findAllList" resultType="Kc01">
SELECT
<include refid="kc01Columns"/>
FROM kc01 a
<include refid="kc01Joins"/>
<where>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
</otherwise>
</choose>
</select>
<insert id="insert">
INSERT INTO kc01(
id,
akc002,
akc003,
akc004,
akc005,
akc006,
akc007,
akc008,
akc009,
akc010,
akc011,
akc013,
akc012,
akc014,
akc015,
akc016,
akc017,
akc018
) VALUES (
#{id},
#{akc002},
#{akc003},
#{akc004},
#{akc005},
#{akc006},
#{akc007},
#{akc008},
#{akc009},
#{akc010},
#{akc011},
#{akc013},
#{akc012},
#{akc014},
#{akc015},
#{akc016},
#{akc017},
#{akc018}
)
</insert>
<update id="update">
UPDATE kc01 SET
akc002 = #{akc002},
akc003 = #{akc003},
akc004 = #{akc004},
akc005 = #{akc005},
akc006 = #{akc006},
akc007 = #{akc007},
akc008 = #{akc008},
akc009 = #{akc009},
akc010 = #{akc010},
akc011 = #{akc011},
akc013 = #{akc013},
akc012 = #{akc012},
akc014 = #{akc014},
akc015 = #{akc015},
akc016 = #{akc016},
akc017 = #{akc017},
akc018 = #{akc018}
WHERE id = #{id}
</update>
<update id="delete">
DELETE FROM kc01
WHERE id = #{id}
</update>
</mapper>