PromotionParamsMapper.xml
2.87 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
<?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.PromotionParamsMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.PromotionParams">
<id column="promotion_id" property="promotionId" jdbcType="INTEGER"/>
<result column="condition_param" property="conditionParam" jdbcType="VARCHAR"/>
<result column="is_del" property="isDel" jdbcType="VARCHAR"/>
<result column="promotion_type" property="promotionType" jdbcType="VARCHAR"/>
<result column="action_param" property="actionParam" jdbcType="VARCHAR"/>
<result column="reject_param" property="rejectParam" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
promotion_id, condition_param, is_del ,promotion_type,action_param,reject_param
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from promotion_params
where promotion_id = #{id,jdbcType=INTEGER}
limit 1
</select>
<select id="selectByPromotionIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from promotion_params where promotion_id in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from promotion_params where promotion_id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.PromotionParams">
insert into promotion_params (promotion_id, condition_param, is_del,promotion_type,action_param,reject_param)
values (#{promotionId,jdbcType=INTEGER},
#{conditionParam,jdbcType=VARCHAR},
#{isDel,jdbcType=VARCHAR},
#{promotionType,jdbcType=VARCHAR},
#{actionParam,jdbcType=VARCHAR},
#{rejectParam,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.PromotionParams">
update promotion_params
set condition_param = #{conditionParam,jdbcType=VARCHAR},
is_del = #{isDel,jdbcType=VARCHAR},
promotion_type= #{promotionType,jdbcType=VARCHAR},
action_param= #{actionParam,jdbcType=VARCHAR},
reject_param= #{rejectParam,jdbcType=VARCHAR}
where promotion_id = #{promotionId,jdbcType=INTEGER}
</update>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from promotion_params where promotion_id in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>