UfoBrandMapper.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?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.UfoBrandMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Brand">
<id column="id" property="id" jdbcType="SMALLINT"/>
<result column="brand_name" property="brandName" jdbcType="VARCHAR"/>
<result column="brand_name_en" property="brandNameEn" jdbcType="VARCHAR"/>
<result column="brand_logo" property="brandLogo" jdbcType="VARCHAR"/>
<result column="brand_search" property="brandSearch" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id, brand_name, brand_name_en, brand_logo, brand_search, status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Short">
select
<include refid="Base_Column_List"/>
from ufo_brand
where id = #{id,jdbcType=SMALLINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
delete from ufo_brand
where id = #{id,jdbcType=SMALLINT}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Brand" >
insert into ufo_brand
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="brandName != null" >
brand_name,
</if>
<if test="brandNameEn != null" >
brand_name_en,
</if>
<if test="brandLogo != null" >
brand_logo,
</if>
<if test="brandSearch != null" >
brand_search,
</if>
<if test="status != null" >
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=SMALLINT},
</if>
<if test="brandName != null" >
#{brandName,jdbcType=VARCHAR},
</if>
<if test="brandNameEn != null" >
#{brandNameEn,jdbcType=VARCHAR},
</if>
<if test="brandLogo != null" >
#{brandLogo,jdbcType=VARCHAR},
</if>
<if test="brandSearch != null" >
#{brandSearch,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Brand">
update ufo_brand
<set>
<if test="brandName != null">
brand_name = #{brandName,jdbcType=VARCHAR},
</if>
<if test="brandNameEn != null">
brand_name_en = #{brandNameEn,jdbcType=VARCHAR},
</if>
<if test="brandLogo != null">
brand_logo = #{brandLogo,jdbcType=VARCHAR},
</if>
<if test="brandSearch != null">
brand_search = #{brandSearch,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=SMALLINT}
</update>
<select id="selectByIdList" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from ufo_brand
WHERE
id in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
select count(*) from ufo_brand
</select>
<select id="selectPageList" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from ufo_brand limit #{offset},#{pageSize}
</select>
</mapper>