<?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.whyc.mapper.UserLogMapper" >
|
|
<resultMap id="Map_UserLog" type="UserLog">
|
<id property="num" column="num"/>
|
<result property="uId" column="uId"/>
|
<result property="operationType" column="uOprateType"/>
|
<result property="operationTime" column="uOprateDay"/>
|
<result property="terminalIp" column="uTerminalIp"/>
|
<result property="operationMsg" column="uOprateMsg"/>
|
<result property="operationDetail" column="operation_detail"/>
|
<result property="uName" column="uName"/>
|
</resultMap>
|
<select id="getList" resultMap="Map_UserLog">
|
select l.*,u.uName from db_user.tb_user_log l,db_user.tb_user_inf u
|
where l.uId = u.uId
|
and uOprateDay between #{operationTime} and #{operationTime2}
|
<if test="uId !=null">
|
and l.uId = #{uId}
|
</if>
|
<!--条件查询-非全部-->
|
<if test="eventType !=null">
|
<choose>
|
<!--系统级别(1)-->
|
<when test="eventType ==1">
|
<choose>
|
<when test="operationType ==1
|
or operationType ==2
|
or operationType ==20
|
or operationType ==21
|
">
|
<choose>
|
<!--登录包括普通登录和临时凭证ID登录-->
|
<when test="operationType ==1">
|
and uoprateType in (#{operationType},35)
|
</when>
|
<otherwise>
|
and uoprateType= #{operationType}
|
</otherwise>
|
</choose>
|
</when>
|
<when test="operationType ==31
|
or operationType ==32
|
or operationType ==33
|
or operationType ==34">
|
and uoprateType= #{operationType}
|
<choose>
|
<when test="operationType ==31">
|
or uOprateMsg regexp '登录PC系统失败'
|
</when>
|
<when test="operationType ==32">
|
or uOprateMsg regexp '配置参数修改|导航配置'
|
</when>
|
<when test="operationType ==33">
|
or uOprateMsg regexp '密码' and uOprateMsg not regexp '更新密码复杂度规则'
|
</when>
|
<otherwise>
|
or uOprateMsg regexp 'LoginAction!login|imeout'
|
</otherwise>
|
</choose>
|
</when>
|
<when test="operationType == 3 or operationType == 4 or operationType == 5">
|
and uoprateType= #{operationType}
|
and uOprateMsg regexp
|
'添加新用户|的用户信息|权限组|审计数据记录容量
|
|执行了User模块|执行了PermitGroup'
|
</when>
|
</choose>
|
</when>
|
<!--业务级别-机房(2)-->
|
<when test="eventType ==2">
|
and uoprateType= #{operationType}
|
and uOprateMsg regexp '单体|电池组|组端|设备|Batt|Dev|FBO|Fbs|Ld9|Li9130|Lithium|Station3D'
|
and uOprateMsg not regexp '电源|Pwrdev'
|
</when>
|
<!--业务级别-电源(3)-->
|
<when test="eventType ==3">
|
and uoprateType= #{operationType}
|
and uOprateMsg regexp 'PowerInf|Pwr'
|
</when>
|
<!--业务级别-其他(4)-->
|
<when test="eventType ==4">
|
and uoprateType= #{operationType}
|
and uOprateMsg not regexp '添加新用户|的用户信息|权限组|审计数据记录容量|配置参数修改|导航配置|密码|单体|电池组|组端|设备|电源|
|
|执行了User模块|执行了PermitGroup|
|
|Batt|Dev|FBO|Fbs|Ld9|Li9130|Lithium|Station3D|
|
|PowerInf|Pwr'
|
</when>
|
</choose>
|
</if>
|
ORDER BY uOprateDay DESC
|
</select>
|
</mapper>
|