CutDownPriceUserRecordMapper.xml
1.93 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
<?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.yoho.activity.dal.CutDownPriceUserRecordMapper">
<resultMap id="BaseResultMap" type="com.yoho.activity.dal.model.CutDownPriceUserRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="activity_id" property="activityId" jdbcType="INTEGER" />
<result column="product_skn" property="productSkn" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, user_id, activity_id, product_skn, create_time
</sql>
<insert id="addCutDownUserRecord" parameterType="com.yoho.activity.dal.model.CutDownPriceUserRecord">
insert into cutdown_price_user_record (user_id, activity_id, product_skn, create_time)
values (#{userId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}
)
</insert>
<select id="selectCutDownUserRecordCount" resultType="java.lang.Integer" >
select
count(id)
from cutdown_price_user_record
where 1=1
and user_id = #{userId,jdbcType=INTEGER}
</select>
<select id="selectCutDownPriceUserRecordByPage" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from cutdown_price_user_record
where 1=1
and user_id = #{userId,jdbcType=INTEGER}
limit #{start,jdbcType=INTEGER}, #{size,jdbcType=INTEGER}
</select>
<select id="selectCutDownPriceUserRecord" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cutdown_price_user_record
where activity_id = #{activityId,jdbcType=INTEGER}
and user_id = #{userId,jdbcType=INTEGER}
and product_skn = #{productSkn,jdbcType=INTEGER}
</select>
</mapper>