CsBrandKeywordMapper.xml
2.18 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
<?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.CsBrandKeywordMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.CsBrandKeyword">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="brand_id" property="brandId" jdbcType="INTEGER"/>
<result column="keyword" property="keyword" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, brand_id, keyword, status, update_time
</sql>
<insert id="insert" parameterType="com.yoho.search.dal.model.CsBrandKeyword" timeout="20000">
insert ignore into cs_brand_keyword (id, brand_id, keyword, status, update_time)
values (#{id,jdbcType=INTEGER},#{brandId,jdbcType=INTEGER}, #{keyword,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},#{updateTime,jdbcType=VARCHAR})
</insert>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" timeout="20000">
delete from cs_brand_keyword
where id = #{id,jdbcType=INTEGER}
</delete>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.CsBrandKeyword" timeout="20000">
update cs_brand_keyword
<set>
<if test="keyword != null">
keyword = #{keyword,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" timeout="20000">
select
<include refid="Base_Column_List"/>
from cs_brand_keyword
where id = #{id,jdbcType=INTEGER}
LIMIT 1
</select>
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from cs_brand_keyword where status = 1
</select>
</mapper>