InviteSettlementMapper.xml
3.85 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?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.yohoufo.dal.order.InviteSettlementMapper" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.InviteSettlement" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="settle_code" property="settleCode" jdbcType="INTEGER" />
<result column="settle_type" property="settleType" jdbcType="INTEGER" />
<result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
<result column="settle_time" property="settleTime" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="id_card_no" property="idCardNo" jdbcType="VARCHAR" />
<result column="bank_name" property="bankName" jdbcType="VARCHAR" />
<result column="bank_branch" property="bankBranch" jdbcType="VARCHAR" />
<result column="bank_card_no" property="bankCardNo" jdbcType="VARCHAR" />
<result column="paid_time" property="paidTime" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, settle_code, settle_type, settle_amount, settle_time,name, id_card_no, bank_name, bank_branch, bank_card_no,paid_time, status, create_time
</sql>
<insert id="insert" parameterType="com.yohoufo.dal.order.model.InviteSettlement" useGeneratedKeys="true" keyProperty="id">
insert into invite_settlement (
id,
uid,
settle_code,
settle_type,
settle_amount,
settle_time,
name,
id_card_no,
bank_name,
bank_branch,
bank_card_no,
status,
create_time)
values (
#{id,jdbcType=INTEGER},
#{uid,jdbcType=INTEGER},
#{settleCode,jdbcType=INTEGER},
#{settleType,jdbcType=INTEGER},
#{settleAmount,jdbcType=DECIMAL},
#{settleTime,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{idCardNo,jdbcType=VARCHAR},
#{bankName,jdbcType=VARCHAR},
#{bankBranch,jdbcType=VARCHAR},
#{bankCardNo,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER},
#{createTime,jdbcType=INTEGER})
</insert>
<update id="updateByUidAndId" parameterType="com.yohoufo.dal.order.model.InviteSettlement" >
update invite_settlement
<set >
<if test="settleCode != null" >
settle_code = #{settleCode,jdbcType=INTEGER},
</if>
<if test="settleAmount != null" >
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
<if test="settleTime != null" >
settle_time = #{settleTime,jdbcType=INTEGER},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER} and uid = #{uid,jdbcType=INTEGER}
</update>
<select id="selectByUidAndStatusWithLimit" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from invite_settlement
where uid = #{uid,jdbcType=INTEGER} and status = #{status,jdbcType=INTEGER}
order by id desc
limit #{start,jdbcType=INTEGER}, #{limit,jdbcType=INTEGER}
</select>
<select id="selectByUidAndIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from invite_settlement
where uid = #{uid,jdbcType=INTEGER}
and id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectByIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from invite_settlement
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>