SysLogsMapper.xml
1.87 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
<?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.hotent.sys.persistence.dao.SysLogsDao">
<resultMap id="SysLogs" type="com.hotent.sys.persistence.model.SysLogs">
<id property="id" column="ID_" jdbcType="VARCHAR"/>
<result property="opeName" column="OPE_NAME_" jdbcType="VARCHAR"/>
<result property="executionTime" column="EXECUTION_TIME_" jdbcType="TIMESTAMP"/>
<result property="executor" column="EXECUTOR_" jdbcType="VARCHAR"/>
<result property="ip" column="IP_" jdbcType="VARCHAR"/>
<result property="logType" column="LOG_TYPE_" jdbcType="VARCHAR"/>
<result property="moduleType" column="MODULE_TYPE_" jdbcType="VARCHAR"/>
<result property="reqUrl" column="REQ_URL_" jdbcType="VARCHAR"/>
<result property="opeContent" column="OPE_CONTENT_" jdbcType="LONGVARCHAR"/>
<result property="systemType" column="SYSTEM_TYPE_" jdbcType="VARCHAR"/>
<result property="elapsedTime" column="ELAPSED_TIME_" jdbcType="NUMERIC"/>
</resultMap>
<delete id="removeByEexcutionTime" parameterType="java.util.List">
DELETE FROM portal_sys_logs
<where>
1=0
<foreach collection="params" item="param" separator="or" open="or">
MODULE_TYPE_ = #{param.moduleType} and EXECUTION_TIME_ < #{param.executionTime,jdbcType=TIMESTAMP}
</foreach>
</where>
</delete>
<!-- 覆盖mybatis-plus 默认查询的sql 默认查询所有字段 但是有大文本字段不需要查询出来 数据量大的时候超级性能分页查询 -->
<select id="selectPage" resultMap="SysLogs">
SELECT ID_, OPE_NAME_, EXECUTION_TIME_,EXECUTOR_,IP_, LOG_TYPE_, MODULE_TYPE_, REQ_URL_ ,SYSTEM_TYPE_,ELAPSED_TIME_ FROM portal_sys_logs ${ew.customSqlSegment}
</select>
<select id="getLogTypes" resultType="String">
select DISTINCT LOG_TYPE_ from portal_sys_logs;
</select>
</mapper>