谐波模块sql语句换成InfluxDBPublicParam

This commit is contained in:
陈超
2022-07-13 15:37:05 +08:00
parent 366bd2d44e
commit 784082ed05
7 changed files with 259 additions and 14 deletions

View File

@@ -0,0 +1,22 @@
package com.njcn.system.mapper;
import com.njcn.system.pojo.param.AuditParam;
import com.njcn.system.pojo.po.UserLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @version 1.0.0
* @author: chenchao
* @date: 2022/07/11 21:06
*/
public interface AuditMapper {
/**
* 获取审计日志列表
*/
List<UserLog> selectAuditLog(@Param("auditParam") AuditParam auditParam);
int getCount(@Param("auditParam") AuditParam auditParam);
}

View File

@@ -0,0 +1,45 @@
<?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.njcn.system.mapper.AuditMapper">
<select id="selectAuditLog" resultType="UserLog">
SELECT
id,
user_name userName,
ip,
operate,
operate_type operateType,
result,
level,
type,
service_name serviceName,
state,
create_by createBy,
create_time createTime,
update_by updateBy,
update_time updateTime
FROM
sys_user_log
WHERE update_time >= #{auditParam.searchBeginTime}
AND #{auditParam.searchEndTime} >= update_time
<!-- <if test="auditParam.userName!=null">-->
<!-- and update_by = #{auditParam.userName}-->
<!-- </if>-->
<!-- <if test="auditParam.type!=null">-->
<!-- and type = #{auditParam.type}-->
<!-- </if>-->
<!-- <if test="auditParam.operate!=null">-->
<!-- and operate_type = #{auditParam.operate}-->
<!-- </if>-->
AND id >= (select id from sys_user_log order by id limit #{auditParam.pageNum}, 1) limit #{auditParam.pageSize}
</select>
<select id="getCount" resultType="int">
SELECT count(id)
FROM sys_user_log
WHERE update_time >= #{auditParam.searchBeginTime}
AND #{auditParam.searchEndTime} >= update_time
</select>
</mapper>