SalesCategoryMapper.xml
3.29 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
<?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.SalesCategoryMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SalesCategory">
<id column="category_id" property="categoryId" jdbcType="INTEGER" />
<result column="category_name" property="categoryName" jdbcType="VARCHAR" />
<result column="relation_parameter" property="relationParameter" jdbcType="VARCHAR" />
<result column="relation_url" property="relationUrl" jdbcType="VARCHAR" />
<result column="parent_id" property="parentId" jdbcType="INTEGER" />
<result column="order_by" property="orderBy" jdbcType="INTEGER" />
<result column="icon" property="icon" jdbcType="VARCHAR" />
<result column="category_code" property="categoryCode" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="level_number" property="levelNumber" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="app_type" property="appType" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
category_id, category_name, relation_parameter,
relation_url, parent_id, order_by,
icon, category_code, state,
level_number, create_time, app_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from sales_category
where category_id = #{categoryId,jdbcType=INTEGER}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from
sales_category
where category_id = #{categoryId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.SalesCategory">
insert into sales_category
(category_id, category_name,
relation_parameter,
relation_url,
parent_id, order_by,
icon, category_code, state,
level_number,
create_time, app_type
)
values (#{categoryId,jdbcType=INTEGER},
#{categoryName,jdbcType=VARCHAR},
#{relationParameter,jdbcType=VARCHAR},
#{relationUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{orderBy,jdbcType=INTEGER},
#{icon,jdbcType=VARCHAR},
#{categoryCode,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{levelNumber,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
#{appType,jdbcType=TINYINT}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SalesCategory">
update
sales_category
set category_name = #{categoryName,jdbcType=VARCHAR},
relation_parameter = #{relationParameter,jdbcType=VARCHAR},
relation_url = #{relationUrl,jdbcType=VARCHAR},
parent_id =
#{parentId,jdbcType=INTEGER},
order_by = #{orderBy,jdbcType=INTEGER},
icon = #{icon,jdbcType=VARCHAR},
category_code =
#{categoryCode,jdbcType=VARCHAR},
state = #{state,jdbcType=INTEGER},
level_number = #{levelNumber,jdbcType=INTEGER},
create_time =
#{createTime,jdbcType=INTEGER},
app_type = #{appType,jdbcType=TINYINT}
where category_id = #{categoryId,jdbcType=INTEGER}
</update>
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from sales_category
</select>
</mapper>