7989abffcac7293448bd52e505aaa601571b383e.svn-base
14 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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
<?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.RegBusQlrDao">
<sql id="regBusQlrColumns">
a.id AS "id",
a.ysdm AS "ysdm",
a.ywh AS "ywh",
a.bdcdyh AS "bdcdyh",
a.sxh AS "sxh",
a.qlrmc AS "qlrmc",
a.pcode AS "pcode",
a.bdcqzh AS "bdcqzh",
a.qzysxlh AS "qzysxlh",
a.sfczr AS "sfczr",
a.zjzl AS "zjzl",
a.zjh AS "zjh",
a.fzjg AS "fzjg",
a.sshy AS "sshy",
a.gj AS "gj",
a.hjszss AS "hjszss",
a.xb AS "xb",
a.dh AS "dh",
a.dz AS "dz",
a.yb AS "yb",
a.gzdw AS "gzdw",
a.dzyj AS "dzyj",
a.qlrlx AS "qlrlx",
a.qlbl AS "qlbl",
a.gyfs AS "gyfs",
a.gyqk AS "gyqk",
a.bz AS "bz",
a.fddbrfzr AS "fddbrfzr",
a.fddbrfzrdh AS "fddbrfzrdh",
a.dlrmc AS "dlrmc",
a.dlrdh AS "dlrdh",
a.dljgmc AS "dljgmc",
a.qszt AS "qszt",
a.qllx AS "qllx",
a.gmrid AS "gmrid",
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.pic AS "pic",
a.tpbm AS "tpbm",
a.piczt AS "piczt",
a.sczt AS "sczt",
a.veritysczt AS "veritysczt"
</sql>
<sql id="regBusQlrJoins">
</sql>
<select id="findMaxYwhLs" resultType="string">
select max(substr(t.ywh,4)) from REG_BUS_QLR t where YWH like 'LST%'
</select>
<select id="findMaxYwhNf" resultType="string">
select max(substr(t.ywh,3)) from REG_BUS_QLR t where YWH like 'LZ%'
</select>
<select id="get" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
WHERE a.id = #{id}
</select>
<select id="getQlrByDy" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
WHERE a.bz = #{bdcdyh}
</select>
<select id="findList" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<if test="ywh != null and ywh != ''">
JOIN reg_bus_qlrywhrelation re ON re.qlrid = a.id AND re.ywh = #{ywh}
</if>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh = #{bdcdyh}
</if>
<if test="sxh != null and sxh != ''">
AND a.sxh = #{sxh}
</if>
<if test="sfczr != null and sfczr != ''">
AND a.sfczr = #{sfczr}
</if>
<if test="qlrmc != null and qlrmc != ''">
AND a.qlrmc LIKE
<if test="dbName == 'oracle'">'%'||#{qlrmc}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{qlrmc}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{qlrmc},'%')</if>
</if>
<if test="zjzl != null and zjzl != ''">
AND a.zjzl = #{zjzl}
</if>
<if test="zjh != null and zjh != ''">
AND a.zjh = #{zjh}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.sxh asc
</otherwise>
</choose>
</select>
<select id="findListNF" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh = #{bdcdyh}
</if>
<if test="sxh != null and sxh != ''">
AND a.sxh = #{sxh}
</if>
<if test="sfczr != null and sfczr != ''">
AND a.sfczr = #{sfczr}
</if>
<if test="qlrmc != null and qlrmc != ''">
AND a.qlrmc LIKE
<if test="dbName == 'oracle'">'%'||#{qlrmc}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{qlrmc}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{qlrmc},'%')</if>
</if>
<if test="zjzl != null and zjzl != ''">
AND a.zjzl = #{zjzl}
</if>
<if test="zjh != null and zjh != ''">
AND a.zjh = #{zjh}
</if>
<if test="ywh != null and ywh != ''">
AND a.ywh LIKE
<if test="dbName == 'oracle'">'%'||#{ywh}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{ywh}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{ywh},'%')</if>
</if>
<if test="bz != null and bz !=''">
AND (a.bdcdyh is null or a.bdcdyh ='')
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.sxh asc
</otherwise>
</choose>
</select>
<select id="findqlrgmList" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
AND (a.pcode = #{pcode} or a.qlrmc = #{qlrmc} or (a.zjzl = #{zjzl} and a.zjh = #{zjh}))
<if test="ywh != null and ywh != ''">
AND a.ywh = #{ywh}
</if>
</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="findList_1" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh = #{bdcdyh}
</if>
<if test="ywh != null and ywh != ''">
AND trim(a.ywh) = #{ywh}
</if>
<if test="sxh != null and sxh != ''">
AND a.sxh = #{sxh}
</if>
<if test="zjh != null and zjh != ''">
AND a.zjh = #{zjh}
</if>
<if test="sfczr != null and sfczr != ''">
AND a.sfczr = #{sfczr}
</if>
<if test="qszt != null and qszt != ''">
AND a.qszt = #{qszt}
</if>
<if test="pcode != null and pcode != ''">
AND a.pcode = #{pcode}
</if>
<if test="gmrid != null and gmrid != ''">
AND a.gmrid = #{gmrid}
</if>
<if test="qlrmc != null and qlrmc != ''">
AND a.qlrmc LIKE
<if test="dbName == 'oracle'">'%'||#{qlrmc}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{qlrmc}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{qlrmc},'%')</if>
</if>
<if test="zjzl != null and zjzl != ''">
AND a.zjzl = #{zjzl}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.sxh asc
</otherwise>
</choose>
</select>
<select id="findListdyh" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
AND a.bdcdyh is null
<if test="ywh != null and ywh != ''">
AND a.ywh = #{ywh}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.sxh asc
</otherwise>
</choose>
</select>
<select id="findByYwh" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = 0
AND a.ywh = #{ywh}
</where>
order by a.sxh asc
</select>
<select id="findByPic" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = 0
AND a.ywh = #{0}
AND a.sxh = #{1}
</where>
order by a.sxh asc
</select>
<select id="findListSxh" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = 0
<if test="bdcdyh != null and bdcdyh != ''">
AND a.bdcdyh = #{bdcdyh}
</if>
<if test="sxh != null and sxh != ''">
AND a.sxh = #{sxh}
</if>
<if test="sfczr != null and sfczr != ''">
AND a.sfczr = #{sfczr}
</if>
<if test="qlrmc != null and qlrmc != ''">
AND a.qlrmc LIKE
<if test="dbName == 'oracle'">'%'||#{qlrmc}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{qlrmc}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{qlrmc},'%')</if>
</if>
<if test="ywh != null and ywh != ''">
AND trim(a.ywh) = #{ywh}
</if>
<if test="pcode != null and pcode != ''">
AND a.pcode = #{pcode}
</if>
<if test="qszt != null and qszt != ''">
AND a.qszt = #{qszt}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.sxh ASC
</otherwise>
</choose>
</select>
<select id="findAllList" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<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>
<insert id="insertRelationYwh" parameterType="Map">
INSERT INTO reg_bus_qlrywhrelation(ywh, qlrid, isuse)
VALUES (#{ywh}, #{qlrid}, 1)
</insert>
<update id="updateRelationYwhIsuse" parameterType="Map">
UPDATE reg_bus_qlrywhrelation SET
isuse = 0
WHERE ywh = #{ywh} AND qlrid = #{qlrid}
</update>
<insert id="insert">
INSERT INTO reg_bus_qlr(
id,
ysdm,
ywh,
bdcdyh,
sxh,
qlrmc,
pcode,
bdcqzh,
qzysxlh,
sfczr,
zjzl,
zjh,
fzjg,
sshy,
gj,
hjszss,
xb,
dh,
dz,
yb,
gzdw,
dzyj,
qlrlx,
qlbl,
gyfs,
gyqk,
bz,
fddbrfzr,
fddbrfzrdh,
dlrmc,
dlrdh,
dljgmc,
qszt,
qllx,
gmrid,
sczt,
veritysczt,
create_by,
create_date,
update_by,
update_date,
del_flag
) VALUES (
#{id},
#{ysdm},
#{ywh},
#{bdcdyh},
#{sxh},
#{qlrmc},
#{pcode},
#{bdcqzh},
#{qzysxlh},
#{sfczr},
#{zjzl},
#{zjh},
#{fzjg},
#{sshy},
#{gj},
#{hjszss},
#{xb},
#{dh},
#{dz},
#{yb},
#{gzdw},
#{dzyj},
#{qlrlx},
#{qlbl},
#{gyfs},
#{gyqk},
#{bz},
#{fddbrfzr},
#{fddbrfzrdh},
#{dlrmc},
#{dlrdh},
#{dljgmc},
#{qszt},
#{qllx},
#{gmrid},
#{sczt},
#{veritysczt},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{delFlag}
)
</insert>
<update id="update">
UPDATE reg_bus_qlr SET
ysdm = #{ysdm},
ywh = #{ywh},
bdcdyh = #{bdcdyh},
sxh = #{sxh},
qlrmc = #{qlrmc},
pcode = #{pcode},
bdcqzh = #{bdcqzh},
qzysxlh = #{qzysxlh},
sfczr = #{sfczr},
zjzl = #{zjzl},
zjh = #{zjh},
fzjg = #{fzjg},
sshy = #{sshy},
gj = #{gj},
hjszss = #{hjszss},
xb = #{xb},
dh = #{dh},
dz = #{dz},
yb = #{yb},
gzdw = #{gzdw},
dzyj = #{dzyj},
qlrlx = #{qlrlx},
qlbl = #{qlbl},
gyfs = #{gyfs},
gyqk = #{gyqk},
bz = #{bz},
fddbrfzr = #{fddbrfzr},
fddbrfzrdh = #{fddbrfzrdh},
dlrmc = #{dlrmc},
dlrdh = #{dlrdh},
dljgmc = #{dljgmc},
qszt = #{qszt},
qllx = #{qllx},
gmrid = #{gmrid},
sczt = #{sczt},
veritysczt = #{veritysczt},
update_by = #{updateBy.id},
update_date = #{updateDate},
del_flag = #{delFlag},
pic = #{pic},
tpbm = #{tpbm},
piczt = #{piczt}
WHERE id = #{id}
</update>
<update id="delete">
DELETE from reg_bus_qlr
WHERE id = #{id}
</update>
<update id="deleteywh">
DELETE from reg_bus_qlr
WHERE ywh = #{ywh}
</update>
<!-- 房屋所有权,预告更名调用 -->
<update id="deleteqlr">
DELETE FROM reg_bus_qlr
<where>
<if test= "ywh != null and ywh != ''">
AND trim(ywh) = #{ywh}
</if>
<if test= "pcode != null and pcode != ''">
AND pcode = #{pcode}
</if>
<if test="bdcdyh != null and bdcdyh != ''">
AND bdcdyh = #{bdcdyh}
</if>
<if test= "sxh != null and sxh != ''">
AND sxh = #{sxh}
</if>
</where>
</update>
<select id="findryywh" resultType="String">
SELECT a.ywh FROM reg_bus_qlr a
<include refid="regBusQlrJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
<if test="ywh != null and ywh != ''">
AND trim(a.ywh) = #{ywh}
</if>
<if test="zjh != null and zjh != ''">
AND a.zjh = #{zjh}
</if>
<if test="qszt != null and qszt != ''">
AND a.qszt = #{qszt}
</if>
<if test="qlrmc != null and qlrmc != ''">
AND a.qlrmc = #{qlrmc}
</if>
<if test="zjzl != null and zjzl != ''">
AND a.zjzl = #{zjzl}
</if>
group by a.ywh
</where>
</select>
<select id="progress" resultType="Map">
select s.taskdefkey from reg_bus_qlr q LEFT JOIN reg_bus_slsq s on q.ywh = s.ywh where q.QLRMC=#{2} and (q.zjh != #{1} and q.zjh != concat(SUBSTR(#{1},0,6),substr(#{1},9,9))) and q.ywh = #{0}
</select>
<select id="querywxQlr" resultType="Map">
select wm_concat(qlrmc) qlrmc from reg_bus_qlr where ywh=#{0} and del_flag='0' order by qlbl desc
</select>
<select id="querywxGyr" resultType="Map">
select wm_concat(qlrmc) gyrmc from reg_bus_qlr where ywh=#{0} and del_flag='0' and (zjh != #{1} and zjh != concat(SUBSTR(#{1},0,6),substr(#{1},9,9)))
</select>
<select id="getSxh" resultType="Integer">
select sxh from reg_bus_qlr where ywh=#{0} and del_flag='0' and qlrmc = #{1} and (zjh = #{2} or zjh = concat(SUBSTR(#{2},0,6),substr(#{2},9,9)))
</select>
<select id="getXgry" resultType="Map">
SELECT qlrmc name,zjh zjhm FROM REG_BUS_QLR WHERE YWH=#{0}
</select>
<select id="DjxxSelect" resultType="Map">
SELECT bdcqzh,zl,mj,bdcdyh FROM REG_BUS_BDCQZSDJXX WHERE YWH in (select ywh from reg_bus_qlr where qlrmc=#{qlrmc} and zjzl = #{zjzl} and zjh = #{zjh} and del_flag='0') and islogout = '0' and fzsj is not null and del_flag='0'
</select>
<select id="findDyr" resultType="RegBusQlr">
SELECT
<include refid="regBusQlrColumns"/>
from reg_bus_qlr a where a.ywh = (
select ywh from reg_bus_bdcqzsdjxx where bdcdyh = (
select bdcdyh from reg_bus_bdcqzsdjxx where bdcqzh = #{0} and islogout='0' and del_flag='0')and islogout='0' and del_flag='0' and rights= #{1})
and a.del_flag='0'
</select>
</mapper>