DynamicRuleMapper.xml
2.21 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
<?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.DynamicRuleMapper">
<resultMap id="DynamicRuleResultMap" type="com.yoho.search.dal.model.DynamicRule">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="field" property="field" jdbcType="VARCHAR" />
<result column="field_values" property="fieldValues" jdbcType="VARCHAR" />
<result column="boost" property="boost" jdbcType="INTEGER" />
</resultMap>
<sql id="DynamicRule_Column_List">
id, name, status, type, field, field_values, boost
</sql>
<insert id="insert" parameterType="com.yoho.search.dal.model.DynamicRule">
insert ignore into dynamic_rule (id, name, status, type, field, field_values, boost)
values (#{id, jdbcType=INTEGER},
#{name, jdbcType=VARCHAR},
#{status, jdbcType=INTEGER},
#{type, jdbcType=INTEGER},
#{field, jdbcType=VARCHAR},
#{fieldValues, jdbcType=VARCHAR},
#{boost, jdbcType=INTEGER})
</insert>
<select id="selectById" resultMap="DynamicRuleResultMap" parameterType="java.lang.Integer">
select <include refid="DynamicRule_Column_List"/> from dynamic_rule where id = #{id, jdbcType=INTEGER}
</select>
<select id="selectByRuleIdList" resultMap="DynamicRuleResultMap">
select <include refid="DynamicRule_Column_List"/> from dynamic_rule where id in
<foreach item="item" index="index" collection="list" open="("
separator="," close=")">
#{item}
</foreach>
</select>
<update id="updateById" parameterType="com.yoho.search.dal.model.DynamicRule">
update dynamic_rule
set name = #{name,jdbcType=VARCHAR},
status = #{status, jdbcType=INTEGER},
type = #{type, jdbcType=INTEGER},
field = #{field,jdbcType=VARCHAR},
field_values = #{fieldValues,jdbcType=VARCHAR},
boost = #{boost, jdbcType=INTEGER}
where id = #{id, jdbcType=INTEGER}
</update>
<delete id="delete" parameterType="java.lang.Integer">
delete from dynamic_rule where id = #{id, jdbcType=INTEGER}
</delete>
</mapper>