-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathexample.html
More file actions
83 lines (81 loc) · 2.55 KB
/
example.html
File metadata and controls
83 lines (81 loc) · 2.55 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd">
<mapper>
<sql id="a">` and id != '' `</sql>
<insert id="insert">
`insert into activity`
<foreach collection="arg" index="key" item="item" open="(" close=")" separator=",">
<if test="key == 'id'">
<continue></continue>
</if>
${key}
</foreach>
` values `
<foreach collection="arg" index="key" item="item" open="(" close=")" separator=",">
<if test="key == 'id'">
<continue></continue>
</if>
${item.sql()}
</foreach>
</insert>
<select id="select_by_condition">
`select * from activity`
<where>
<if test="name != ''">
` and name like #{name}`
</if>
<if test="dt >= '2009-12-12 00:00:00'">
` and create_time < #{dt}`
</if>
<choose>
<when test="true">
` and id != '-1'`
</when>
<otherwise>and id != -2</otherwise>
</choose>
` and `
<trim prefixOverrides=" and">
` and name != '' `
</trim>
</where>
</select>
<select id="select_page_data">
`select * from activity `
<where>
<if test="name != ''">
` and name like #{name}`
</if>
<if test="dt >= '2009-12-12 00:00:00'">
` and create_time < #{dt}`
</if>
<choose>
<when test="true">
` and id != '-1'`
</when>
<otherwise>and id != -2</otherwise>
</choose>
` and `
<trim prefixOverrides=" and">
` and name != '' `
</trim>
</where>
</select>
<update id="update_by_id">
` update activity `
<set collection="arg"></set>
` where id = #{id} `
</update>
<!-- Paginated query - automatically detected by return type Page<Activity> -->
<select id="select_by_page">
`select * from activity`
<where>
<if test="name != ''">
` and name like #{name}`
</if>
<if test="dt != null">
` and create_time < #{dt}`
</if>
</where>
<!-- PageIntercept will add limit/offset automatically -->
</select>
</mapper>