BrandMapper.xml
5.04 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?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.BrandMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Brand">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="brand_name" property="brandName" jdbcType="VARCHAR" />
<result column="brand_domain" property="brandDomain" jdbcType="VARCHAR" />
<result column="brand_alif" property="brandAlif" jdbcType="VARCHAR" />
<result column="brand_ico" property="brandIco" jdbcType="VARCHAR" />
<result column="is_hot" property="isHot" jdbcType="CHAR" />
<result column="brand_name_cn" jdbcType="VARCHAR" property="brandNameCn" />
<result column="brand_name_en" jdbcType="VARCHAR" property="brandNameEn" />
<result column="brand_keyword" jdbcType="VARCHAR" property="brandKeyword" />
<result column="hot_keyword" jdbcType="VARCHAR" property="hotKeyword" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="country_id" property="countryId" jdbcType="INTEGER" />
<result column="brand_style" jdbcType="VARCHAR" property="brandStyle" />
<result column="shelves_brand_time" property="shelvesBrandTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, brand_name, brand_domain, brand_alif, brand_ico,
is_hot,
brand_name_cn, brand_name_en,
brand_keyword, hot_keyword,status,country_id,brand_style,shelves_brand_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
select
<include refid="Base_Column_List" />
from brand
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"
timeout="20000">
delete from brand
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.Brand"
timeout="20000">
insert ignore into brand (id, brand_name, brand_domain,
brand_alif,
brand_ico, is_hot,
brand_name_cn, brand_name_en, brand_keyword,
hot_keyword,status,country_id,brand_style,shelves_brand_time)
values (
#{id,jdbcType=INTEGER},
#{brandName,jdbcType=VARCHAR},
#{brandDomain,jdbcType=VARCHAR},
#{brandAlif,jdbcType=VARCHAR},
#{brandIco,jdbcType=VARCHAR},
#{isHot,jdbcType=CHAR},
#{brandNameCn,jdbcType=VARCHAR},
#{brandNameEn,jdbcType=VARCHAR},
#{brandKeyword,jdbcType=VARCHAR},
#{hotKeyword,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER},
#{countryId,jdbcType=INTEGER},
#{brandStyle,jdbcType=VARCHAR},
#{shelvesBrandTime,jdbcType=INTEGER}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Brand"
timeout="20000">
update brand
<set>
<if test="brandName != null">
brand_name = #{brandName,jdbcType=VARCHAR},
</if>
<if test="brandDomain != null">
brand_domain = #{brandDomain,jdbcType=VARCHAR},
</if>
<if test="brandAlif != null">
brand_alif = #{brandAlif,jdbcType=VARCHAR},
</if>
<if test="brandIco != null">
brand_ico = #{brandIco,jdbcType=VARCHAR},
</if>
<if test="isHot != null">
is_hot = #{isHot,jdbcType=CHAR},
</if>
<if test="brandNameCn != null">
brand_name_cn = #{brandNameCn,jdbcType=VARCHAR},
</if>
<if test="brandNameEn != null">
brand_name_en = #{brandNameEn,jdbcType=VARCHAR},
</if>
<if test="brandKeyword != null">
brand_keyword = #{brandKeyword,jdbcType=VARCHAR},
</if>
<if test="hotKeyword != null">
hot_keyword = #{hotKeyword,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="countryId != null">
country_id = #{countryId,jdbcType=INTEGER},
</if>
<if test="brandStyle != null">
brand_style = #{brandStyle,jdbcType=VARCHAR},
</if>
<if test="shelvesBrandTime != null">
shelves_brand_time = #{shelvesBrandTime,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000" >
SELECT count(1) FROM brand
</select>
<select id="selectBrandPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from brand limit #{offset},#{pageSize}
</select>
</mapper>