5f7c1de35057d88728df036cbf101a1637f922e7.svn-base
6.62 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<?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.base.RegBaseSllmDao">
<sql id="regBaseSllmColumns">
a.id AS "id",
a.ysdm AS "ysdm",
a.lmbm AS "lmbm",
a.bdcdyh AS "bdcdyh",
a.zddm AS "zddm",
a.syqmj AS "syqmj",
a.ldsyqxz AS "ldsyqxz",
a.zysz AS "zysz",
a.zs AS "zs",
a.lz AS "lz",
a.qy AS "qy",
a.zlnd AS "zlnd",
a.lb AS "lb",
a.xb AS "xb",
a.xdm AS "xdm",
a.status AS "status",
a.zdid AS "zdid",
a.isdiya AS "isdiya",
a.ischafeng AS "ischafeng",
a.isyiyi AS "isyiyi",
a.isaudit AS "isaudit",
a.islogout AS "islogout",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
a.zl AS "zl",
a.qlxz AS "qlxz",
a.yt AS "yt",
a.qllx AS "qllx"
</sql>
<sql id="regBaseSllmJoins">
</sql>
<select id="get" resultType="RegBaseSllm">
SELECT
<include refid="regBaseSllmColumns"/>
FROM reg_base_sllm a
<include refid="regBaseSllmJoins"/>
WHERE a.id = #{id}
</select>
<select id="getLmbmStr" resultType="string">
select MAX(lmbm) from reg_base_sllm where del_flag = '0'
</select>
<select id="findList" resultType="RegBaseSllm">
SELECT
<include refid="regBaseSllmColumns"/>
FROM reg_base_sllm a
<include refid="regBaseSllmJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh LIKE
<if test="dbName == 'oracle'">'%'||#{bdcdyh}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{bdcdyh}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{bdcdyh},'%')</if>
</if>
<if test="zddm != null and zddm !=''">
AND a.zddm = #{zddm}
</if>
<if test="zl != null and zl !=''">
AND a.zl = #{zl}
</if>
<if test="isaudit != null and isaudit !=''">
AND a.isaudit = #{isaudit}
</if>
<if test="isdiya != null and isdiya !=''">
AND a.isdiya = #{isdiya}
</if>
<if test="ischafeng != null and ischafeng !=''">
AND a.ischafeng = #{ischafeng}
</if>
<if test="isyiyi != null and isyiyi !=''">
AND a.isyiyi = #{isyiyi}
</if>
<if test="islogout != null and islogout != ''">
<if test="islogout == 13">
AND (a.islogout = '0' or a.islogout = '3' or a.islogout >= 100)
</if>
<if test="islogout != 13">
AND a.islogout = #{islogout}
</if>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.create_date DESC
</otherwise>
</choose>
</select>
<select id="getMaxLmbdcdyhOfOracle" resultType="string">
select MAX(substr(bdcdyh, -8)) from reg_base_sllm a
<where>
a.bdcdyh Like #{bdcdyh}||'%'
</where>
</select>
<select id="findAllList" resultType="RegBaseSllm">
SELECT
<include refid="regBaseSllmColumns"/>
FROM reg_base_sllm a
<include refid="regBaseSllmJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<select id="getBdcdyh" resultType="RegBaseSllm">
SELECT
<include refid="regBaseSllmColumns"/>
FROM reg_base_sllm a
<include refid="regBaseSllmJoins"/>
WHERE a.del_flag = '0'
AND a.bdcdyh = #{bdcdyh}
AND a.islogout = '0'
</select>
<update id="delete">
DELETE FROM reg_base_sllm
WHERE id = #{id}
</update>
<insert id="insert">
INSERT INTO reg_base_sllm(
id,
ysdm,
lmbm,
bdcdyh,
zddm,
syqmj,
ldsyqxz,
zysz,
zs,
lz,
qy,
zlnd,
lb,
xb,
xdm,
status,
zdid,
isdiya,
ischafeng,
isyiyi,
isaudit,
islogout,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag,
zl,
yt,
qllx,
qlxz
) VALUES (
#{id},
#{ysdm},
#{lmbm},
#{bdcdyh},
#{zddm},
#{syqmj},
#{ldsyqxz},
#{zysz},
#{zs},
#{lz},
#{qy},
#{zlnd},
#{lb},
#{xb},
#{xdm},
#{status},
#{zdid},
#{isdiya},
#{ischafeng},
#{isyiyi},
#{isaudit},
#{islogout},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag},
#{zl},
#{yt},
#{qllx},
#{qlxz}
)
</insert>
<update id="update">
UPDATE reg_base_sllm SET
id = #{id},
ysdm = #{ysdm},
lmbm = #{lmbm},
bdcdyh = #{bdcdyh},
zddm = #{zddm},
syqmj = #{syqmj},
ldsyqxz = #{ldsyqxz},
zysz = #{zysz},
zs = #{zs},
lz = #{lz},
qy = #{qy},
zlnd = #{zlnd},
lb = #{lb},
xb = #{xb},
xdm = #{xdm},
status = #{status},
zdid = #{zdid},
isdiya = #{isdiya},
ischafeng = #{ischafeng},
isyiyi = #{isyiyi},
isaudit = #{isaudit},
islogout = #{islogout},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks},
zl = #{zl},
qlxz = #{qlxz},
yt = #{yt},
qllx =#{qllx},
del_flag = #{delFlag}
WHERE id = #{id}
</update>
<select id="findListqj" resultType="RegBaseSllm">
SELECT
<include refid="regBaseSllmColumns"/>
FROM reg_base_sllm a
<include refid="regBaseSllmJoins"/>
<where>
a.del_flag != '1'
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh LIKE
<if test="dbName == 'oracle'">'%'||#{bdcdyh}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{bdcdyh}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{bdcdyh},'%')</if>
</if>
<if test="zddm != null and zddm !=''">
AND a.zddm = #{zddm}
</if>
<if test="zl != null and zl !=''">
AND a.zl = #{zl}
</if>
<if test="isaudit != null and isaudit !=''">
AND a.isaudit = #{isaudit}
</if>
<if test="isdiya != null and isdiya !=''">
AND a.isdiya = #{isdiya}
</if>
<if test="ischafeng != null and ischafeng !=''">
AND a.ischafeng = #{ischafeng}
</if>
<if test="isyiyi != null and isyiyi !=''">
AND a.isyiyi = #{isyiyi}
</if>
<if test="islogout != null and islogout != ''">
<if test="islogout == 13">
AND (a.islogout = '0' or a.islogout = '3' or a.islogout >= 100)
</if>
<if test="islogout != 13">
AND a.islogout = #{islogout}
</if>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.create_date DESC
</otherwise>
</choose>
</select>
<update id="deleteqj">
UPDATE reg_base_sllm SET
del_flag = '2'
WHERE id = #{id}
</update>
</mapper>