ShopAdditionalImageMapper.xml
3.15 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
<?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.ShopAdditionalImageMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ShopAdditionalImage">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="shop_id" property="shopId" jdbcType="INTEGER"/>
<result column="search_show_image" property="searchShowImage" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
<result column="shop_desc" property="shopDesc" jdbcType="VARCHAR"/>
<result column="shop_back_img" property="shopBackImg" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, shop_id, search_show_image, create_time, update_time, shop_desc, shop_back_img
</sql>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from shop_additional_image where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ShopAdditionalImage">
insert into shop_additional_image (id, shop_id, search_show_image, create_time, update_time, shop_desc, shop_back_img)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{searchShowImage,jdbcType=VARCHAR},
#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
#{shopDesc,jdbcType=VARCHAR}, #{shopBackImg,jdbcType=VARCHAR})
</insert>
<select id="selectByShopIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from shop_additional_image where shop_id in
<foreach item="item" index="index" collection="shopsIds"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from shop_additional_image
where id = #{id,jdbcType=INTEGER}
limit 1
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ShopAdditionalImage">
update shop_additional_image
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="searchShowImage != null">
search_show_image = #{searchShowImage,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="shopDesc != null">
shop_desc = #{shopDesc,jdbcType=VARCHAR},
</if>
<if test="shopBackImg != null">
shop_back_img = #{shopBackImg,jdbcType=VARCHAR},
</if>
</set>
where id = #{id, jdbcType=INTEGER}
</update>
</mapper>