his-fundjour-mapper.xml
1.83 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
<?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 仝玉甫 -->
<mapper namespace="com.cjs.cms.dao.report.HisFundjourDao">
<sql id="queryFundSumCondition">
where t.business_flag in ('2515', '2516') and (t.remark like '%入金调增%' or t.remark like '%客户提现%')
<if test="startDate != null and startDate != ''">
<![CDATA[and t.init_date >= #{startDate}]]>
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[and t.init_date <= #{endDate}]]>
</if>
</sql>
<!-- 出入金汇总统计 -->
<select id="queryFundSum" parameterType="map" resultType="map">
<include refid="common.pageStart"/>
select t.init_date, round(sum(decode(t.business_flag, '2515', t.occur_balance, 0))) input,
round(sum(decode(t.business_flag, '2516', t.occur_balance, 0))) output
from hs_his.his_fundjour_view t
<include refid="queryFundSumCondition" />
group by t.init_date
order by t.init_date desc
<include refid="common.pageEnd"/>
</select>
<!-- 出入金汇总统计 -->
<select id="queryFundSumTotal" parameterType="map" resultType="int">
select count(*) from (
select t.init_date, round(sum(decode(t.business_flag, '2515', t.occur_balance, 0))) input,
round(sum(decode(t.business_flag, '2516', t.occur_balance, 0))) output
from hs_his.his_fundjour_view t
<include refid="queryFundSumCondition" />
group by t.init_date
)
</select>
<!-- 出入金汇总统计 -->
<select id="queryFundAmount" parameterType="map" resultType="map">
select round(sum(decode(t.business_flag, '2515', t.occur_balance, 0))) input,
round(sum(decode(t.business_flag, '2516', t.occur_balance, 0))) output
from hs_his.his_fundjour_view t
<include refid="queryFundSumCondition" />
</select>
</mapper>