1
- <?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
3
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
4
- <mapper namespace =" ${packageName}.dao.${classInfo.className}Dao" >
5
-
6
- <resultMap id =" BaseResultMap" type =" ${packageName}.entity.${classInfo.className}Entity " >
7
- <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
8
- <#list classInfo.fieldList as fieldItem >
9
- <result column =" ${fieldItem.columnName}" property =" ${fieldItem.fieldName}" />
10
- </#list >
11
- </#if >
12
- </resultMap >
13
-
14
- <sql id =" Base_Column_List" >
15
- <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
16
- <#list classInfo.fieldList as fieldItem >
17
- ${fieldItem.columnName} <#if fieldItem_has_next >,</#if >
18
- </#list >
19
- </#if >
20
- </sql >
21
-
22
- <insert id =" insert" useGeneratedKeys =" true" keyColumn =" id" keyProperty =" id" parameterType =" ${packageName}.entity.${classInfo.className}Entity " >
23
- INSERT INTO ${classInfo.tableName}
24
- <trim prefix =" (" suffix =" )" suffixOverrides =" ," >
25
- <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
26
- <#list classInfo.fieldList as fieldItem >
27
- <#if fieldItem.columnName != "id" >
28
- <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >
29
- ${fieldItem.columnName} <#if fieldItem_has_next >,</#if >
30
- ${r"</if >"}
31
- </#if >
32
- </#list >
33
- </#if >
34
- </trim >
35
- <trim prefix =" values (" suffix =" )" suffixOverrides =" ," >
36
- <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
37
- <#list classInfo.fieldList as fieldItem >
38
- <#if fieldItem.columnName != "id" >
39
- <#-- <#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" >
40
- ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
41
- NOW()<#if fieldItem_has_next>,</#if>
42
- ${r"</if>"}
43
- <#else>-->
44
- <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >
45
- ${r"#{"}${fieldItem.fieldName} ${r"}"}<#if fieldItem_has_next >,</#if >
46
- ${r"</if >"}
47
- <#-- </#if>-->
48
- </#if >
49
- </#list >
50
- </#if >
51
- </trim >
52
- </insert >
53
-
54
- <delete id =" delete" >
55
- DELETE FROM ${classInfo.tableName}
56
- WHERE id = ${r"#{id}"}
57
- </delete >
58
-
59
- <update id =" update" parameterType =" ${packageName}.entity.${classInfo.className}Entity " >
60
- UPDATE ${classInfo.tableName}
61
- <set >
62
- <#list classInfo.fieldList as fieldItem >
63
- <#if fieldItem.columnName != "id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" >
64
- <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName} ${r"}"}<#if fieldItem_has_next >,</#if >${r"</if >"}
65
- </#if >
66
- </#list >
67
- </set >
68
- WHERE id = ${r"#{"}id${r"}"}
69
- </update >
70
-
71
-
72
- <select id =" load" resultMap =" BaseResultMap" >
73
- SELECT <include refid =" Base_Column_List" />
74
- FROM ${classInfo.tableName}
75
- WHERE id = ${r"#{id}"}
76
- </select >
77
-
78
- <select id =" pageList" resultMap =" BaseResultMap" >
79
- SELECT <include refid =" Base_Column_List" />
80
- FROM ${classInfo.tableName}
81
- LIMIT ${r"#{offset}"}, ${r"#{pageSize}"}
82
- </select >
83
-
84
- <select id =" pageListCount" resultType =" java.lang.Integer" >
85
- SELECT count(1)
86
- FROM ${classInfo.tableName}
87
- </select >
88
-
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
3
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
4
+ <mapper namespace =" ${packageName}.dao.${classInfo.className}Dao" >
5
+
6
+ <resultMap id =" BaseResultMap" type =" ${packageName}.entity.${classInfo.className}" >
7
+ <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
8
+ <#list classInfo.fieldList as fieldItem >
9
+ <result column =" ${fieldItem.columnName}" property =" ${fieldItem.fieldName}" />
10
+ </#list >
11
+ </#if >
12
+ </resultMap >
13
+
14
+ <sql id =" Base_Column_List" >
15
+ <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
16
+ <#list classInfo.fieldList as fieldItem >
17
+ ${fieldItem.columnName} <#if fieldItem_has_next >,</#if >
18
+ </#list >
19
+ </#if >
20
+ </sql >
21
+
22
+ <insert id =" insert" useGeneratedKeys =" true" keyColumn =" id" keyProperty =" id" parameterType =" ${packageName}.entity.${classInfo.className}" >
23
+ INSERT INTO ${classInfo.tableName}
24
+ <trim prefix =" (" suffix =" )" suffixOverrides =" ," >
25
+ <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
26
+ <#list classInfo.fieldList as fieldItem >
27
+ <#if fieldItem.columnName != "id" >
28
+ <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >
29
+ ${fieldItem.columnName} <#if fieldItem_has_next >,</#if >
30
+ ${r"</if >"}
31
+ </#if >
32
+ </#list >
33
+ </#if >
34
+ </trim >
35
+ <trim prefix =" values (" suffix =" )" suffixOverrides =" ," >
36
+ <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0 >
37
+ <#list classInfo.fieldList as fieldItem >
38
+ <#if fieldItem.columnName != "id" >
39
+ <#-- <#if fieldItem.columnName="addtime" || fieldItem.columnName="updatetime" >
40
+ ${r"<if test ='null != "}${fieldItem.fieldName}${r"'>"}
41
+ NOW()<#if fieldItem_has_next>,</#if>
42
+ ${r"</if>"}
43
+ <#else>-->
44
+ <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >
45
+ ${r"#{"}${fieldItem.fieldName} ${r"}"}<#if fieldItem_has_next >,</#if >
46
+ ${r"</if >"}
47
+ <#-- </#if>-->
48
+ </#if >
49
+ </#list >
50
+ </#if >
51
+ </trim >
52
+ </insert >
53
+
54
+ <delete id =" delete" >
55
+ DELETE FROM ${classInfo.tableName}
56
+ WHERE id = ${r"#{id}"}
57
+ </delete >
58
+
59
+ <update id =" update" parameterType =" ${packageName}.entity.${classInfo.className}" >
60
+ UPDATE ${classInfo.tableName}
61
+ <set >
62
+ <#list classInfo.fieldList as fieldItem >
63
+ <#if fieldItem.columnName != "id" && fieldItem.columnName != "AddTime" && fieldItem.columnName != "UpdateTime" >
64
+ <if test =" null != ${fieldItem.fieldName} and '' != ${fieldItem.fieldName}" >${fieldItem.columnName} = ${r"#{"}${fieldItem.fieldName} ${r"}"}<#if fieldItem_has_next >,</#if >${r"</if >"}
65
+ </#if >
66
+ </#list >
67
+ </set >
68
+ WHERE id = ${r"#{"}id${r"}"}
69
+ </update >
70
+
71
+
72
+ <select id =" load" resultMap =" BaseResultMap" >
73
+ SELECT <include refid =" Base_Column_List" />
74
+ FROM ${classInfo.tableName}
75
+ WHERE id = ${r"#{id}"}
76
+ </select >
77
+
78
+ <select id =" pageList" resultMap =" BaseResultMap" >
79
+ SELECT <include refid =" Base_Column_List" />
80
+ FROM ${classInfo.tableName}
81
+ LIMIT ${r"#{offset}"}, ${r"#{pageSize}"}
82
+ </select >
83
+
84
+ <select id =" pageListCount" resultType =" java.lang.Integer" >
85
+ SELECT count(1)
86
+ FROM ${classInfo.tableName}
87
+ </select >
88
+
89
89
</mapper >
0 commit comments