payment-order-mapper.xml 1.84 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">

<mapper namespace="com.cjs.cms.dao.user.fund.PaymentOrderDao">

	<sql id="payment_order">
		id,bOrganId,bAcctKind,sOrganId,sBranchId,sAcctKind,sAcctType,sCustPwd,sCustPwd2,
		FunctionId,ExSerial,Name,bCustAcct,sCustAcct,MoneyType,OccurBala,CardType,Card,bFrozenFlag,
		ErrorNo,ErrorInfo,sSerial,sEnableBala,bEnableBala,Nationality,PostCode,Address,
		TelNo,Email,Summary,create_at
	</sql>

	<select id="search" parameterType="java.util.Map"
		resultType="java.util.Map">
		select <include refid="payment_order" />
		from payment_order 
		where 1 = 1
		<if test="name !=null and name !=''">
			and Name = #{name}
		</if>
		<if test="sAcctKind !=null and sAcctKind !=''">
			and sAcctKind = #{sAcctKind}
		</if>
		<if test="sCustAcct !=null and sCustAcct !=''">
			and sCustAcct = #{sCustAcct}
		</if>
		<if test="beginDate != null and beginDate != ''"> 
			<![CDATA[ and create_at >= #{beginDate}]]> 
		</if>
		<if test="endDate != null and endDate != ''">  
			<![CDATA[ and create_at <= DATE_ADD(#{endDate}, INTERVAL 1 day)]]> 
		</if>
		order by create_at desc
		limit #{start},#{limit}
	</select>

	<select id="searchTotal" parameterType="java.util.Map" resultType="int">
		select count(*) 
		from payment_order 
		where 1 = 1
		<if test="name !=null and name !=''">
			and Name = #{name}
		</if>
		<if test="sAcctKind !=null and sAcctKind !=''">
			and sAcctKind = #{sAcctKind}
		</if>
		<if test="sCustAcct !=null and sCustAcct !=''">
			and sCustAcct = #{sCustAcct}
		</if>
		<if test="beginDate != null and beginDate != ''"> 
			<![CDATA[ and create_at >= #{beginDate}]]> 
		</if>
		<if test="endDate != null and endDate != ''">  
			<![CDATA[ and create_at <= DATE_ADD(#{endDate}, INTERVAL 1 day)]]> 
		</if>
	</select>
</mapper>