提交 | 用户 | 时间
|
1ac2bc
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
懒 |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
3 |
<mapper namespace="cn.stylefeng.guns.sys.modular.system.mapper.OperationLogMapper"> |
|
4 |
|
|
5 |
<!-- 通用查询映射结果 --> |
|
6 |
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.sys.modular.system.entity.OperationLog"> |
|
7 |
<id column="operation_log_id" property="operationLogId" /> |
|
8 |
<result column="log_type" property="logType" /> |
|
9 |
<result column="log_name" property="logName" /> |
|
10 |
<result column="user_id" property="userId" /> |
|
11 |
<result column="class_name" property="className" /> |
|
12 |
<result column="method" property="method" /> |
|
13 |
<result column="create_time" property="createTime" /> |
|
14 |
<result column="succeed" property="succeed" /> |
|
15 |
<result column="message" property="message" /> |
|
16 |
</resultMap> |
|
17 |
|
|
18 |
<!-- 通用查询结果列 --> |
|
19 |
<sql id="Base_Column_List"> |
|
20 |
operation_log_id AS "operationLogId", log_type AS "logType", log_name AS "logName", user_id AS "userId", class_name AS "className", method AS "method", create_time AS "createTime", succeed AS "succeed", message AS "message" |
|
21 |
</sql> |
|
22 |
|
|
23 |
<select id="getOperationLogs" resultType="map"> |
|
24 |
select |
|
25 |
<include refid="Base_Column_List"/> |
|
26 |
from sys_operation_log where 1 = 1 |
|
27 |
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> |
|
28 |
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
|
29 |
</if> |
|
30 |
<if test="logName != null and logName !=''"> |
|
31 |
and log_name like CONCAT('%',#{logName},'%') |
|
32 |
</if> |
|
33 |
<if test="logType != null and logType !=''"> |
|
34 |
and log_type like CONCAT('%',#{logType},'%') |
|
35 |
</if> |
|
36 |
</select> |
|
37 |
|
|
38 |
<select id="getOperationLogs" resultType="map" databaseId="pgsql"> |
|
39 |
select |
|
40 |
<include refid="Base_Column_List"/> |
|
41 |
from sys_operation_log where 1 = 1 |
|
42 |
<if test="beginTime != null and beginTime !='' "> |
|
43 |
and create_time >= to_timestamp(#{beginTime}||' 00:00:00','yyyy-mm-dd hh24:mi:ss') |
|
44 |
</if> |
|
45 |
<if test="endTime != null and endTime != '' "> |
|
46 |
and create_time <= to_timestamp(#{endTime}||' 23:59:59','yyyy-mm-dd hh24:mi:ss') |
|
47 |
</if> |
|
48 |
<if test="logName != null and logName !=''"> |
|
49 |
and log_name like '%' || #{logName} || '%' |
|
50 |
</if> |
|
51 |
<if test="logType != null and logType !=''"> |
|
52 |
and log_type like '%' || #{logType} || '%' |
|
53 |
</if> |
|
54 |
</select> |
|
55 |
|
|
56 |
<select id="getOperationLogs" resultType="map" databaseId="oracle"> |
|
57 |
select |
|
58 |
<include refid="Base_Column_List"/> |
|
59 |
from sys_operation_log where 1 = 1 |
|
60 |
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> |
|
61 |
and create_time >= to_date(#{beginTime}||' 00:00:00','yyyy-mm-dd hh24:mi:ss') |
|
62 |
and create_time <= to_date(#{endTime}||' 23:59:59','yyyy-mm-dd hh24:mi:ss') |
|
63 |
</if> |
|
64 |
<if test="logName != null and logName !=''"> |
|
65 |
and log_name like '%' || #{logName} || '%' |
|
66 |
</if> |
|
67 |
<if test="logType != null and logType !=''"> |
|
68 |
and log_type like '%' || #{logType} || '%' |
|
69 |
</if> |
|
70 |
</select> |
|
71 |
|
|
72 |
</mapper> |