rebateclear-mapper.xml
1.21 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
<?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.RebateClearDao">
<sql id="rebateclear_field">
INIT_DATE,DEVELOPER,BUSINESS_BALANCE,FARE0,ROUND(REBATE,2) AS REBATE,REBATE_BALANCE
</sql>
<select id="search" parameterType="map" resultType="map">
<include refid="common.pageStart" />
SELECT <include refid="rebateclear_field" /> FROM HS_ASSET.REBATECLEAR_VIEW
WHERE 1=1
<include refid="searchCondition" />
ORDER BY INIT_DATE DESC,DEVELOPER ASC,REBATE_BALANCE DESC
<include refid="common.pageEnd" />
</select>
<sql id="searchCondition">
<if test="developer != null and developer != ''">
AND DEVELOPER = #{developer}
</if>
<if test="startDate != null and startDate != ''">
<![CDATA[AND INIT_DATE >= #{startDate}]]>
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[AND INIT_DATE <= #{endDate}]]>
</if>
</sql>
<select id="searchTotal" parameterType="map" resultType="int">
SELECT COUNT(1) FROM HS_ASSET.REBATECLEAR_VIEW
WHERE 1=1
<include refid="searchCondition" />
</select>
</mapper>