fund-jour-mapper.xml
2.74 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
<?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">
<!-- 查询红冲 @author tongxiaochuan -->
<mapper namespace="com.cjs.cms.dao.report.FundJourDao">
<sql id="fund_jour_field">
CURR_DATE, CURR_TIME, FUND_ACCOUNT, OCCUR_BALANCE, POST_BALANCE, BUSINESS_FLAG, REMARK
</sql>
<sql id="searchCondition">
where business_flag = #{businessFlag}
<if test="bussinessType != null and bussinessType != ''">
and REMARK like '%'||#{bussinessType}||'%'
</if>
<if test="fundAccount != '' and fundAccount != null">
and fund_account = #{fundAccount}
</if>
<if test="startDate != '' and startDate != null">
<![CDATA[and init_date >= #{startDate}]]>
</if>
<if test="endDate != '' and endDate != null">
<![CDATA[and init_date <= #{endDate}]]>
</if>
</sql>
<select id="search" parameterType="Map" resultType="Map">
<include refid="common.pageStart" />
SELECT D.*, C.CLIENT_NAME FROM(
SELECT <include refid="fund_jour_field" />
FROM HS_ASSET.FUNDJOUR A
<include refid="searchCondition" />
UNION ALL
SELECT <include refid="fund_jour_field" />
FROM HS_HIS.HIS_FUNDJOUR B
<include refid="searchCondition" />) D,
HS_ASSET.CLIENT C
WHERE C.CLIENT_ID = D.FUND_ACCOUNT
ORDER BY CURR_DATE DESC, CURR_TIME DESC, FUND_ACCOUNT DESC
<include refid="common.pageEnd" />
</select>
<select id="searchTotal" parameterType="Map" resultType="Integer">
SELECT COUNT(*) FROM(
SELECT <include refid="fund_jour_field" />
FROM HS_ASSET.FUNDJOUR A
<include refid="searchCondition" />
UNION ALL
SELECT <include refid="fund_jour_field" />
FROM HS_HIS.HIS_FUNDJOUR B
<include refid="searchCondition" />)
</select>
<sql id="queryAccountSql">
SELECT T.CURR_DATE,
T.CURR_TIME,
T.SERIAL_NO,
T.BUSINESS_FLAG,
T.FUND_ACCOUNT,
T.OCCUR_BALANCE,
T.POST_BALANCE,
T.REMARK
FROM HS_HIS.HIS_FUNDJOUR T
where 1=1
<if test="fundAccount != '' and fundAccount != null">
and fund_account = #{fundAccount}
</if>
<if test="businessFlag != '' and businessFlag != null">
and business_flag = #{businessFlag}
</if>
<if test="currDate != '' and currDate != null">
and curr_date = #{currDate}
</if>
ORDER BY
T.CURR_DATE DESC, T.FUND_ACCOUNT
</sql>
<select id="queryAccount" resultType="map" parameterType="map">
<include refid="common.pageStart" />
<include refid="queryAccountSql" />
<include refid="common.pageEnd" />
</select>
<select id="exportFundJour" resultType="map" parameterType="map">
<include refid="queryAccountSql" />
</select>
<select id="queryAccountTotal" parameterType="Map" resultType="Integer">
select count(1)from (<include refid="queryAccountSql" /> )
</select>
</mapper>