appraisal-mapper.xml 1.2 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 tongxiaochuan -->
<mapper namespace="com.cjs.cms.dao.user.AppraisalDao">
	
	<sql id="appraisal_field">
		FUND_ACCOUNT, CLIENT_NAME, OTC_CODE, OTC_NAME, APPLY_COUNT, APPRAISAL_FARE, REMARK, APPLY_DATE
	</sql>
	
	<sql id="searchCondition">
		where 1=1 
		<if test="fundAccount != '' and fundAccount != null">
			and  fund_account = #{fundAccount}  
		</if>
		<if test="startDate != '' and startDate != null">
			and APPLY_DATE >= #{startDate} 
		</if>
		<if test="endDate != '' and endDate != null">
			<![CDATA[and APPLY_DATE <= #{endDate}]]> 
		</if>
	</sql>
	
	<select id="search" parameterType="map" resultType="map">
		<include refid="common.pageStart" /> 
		select <include refid="appraisal_field" /> 
		from HS_ASSET.TRUSTAPPLY 
		<include refid="searchCondition" /> 
		order by APPLY_DATE desc, FUND_ACCOUNT asc 
		<include refid="common.pageEnd" />
	</select>
	
	<select id="searchTotal" parameterType="map" resultType="int">
		select count(1) from HS_ASSET.TRUSTAPPLY 
		<include refid="searchCondition" /> 
	</select>
	
</mapper>