抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

通用性比较好的增改查

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
<select id="selectCarByPage" parameterType="com.thok.myoa.entity.Car" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from car
where dr=0
<if test="numbers != null">
AND numbers = #{numbers,jdbcType=VARCHAR}
</if>
<if test="name != null">
AND name = #{name,jdbcType=VARCHAR}
</if>
<if test="departments != null">
AND departments = #{departments,jdbcType=VARCHAR}
</if>
<if test="seating != null">
AND seating = #{seating,jdbcType=TINYINT}
</if>
<if test="parking != null">
AND parking = #{parking,jdbcType=VARCHAR}
</if>
<if test="registrar != null">
AND registrar = #{registrar,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
AND create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="mark != null">
AND mark = #{mark,jdbcType=VARCHAR}
</if>
limit #{start,jdbcType=INTEGER},#{pageSize,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.thok.myoa.entity.Car">
insert into car
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="numbers != null">
numbers,
</if>
<if test="departments != null">
departments,
</if>
<if test="seating != null">
seating,
</if>
<if test="parking != null">
parking,
</if>
<if test="registrar != null">
registrar,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="mark != null">
mark,
</if>
<if test="dr != null">
dr,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="numbers != null">
#{numbers,jdbcType=VARCHAR},
</if>
<if test="departments != null">
#{departments,jdbcType=VARCHAR},
</if>
<if test="seating != null">
#{seating,jdbcType=TINYINT},
</if>
<if test="parking != null">
#{parking,jdbcType=VARCHAR},
</if>
<if test="registrar != null">
#{registrar,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{create_time,jdbcType=TIMESTAMP},
</if>
<if test="mark != null">
#{mark,jdbcType=VARCHAR},
</if>
<if test="dr != null">
#{dr,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="update" parameterType="com.thok.myoa.entity.Car">
update car
<set>
<if test="numbers != null">
numbers = #{numbers,jdbcType=VARCHAR},
</if>
<if test="departments != null">
departments = #{departments,jdbcType=VARCHAR},
</if>
<if test="seating != null">
seating = #{seating,jdbcType=TINYINT},
</if>
<if test="parking != null">
parking = #{parking,jdbcType=VARCHAR},
</if>
<if test="registrar != null">
registrar = #{registrar,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="mark != null">
mark = #{mark,jdbcType=VARCHAR},
</if>
<if test="dr != null">
dr = #{dr,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>

评论