FolderLog.xml
4.84 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?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.cloudstore.dev.api.mapper.FolderLogMapper">
<select id="listMysql" resultMap="resultMap1">
select
log.*,
concat(concat(log.modifydate, ' '), log.modifytime) as modTime
from cloudstore_folderversion log
where 1=1
<if test="folder.objecttype != null and folder.objecttype != ''">
and log.objecttype = #{folder.objecttype}
</if>
<if test="folder.folderid != null and folder.folderid != ''">
and log.folderid = #{folder.folderid}
</if>
<if test="folder.operatetype != null and folder.operatetype != ''">
and log.operatetype = #{folder.operatetype}
</if>
<if test="folder.modifydate != null and folder.modifydate != ''">
and log.modifydate >= #{folder.createdate} and log.modifydate <= #{folder.modifydate}
</if>
order by log.modifydate desc,log.modifytime desc,log.id desc
limit #{pageNum},#{pageSize}
</select>
<resultMap id="resultMap1" type="com.cloudstore.dev.bean.ReleaseLog">
<id column="id" property="id"></id>
<id column="parentid" property="parentId"></id>
<id column="userid" property="userid"></id>
<id column="folderid" property="folderId"></id>
<id column="datakey" property="dataKey"></id>
<id column="objecttype" property="objectType"></id>
<id column="operatetype" property="operateType"></id>
<id column="originname" property="originName"></id>
<id column="newname" property="newName"></id>
<id column="origincontent" property="originContent"></id>
<id column="newcontent" property="newContent"></id>
<id column="version" property="version"></id>
<id column="lastversion" property="lastVersion"></id>
<id column="status" property="status"></id>
<id column="modTime" property="modTime"></id>
</resultMap>
<select id="listOracle" resultMap="resultMap1">
select * from (
select data.*, ROWNUM as rowno from (
select
log.*,
concat(concat(log.modifydate, ' '), log.modifytime) as modTime
from cloudstore_folderversion log
where 1=1
<if test="folder.objecttype != null and folder.objecttype != ''">
and log.objecttype = #{folder.objecttype}
</if>
<if test="folder.folderid != null and folder.folderid != ''">
and log.folderid = #{folder.folderid}
</if>
<if test="folder.operatetype != null and folder.operatetype != ''">
and log.operatetype = #{folder.operatetype}
</if>
<if test="folder.modifydate != null and folder.modifydate != ''">
and log.modifydate >= #{folder.createdate} and log.modifydate <= #{folder.modifydate}
</if>
) data
) temp
where temp.rowno between #{pageNum} and #{pageSize}
order by modifydate desc,modifytime desc,id desc
</select>
<select id="listSqlServer" resultMap="resultMap1">
select * from (
select top #{pageNum} row_number() over
( ORDER BY log.modifydate desc,log.modifytime DESC ) as rownum,
log.*,
log.modifydate + ' ' + log.modifytime as modTime
from cloudstore_folderversion log
where 1=1
<if test="folder.objecttype != null and folder.objecttype != ''">
and log.objecttype = #{folder.objecttype}
</if>
<if test="folder.folderid != null and folder.folderid != ''">
and log.folderid = #{folder.folderid}
</if>
<if test="folder.operatetype != null and folder.operatetype != ''">
and log.operatetype = #{folder.operatetype}
</if>
<if test="folder.modifydate != null and folder.modifydate != ''">
and log.modifydate >= #{folder.createdate} and log.modifydate <= #{folder.modifydate}
</if>
) as temp
where temp.rownum > #{pageSize}
</select>
<select id="count" resultType="int">
select
count(1)
from cloudstore_folderversion log
where 1=1
<if test="folder.objecttype != null and folder.objecttype != ''">
and log.objecttype = #{folder.objecttype}
</if>
<if test="folder.folderid != null and folder.folderid != ''">
and log.folderid = #{folder.folderid}
</if>
<if test="folder.operatetype != null and folder.operatetype != ''">
and log.operatetype = #{folder.operatetype}
</if>
<if test="folder.modifydate != null and folder.modifydate != ''">
and log.modifydate >= #{folder.createdate} and log.modifydate <= #{folder.modifydate}
</if>
</select>
</mapper>