StandardMapper.xml
4.51 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
125
126
127
128
129
130
131
132
133
134
135
136
<?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.StandardMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Standard">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="standard_name" property="standardName"
jdbcType="VARCHAR" />
<result column="standard_sort_id" property="standardSortId"
jdbcType="INTEGER" />
<result column="sort_id" property="sortId" jdbcType="INTEGER" />
<result column="order_by" property="orderBy" jdbcType="INTEGER" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="box_view" property="boxView" jdbcType="CHAR" />
<result column="search_view" property="searchView" jdbcType="CHAR" />
<result column="parameter_make" property="parameterMake"
jdbcType="CHAR" />
<result column="search_make" property="searchMake" jdbcType="CHAR" />
<result column="search_order_by" property="searchOrderBy"
jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, standard_name, standard_sort_id, sort_id, order_by,
unit, box_view,
search_view,
parameter_make, search_make,
search_order_by, status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
select
<include refid="Base_Column_List" />
from standard
where id = #{id,jdbcType=INTEGER}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"
timeout="20000">
delete from standard
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.Standard"
timeout="20000">
insert ignore into standard (id, standard_name, standard_sort_id,
sort_id, order_by, unit,
box_view, search_view, parameter_make,
search_make, search_order_by, status
)
values (#{id,jdbcType=INTEGER},
#{standardName,jdbcType=VARCHAR},
#{standardSortId,jdbcType=INTEGER},
#{sortId,jdbcType=INTEGER}, #{orderBy,jdbcType=INTEGER},
#{unit,jdbcType=VARCHAR},
#{boxView,jdbcType=CHAR},
#{searchView,jdbcType=CHAR},
#{parameterMake,jdbcType=CHAR},
#{searchMake,jdbcType=CHAR}, #{searchOrderBy,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Standard"
timeout="20000">
update standard
<set>
<if test="standardName != null">
standard_name = #{standardName,jdbcType=VARCHAR},
</if>
<if test="standardSortId != null">
standard_sort_id = #{standardSortId,jdbcType=INTEGER},
</if>
<if test="sortId != null">
sort_id = #{sortId,jdbcType=INTEGER},
</if>
<if test="orderBy != null">
order_by = #{orderBy,jdbcType=INTEGER},
</if>
<if test="unit != null">
unit = #{unit,jdbcType=VARCHAR},
</if>
<if test="boxView != null">
box_view = #{boxView,jdbcType=CHAR},
</if>
<if test="searchView != null">
search_view = #{searchView,jdbcType=CHAR},
</if>
<if test="parameterMake != null">
parameter_make = #{parameterMake,jdbcType=CHAR},
</if>
<if test="searchMake != null">
search_make = #{searchMake,jdbcType=CHAR},
</if>
<if test="searchOrderBy != null">
search_order_by = #{searchOrderBy,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="standardMap" type="java.util.Map">
<result column="parameter_id" property="parameterId" jdbcType="INTEGER" />
<result column="parameter_value" property="parameterValue"
jdbcType="VARCHAR" />
<result column="standard_id" property="standardId" jdbcType="INTEGER" />
<result column="standard_name" property="standardName"
jdbcType="VARCHAR" />
</resultMap>
<select id="selectStandardLists" resultMap="standardMap" timeout="20000">
<![CDATA[SELECT t.id AS parameter_id,t.`parameter_value`,t.`standard_id`,s.`standard_name`
FROM parameter_make t,standard s WHERE t.`standard_id`=s.id limit #{offset},#{pageSize}
]]>
</select>
<select id="selectStandardMapCount" resultType="java.lang.Integer"
timeout="20000">
SELECT count(1) FROM parameter_make t,standard s WHERE
t.`standard_id`=s.id
</select>
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from standard
</select>
</mapper>