提交 | 用户 | 时间
|
71e81e
|
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.rest.mapper.RestOperationLogMapper"> |
|
4 |
|
|
5 |
<!-- 通用查询映射结果 --> |
|
6 |
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.sys.modular.rest.entity.RestOperationLog"> |
|
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="oracle"> |
|
39 |
select |
|
40 |
<include refid="Base_Column_List"/> |
|
41 |
from sys_operation_log where 1 = 1 |
|
42 |
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> |
|
43 |
and create_time >= to_date(#{beginTime}||'00:00:00','yyyy-mm-dd hh24:mi:ss') |
|
44 |
and create_time <= to_date(#{endTime}||'23:59:59','yyyy-mm-dd hh24:mi:ss') |
|
45 |
</if> |
|
46 |
<if test="logName != null and logName !=''"> |
|
47 |
and log_name like '%' || #{logName} || '%' |
|
48 |
</if> |
|
49 |
<if test="logType != null and logType !=''"> |
|
50 |
and log_type like '%' || #{logType} || '%' |
|
51 |
</if> |
|
52 |
</select> |
|
53 |
|
|
54 |
</mapper> |