his-fundjour-mapper.xml 1.83 KB
<?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>