SizePoolDetailMapper.xml
2.33 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
<?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.ufo.dal.SizePoolDetailMapper">
<resultMap id="BaseResultMap" type="com.yoho.ufo.dal.model.SizePoolDetail">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="size_pool_id" property="sizePoolId" jdbcType="INTEGER" />
<result column="is_include" property="isInclude" jdbcType="INTEGER" />
<result column="item_id" property="itemId" jdbcType="INTEGER" />
<result column="item_type" property="itemType" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, size_pool_id, is_include, item_id, item_type
</sql>
<insert id="insert" parameterType="com.yoho.ufo.dal.model.SizePoolDetail">
insert into size_pool_detail(id, size_pool_id, is_include, item_id, item_type)
values (#{id}, #{sizePoolId}, #{isInclude}, {itemIdd}, #{itemType})
</insert>
<insert id="batchInsert" parameterType="java.util.List" >
insert into size_pool_detail (size_pool_id, is_include, item_id, item_type) values
<foreach collection="list" item="item" index="index" separator="," >
( #{item.sizePoolId,jdbcType=INTEGER}, #{item.isInclude,jdbcType=INTEGER},
#{item.itemId,jdbcType=INTEGER}, #{item.itemType,jdbcType=INTEGER})
</foreach>
</insert>
<delete id="deleteBySizePoolId" parameterType="java.lang.Integer">
delete from size_pool_detail
where size_pool_id = #{sizePoolId,jdbcType=INTEGER}
</delete>
<select id="queryBySizePoolId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from size_pool_detail
where size_pool_id = #{sizePoolId, jdbcType=INTEGER}
</select>
<select id="queryByBrandId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from size_pool_detail
where is_include=1 and item_type=1 and item_id=#{brandId}
</select>
<select id="queryBySizePoolIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from size_pool_detail
where size_pool_id in
<foreach collection="sizePoolIdList" item="sizePoolId" open="(" close=")" separator=",">
#{sizePoolId}
</foreach>
</select>
</mapper>