NoticeRuleMapper.xml
3.56 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
<?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.yohoufo.dal.order.NoticeRuleMapper">
<resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.NoticeRule">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="case_id" jdbcType="INTEGER" property="caseId" />
<result column="method" jdbcType="SMALLINT" property="method" />
<result column="quantity" jdbcType="INTEGER" property="quantity" />
<result column="time_unit_region" jdbcType="INTEGER" property="timeUnitRegion" />
<result column="time_unit" jdbcType="SMALLINT" property="timeUnit" />
</resultMap>
<sql id="Base_Column_List">
id, case_id, method, quantity, time_unit_region, time_unit
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from notice_rule
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.NoticeRule" useGeneratedKeys="true">
insert into notice_rule (case_id, method, quantity,
time_unit_region, time_unit)
values (#{caseId,jdbcType=INTEGER}, #{method,jdbcType=SMALLINT}, #{quantity,jdbcType=INTEGER},
#{timeUnitRegion,jdbcType=INTEGER}, #{timeUnit,jdbcType=SMALLINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.NoticeRule" useGeneratedKeys="true">
insert into notice_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseId != null">
case_id,
</if>
<if test="method != null">
method,
</if>
<if test="quantity != null">
quantity,
</if>
<if test="timeUnitRegion != null">
time_unit_region,
</if>
<if test="timeUnit != null">
time_unit,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseId != null">
#{caseId,jdbcType=INTEGER},
</if>
<if test="method != null">
#{method,jdbcType=SMALLINT},
</if>
<if test="quantity != null">
#{quantity,jdbcType=INTEGER},
</if>
<if test="timeUnitRegion != null">
#{timeUnitRegion,jdbcType=INTEGER},
</if>
<if test="timeUnit != null">
#{timeUnit,jdbcType=SMALLINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.order.model.NoticeRule">
update notice_rule
<set>
<if test="caseId != null">
case_id = #{caseId,jdbcType=INTEGER},
</if>
<if test="method != null">
method = #{method,jdbcType=SMALLINT},
</if>
<if test="quantity != null">
quantity = #{quantity,jdbcType=INTEGER},
</if>
<if test="timeUnitRegion != null">
time_unit_region = #{timeUnitRegion,jdbcType=INTEGER},
</if>
<if test="timeUnit != null">
time_unit = #{timeUnit,jdbcType=SMALLINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.NoticeRule">
update notice_rule
set case_id = #{caseId,jdbcType=INTEGER},
method = #{method,jdbcType=SMALLINT},
quantity = #{quantity,jdbcType=INTEGER},
time_unit_region = #{timeUnitRegion,jdbcType=INTEGER},
time_unit = #{timeUnit,jdbcType=SMALLINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>