ProductPoolMapper.xml
4.12 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
<?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.search.dal.ProductPoolMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductPool">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="activityId" property="activityId" jdbcType="INTEGER"/>
<result column="pool_name" property="poolName" jdbcType="VARCHAR"/>
<result column="comment" property="comment" jdbcType="VARCHAR"/>
<result column="productType" property="productType" jdbcType="CHAR"/>
<result column="diff_type" property="diffType" jdbcType="CHAR"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="shop_id" property="shopId" jdbcType="INTEGER"/>
<result column="backImageUrl" property="backImageUrl" jdbcType="VARCHAR"/>
<result column="service_type" property="serviceType" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, activityId, pool_name, comment, productType, diff_type, create_time, shop_id, backImageUrl,service_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from product_pool
where id = #{id,jdbcType=INTEGER}
limit 1
</select>
<select id="selectByIds" resultMap="BaseResultMap" parameterType="java.lang.Integer">
SELECT
<include refid="Base_Column_List"/>
FROM
product_pool
where diff_type = 4 and id in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from product_pool
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ProductPool">
insert into product_pool (id, activityId, pool_name, comment, productType, diff_type, create_time, shop_id, backImageUrl,service_type)
values (#{id,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{poolName,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{productType,jdbcType=CHAR}, #{diffType,jdbcType=CHAR},
#{createTime,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{backImageUrl,jdbcType=VARCHAR},#{serviceType,jdbcType=INTEGER})
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ProductPool">
update product_pool
<set>
<if test="activityId != null">
activityId = #{activityId,jdbcType=INTEGER},
</if>
<if test="poolName != null">
pool_name = #{poolName,jdbcType=VARCHAR},
</if>
<if test="comment != null">
comment = #{comment,jdbcType=VARCHAR},
</if>
<if test="productType != null">
productType = #{productType,jdbcType=CHAR},
</if>
<if test="diffType != null">
diff_type = #{diffType,jdbcType=CHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="backImageUrl != null">
backImageUrl = #{backImageUrl,jdbcType=VARCHAR},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(1) FROM product_pool
</select>
<select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from product_pool limit #{offset},#{pageSize}
</select>
</mapper>