ration-old-quality-record-mapper.xml
1.42 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
<?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.ration.RationOldQualityRecordDao">
<!-- 再托管配售申请 -->
<sql id="searchCondition">
where 1 = 1
<if test="otcName!=null and otcName !=''">
and b.otc_name=#{otcName}
</if>
<if test="otcCode!=null and otcCode !=''">
and b.otc_code=#{otcCode}
</if>
<if test="startDate != null and startDate != ''">
<![CDATA[ and a.create_at >= #{startDate}]]>
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[ and a.create_at <= #{endDate}]]>
</if>
<if test="userId!=null and userId !=''">
and a.user_id=#{userId}
</if>
order by a.create_at
</sql>
<!-- 再托管配售申请 -->
<select id="search" parameterType="map" resultType="map">
select b.otc_code, b.otc_name, a.user_id, DATE_FORMAT(a.create_at,'%Y-%m-%d') create_at,a.ration_amount
from ration_old_quality_record a
left join ration_old_config b on a.ration_old_config_id = b.id
<include refid="searchCondition" />
<include refid="common.pageLimit" />
</select>
<select id="searchTotal" parameterType="map" resultType="int">
select count(1)
from ration_old_quality_record a
left join ration_old_config b on a.ration_old_config_id = b.id
<include refid="searchCondition" />
</select>
</mapper>