DgLendMapper.xml
6.84 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
<?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.pashanhoo.lend.mapper.DgLendMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.pashanhoo.lend.entity.vo.DgLendDetailVO">
<id column="BSM_LEND" property="bsm_lend" />
<result column="JYSX" property="jyr" />
<result column="JYDH" property="jydw" />
<result column="AJH" property="ajh" />
<result column="JYFS" property="jyfs" />
<result column="JYDW" property="jydw" />
<result column="JYR" property="jyr" />
<result column="QSSJ" property="qssj" />
<result column="JZRQ" property="jzrq" />
<result column="GHR" property="ghr" />
<result column="GHRQ" property="ghrq" />
<result column="JYZT" property="jyzt" />
<result column="DA_NUM" property="da_num" />
</resultMap>
<!-- 档案列表记录查询 -->
<resultMap id="ShowArchivesInfoResultMap" type="com.pashanhoo.archive.entity.vo.DgArchivesListVO">
<id column="BSM_ARCHIVES" property="bsmArchives" />
<result column="AJBT" property="ajbt" />
<result column="ZTC" property="ztc" />
<result column="FLH" property="flh" />
<result column="MLH" property="mlh" />
<result column="AJH" property="ajh" />
<result column="ND" property="nd" />
<result column="JS" property="js" />
<result column="YS" property="ys" />
<result column="BGQX" property="bgqx" />
<result column="QSRQ" property="qsrq" />
<result column="ZZRQ" property="zzrq" />
<result column="MJ" property="mj" />
<result column="HH" property="hh" />
<result column="CFWZ" property="cfwz" />
<result column="CJR" property="cjr" />
<result column="CJRQ" property="cjrq" />
<result column="HCR" property="hcr" />
<result column="BZ" property="bz" />
<result column="SMZT" property="smzt" />
<result column="DAZT" property="dazt" />
<result column="CDJGBM" property="cdjgbm" />
<result column="DALY" property="daly" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="ArchiveLendInfoResultMap" type="com.pashanhoo.lend.entity.vo.ArchiveLendInfoRequestVO">
<id column="BSM_ARCHIVES" property="bsm_archives" />
<result column="DAZT" property="dazt" />
<result column="AJH" property="ajh" />
<result column="BDCDYH" property="bdcdyh" />
<result column="QLLX" property="qllx" />
<result column="DJLX" property="djlx" />
<result column="QLR" property="qlr" />
<result column="YWR" property="ywr" />
<result column="ZJHM" property="zjhm" />
<result column="BDCDY_NUM" property="bdcdy_num" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
BSM_LEND, JYR, JYDW, LXDW, TXDZ, JYRQ, GHRQ, PZR, JZRQ, JCLY, LYMD, BZ, PZSJ
</sql>
<update id="updateArchivesStatus">
update dg_archives b
set b.dazt = #{dazt,jdbcType=VARCHAR}
where exists (select 1
from DG_LEND_CATALOG a
where a.BSM_LENDCATALOG = #{lendBsm,jdbcType=VARCHAR}
and b.bsm_archives = a.bsm_archives)
</update>
<update id="updateArchivesStatusBatch">
update dg_archives b
set b.dazt = #{dazt,jdbcType=VARCHAR} where bsm_archives in
<foreach collection="idList" index="index" item="item"
separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</update>
<select id="getDanganJyDetail" resultMap="BaseResultMap">
select d.BSM_LEND,
d.jysx,
d.jydh,
d.ajh,
d.jyfs,
d.jydw,
d.jyr,
d.qssj,
d.jzrq,
d.ghr,
d.ghsj,
d.jyzt,count(1) over(partition by d.BSM_LEND order by d.jysx asc, d.jzrq asc, d.jyzt asc) da_num
from (select a.jy_bsm,
case
when a.jzrq < sysdate and a.JYZT = '8' then
'0'
else
'1'
end as jysx,
a.jydh,
b.ajh,
a.jyfs,
a.jydw,
a.jyr,
a.qssj,
a.jzrq,
a.ghr,
a.ghrq,
a.jyzt
from dg_lend a, dg_archives b,dg_lend_catalog c,dg_bdcdy e,dg_business f
where b.BSM_ARCHIVES=c.BSM_ARCHIVES
and a.BSM_LEND=c.BSM_LEND
and e.BSM_ARCHIVES=b.BSM_ARCHIVES
and f.BSM_ARCHIVES=b.BSM_ARCHIVES
<if test="ajh != null and ajh!='' ">
and b.ajh=#{ajh,jdbcType=VARCHAR}
</if>
<if test="bdcdyh != null and bdcdyh!='' ">
and e.bdcdyh=#{bdcdyh,jdbcType=VARCHAR}
</if>
<if test="ywh != null and ywh!=''">
and f.ywh=#{ywh,jdbcType=VARCHAR}
</if>
<if test="bdcqzh != null and bdcqzh !='' ">
and e.zjhm=#{bdcqzh,jdbcType=VARCHAR}
</if>
<if test="jyr != null and jyr!='' ">
and a.jyr=#{jyr,jdbcType=VARCHAR}
</if>
<if test="jyzt != null and jyzt != '' ">
and a.jyzt=#{jyzt,jdbcType=VARCHAR}
</if>
) d
</select>
<select id="queryArchivesInfo" resultMap="ShowArchivesInfoResultMap">
select * from dg_archives b
where exists (select 1
from DG_LEND_CATALOG a
where a.BSM_LENDCATALOG = #{bsm_lend,jdbcType=VARCHAR}
and b.bsm_archives = a.bsm_archives)
</select>
<select id="getArchiveLendInfo" resultType="com.pashanhoo.lend.entity.vo.ArchiveLendInfoRequestVO">
select a.bsm_archives,a.dazt,a.ajh,c.bdcdyh,b.qllx,b.djlx,c.qlr,c.ywr,c.zjhm,count(1) over (partition by a.bsm_archives) bdcdy_num
from dg_archives a, dg_business b, dg_bdcdy c
where a.bsm_archives = b.bsm_archives
and a.bsm_archives=c.bsm_archives
and a.dazt='4'
<if test="ajh != null and ajh != '' ">
and a.ajh=#{ajh,jdbcType=VARCHAR}
</if>
<if test="ywh != null and ywh != '' ">
and b.ywh=#{ywh,jdbcType=VARCHAR}
</if>
<if test="bdcdyh != null and bdcdyh != '' ">
and c.bdcdyh=#{bdcdyh,jdbcType=VARCHAR}
</if>
<if test="zjhm != null and zjhm != '' ">
and c.zjhm=#{zjhm,jdbcType=VARCHAR}
</if>
<if test="qlr != null and qlr != '' ">
and c.qlr=#{qlr,jdbcType=VARCHAR}
</if>
<if test="ywr != null and ywr != '' ">
and c.ywr=#{ywr,jdbcType=VARCHAR}
</if>
<if test="cfwh != null and cfwh != '' ">
and c.zjhm=#{cfwh,jdbcType=VARCHAR}
</if>
<if test="qllx != null and qllx != '' ">
and c.qllx=#{qllx,jdbcType=VARCHAR}
</if>
</select>
</mapper>