ration-invite-record-mapper.xml
2.38 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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 xiangwei-->
<mapper namespace="com.cjs.cms.dao.ration.RationInviteRecordDao">
<insert id="insert" parameterType="RationInviteRecordInfo" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into ration_invite_record
(ration_invite_config_id,ration_invite_quality_id, ration_invite_user_id, sell_user_id, sell_otc_account, buy_user_id,
buy_otc_account, fund, stock_amount,
transfer, ration_status, remark, create_at, create_by)
values (#{rationInviteConfigId},#{rationInviteQualityId} ,#{rationInviteUserId}, #{sellUserId}, #{sellOtcAccount}, #{buyUserId},
#{buyOtcAccount}, #{fund}, #{stockAmount},
#{transfer}, #{rationStatus}, #{remark}, now(), #{createBy})
</insert>
<!-- 配售详情查询 -->
<select id="queryRationDetail" parameterType="map" resultType="map">
select t.id,r.otc_code,r.otc_name,t.sell_user_id,t.ration_status,
t.buy_user_id,t.stock_amount,t.fund,t.create_at,t.create_by,t.remark
from ration_invite_record t inner join ration_invite_config r
on t.ration_invite_config_id = r.id
<include refid="queryCondition" />
order by t.id desc
<include refid="common.pageLimit" />
</select>
<select id="queryRationDetailTotal" parameterType="map" resultType="int">
select count(1) from ration_invite_record t inner join ration_invite_config r
on t.ration_invite_config_id = r.id
<include refid="queryCondition" />
</select>
<sql id="queryCondition">
where 1=1
<if test="otcCode != null and otcCode != ''">
and r.otc_code = #{otcCode}
</if>
<if test="otcName != null and otcName != ''">
and r.otc_name = #{otcName}
</if>
<if test="sellUserId != null and sellUserId != ''">
and t.sell_user_id = #{sellUserId}
</if>
<if test="buyUserId != null and buyUserId != ''">
and t.buy_user_id = #{buyUserId}
</if>
<if test="startDate != null and startDate != ''">
<![CDATA[and t.create_at >= #{startDate} ]]>
</if>
<if test="endDate != null and endDate != ''">
<![CDATA[and t.create_at <= #{endDate} ]]>
</if>
<if test="rationStatus != null and rationStatus != ''">
and t.ration_status = #{rationStatus}
</if>
<if test="applyNo != null and applyNo != ''">
and t.apply_no = #{applyNo}
</if>
</sql>
</mapper>