CouponMapper.xml
3.65 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
<?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.promotion.CouponMapper">
<resultMap id="BaseResultMap" type="com.yohoufo.dal.promotion.model.Coupon">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="coupon_token" jdbcType="VARCHAR" property="couponToken" />
<result column="coupon_name" jdbcType="VARCHAR" property="couponName" />
<result column="coupon_amount" jdbcType="DECIMAL" property="couponAmount" />
<result column="user_type" jdbcType="INTEGER" property="userType" />
<result column="coupon_type" jdbcType="INTEGER" property="couponType" />
<result column="coupon_num" jdbcType="INTEGER" property="couponNum" />
<result column="use_num" jdbcType="SMALLINT" property="useNum" />
<result column="send_num" jdbcType="INTEGER" property="sendNum" />
<result column="use_limit_type" jdbcType="TINYINT" property="useLimitType" />
<result column="use_limit_value" jdbcType="SMALLINT" property="useLimitValue" />
<result column="product_limit_type" jdbcType="TINYINT" property="productLimitType" />
<result column="product_limit_value" jdbcType="VARCHAR" property="productLimitValue" />
<result column="start_time" jdbcType="INTEGER" property="startTime" />
<result column="end_time" jdbcType="INTEGER" property="endTime" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="INTEGER" property="createTime" />
<result column="pid" jdbcType="INTEGER" property="pid" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="skup_forbid_type" jdbcType="VARCHAR" property="skupForbidType" />
<result column="skup_allow_type" jdbcType="VARCHAR" property="skupAllowType" />
<result column="business_client" jdbcType="VARCHAR" property="businessClient" />
<result column="receive_start_time" property="receiveStartTime" jdbcType="INTEGER" />
<result column="receive_end_time" property="receiveEndTime" jdbcType="INTEGER" />
<result column="receive_channels" property="receiveChannels" jdbcType="VARCHAR" />
<result column="check_required" property="checkRequired" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, coupon_token, coupon_name, coupon_amount, user_type, coupon_type, coupon_num, use_num, send_num,
use_limit_type, use_limit_value, product_limit_type, product_limit_value, start_time,
end_time, status, create_time, pid, remark,skup_forbid_type,skup_allow_type,business_client,
receive_start_time,receive_end_time,receive_channels,check_required
</sql>
<update id="updateCouponSendNum" >
update coupon set send_num=#{sendNum} where coupon_token=#{couponToken}
</update>
<select id="selectByCouponToken" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from coupon
where coupon_token = #{couponToken,jdbcType=VARCHAR}
</select>
<select id="selectByCouponIds" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from coupon
where id IN
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectByCouponTokens" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from coupon
where coupon_token IN
<foreach item="token" index="index" collection="list" open="(" separator="," close=")">
#{token}
</foreach>
</select>
</mapper>