DgArchivesDestructionMapper.xml
5.3 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
<?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.destroy.mapper.DgArchivesDestructionMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.pashanhoo.destroy.entity.DgArchivesDestructionDO">
<id column="BSM_DESTRUCTION" property="bsmDestruction"/>
<result column="XHQCBH" property="xhqcbh"/>
<result column="FQR" property="fqr"/>
<result column="FQRQ" property="fqrq"/>
<result column="XHYY" property="xhyy"/>
<result column="SHRY" property="shry"/>
<result column="SHYJ" property="shyj"/>
<result column="XHR" property="xhr"/>
<result column="XHRQ" property="xhrq"/>
</resultMap>
<!-- 销毁页面记录查询 -->
<resultMap id="ShowDestructionResultMap" type="com.pashanhoo.destroy.entity.vo.DgArchivesDestructionListVO">
<id column="BSM_DESTRUCTION" property="bsmDestruction" />
<result column="XHQCBH" property="xhqcbh" />
<result column="FQR" property="fqr" />
<result column="FQRQ" property="fqrq" />
<result column="XHYY" property="xhyy" />
<result column="SHRY" property="shry" />
<result column="SHYJ" property="shyj" />
<result column="XHR" property="xhr" />
<result column="XHRQ" property="xhrq" />
<result column="AJ_NUM" property="ajNum" />
</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>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
BSM_DESTRUCTION,
XHQCBH,
FQR,
FQRQ,
XHYY,
SHRY,
SHYJ,
XHR,
XHRQ
</sql>
<update id="updateArchivesStatus" parameterType="java.lang.String">
update dg_archives b
set b.dazt = #{dazt,jdbcType=VARCHAR}
where exists (select 1
from DG_DESTRUCTION_CATALOG a
where a.bsm_destruction = #{bsm_destruction,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="selectXhResult" resultMap="ShowDestructionResultMap">
select a.BSM_DESTRUCTION,
a.XHQCBH,
a.FQR,
a.FQRQ,
a.XHYY,
a.SHRY,
a.SHYJ,
a.XHR,
a.XHRQ,
count(1) over(partition by b.bsm_destruction, b.bsm_archives) aj_num
from dg_archives_destruction a, dg_destruction_catalog b
where a.bsm_destruction = b.bsm_destruction
and exists
(select 1 from dg_archives c where c.bsm_archives = b.bsm_archives
<if test="ajh!=null and ajh!='' ">
and c.ajh=#{ajh,jdbcType=VARCHAR}
</if>
)
<if test="xhqcbh!=null and xhqcbh!='' ">
and a.xhqcbh=#{xhqcbh,jdbcType=VARCHAR}
</if>
<if test="xhrq!=null and xhrq!='' ">
and a.XHRQ=#{xhrq,jdbcType=TIMESTAMP}
</if>
order by a.XHRQ desc
</select>
<select id="queryArchivesInfo" resultMap="ShowArchivesInfoResultMap">
select * from dg_archives b
where exists (select 1
from DG_DESTRUCTION_CATALOG a
where a.BSM_LEND = #{bsm_destruction,jdbcType=VARCHAR}
and b.bsm_archives = a.bsm_archives)
</select>
<select id="getDestroyLeftMenu" resultType="com.pashanhoo.archive.entity.DgArchivesDO">
select DA.*
from DG_ARCHIVES DA
join DG_DESTRUCTION_CATALOG DDC on DA.BSM_ARCHIVES = DDC.BSM_ARCHIVES
join DG_ARCHIVES_DESTRUCTION DAD on DDC.BSM_DESTRUCTION = DAD.BSM_DESTRUCTION
where DAD.XHQCBH = #{xhqcbh,jdbcType=VARCHAR}
</select>
</mapper>