DgArchivesMapper.xml
5.47 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
<?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.archive.mapper.DgArchivesMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.pashanhoo.archive.entity.DgArchivesDO">
<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>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
BSM_ARCHIVES, AJBT, ZTC, FLH, MLH, AJH, ND, JS, YS, BGQX, QSRQ, ZZRQ, MJ, HH, CFWZ, CJR, CJRQ, HCR, BZ, SMZT, DAZT, CDJGBM, DALY
</sql>
<update id="updateArchivesInfoByReceiveIdList">
update DG_ARCHIVES a set a.dazt=#{dazt,jdbcType=VARCHAR} where exists (
select 1 from dg_receive_relation b where a.BSM_ARCHIVES=b.BSM_ARCHIVES
and b.bms_receive in
<foreach collection="idList" index="index" item="item"
separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
)
</update>
<select id="searchArchive" resultType="com.pashanhoo.archive.entity.vo.SearchArchiveVO">
select rownum as xh,
DA.BSM_ARCHIVES,
DA.DAZT,
DA.DALY,
DA.AJH,
DA.CFWZ,
DA.HH,
D.BDCQZH,
D.QLR,
D.YWR,
DB.YWH,
D.BDCDYH,
DB.QLLX
from DG_ARCHIVES DA
join DG_BUSINESS DB on DA.BSM_ARCHIVES = DB.BSM_ARCHIVES
join DG_BDCDY D on DA.BSM_ARCHIVES = D.BSM_ARCHIVES
<where>
<if test="request.ajh != null and request.ajh != ''">
AJH = #{request.ajh,jdbcType=VARCHAR}
</if>
<if test="request.mlh != null and request.mlh != ''">
and MLH = #{request.mlh,jdbcType=VARCHAR}
</if>
<if test="request.hh != null and request.hh != ''">
and HH = #{request.hh,jdbcType=VARCHAR}
</if>
<if test="request.dazt != null and request.dazt != ''">
and DAZT = #{request.dazt,jdbcType=VARCHAR}
</if>
<if test="request.ywh != null and request.ywh != ''">
and YWH = #{request.ywh,jdbcType=VARCHAR}
</if>
<if test="request.bdcqzh != null and request.bdcqzh != ''">
and BDCQZH = #{request.bdcqzh,jdbcType=VARCHAR}
</if>
<if test="request.bdcdyh != null and request.bdcdyh != ''">
and BDCDYH = #{request.bdcdyh,jdbcType=VARCHAR}
</if>
<if test="request.qllx != null and request.qllx != ''">
and QLLX = #{request.qllx,jdbcType=VARCHAR}
</if>
</where>
</select>
<resultMap id="CatalogWithFile" type="com.pashanhoo.catalog.entity.vo.DgArchivesCatalogWithFileVO">
<result column="bsm_catalog" property="bsmCatalog"/>
<result column="bsm_archives" property="bsmArchives"/>
<result column="xh" property="xh"/>
<result column="wjbm" property="wjbm"/>
<result column="wjmc" property="wjmc"/>
<result column="cllxbm" property="cllxbm"/>
<result column="cllxmc" property="cllxmc"/>
<result column="ys" property="ys"/>
<result column="yh" property="yh"/>
<result column="fs" property="fs"/>
<result column="wh" property="wh"/>
<result column="bz" property="bz"/>
<collection property="dgFileDOS" ofType="com.pashanhoo.file.entity.DgFileDO">
<result column="BSM_FILE" property="bsmFile"/>
<result column="DF_BSM_CATALOG" property="bsmCatalog"/>
<result column="KZM" property="kzm"/>
<result column="SCRQ" property="scrq"/>
<result column="SCR" property="scr"/>
<result column="FJURL" property="fjurl"/>
<result column="FJSIZE" property="fjsize"/>
</collection>
</resultMap>
<select id="selectCatalogWithFile" resultMap="CatalogWithFile">
select DAC.*, DF.BSM_FILE as BSM_FILE, DF.BSM_CATALOG as DF_BSM_CATALOG, DF.KZM as KZM,DF.SCRQ as SCRQ,DF.SCR as SCR,DF.FJURL as FJURL,DF.FJSIZE as FJSIZE
from DG_FILE DF
left join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG =
DF.BSM_CATALOG
<where>
<if test="request.bsmArchives != null and request.bsmArchives != ''">
BSM_ARCHIVES = #{request.bsmArchives,jdbcType=VARCHAR}
</if>
</where>
order by XH
</select>
</mapper>