223 lines
8.8 KiB
XML
223 lines
8.8 KiB
XML
<?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.mosty.operation.log.mapper.SysOperLogMapper">
|
|
<resultMap type="com.mosty.common.base.entity.log.SysOperLog" id="SysOperLogResult">
|
|
<id property="operId" column="oper_id"/>
|
|
<result property="title" column="title"/>
|
|
<result property="mkmc" column="mkmc"/>
|
|
<result property="businessType" column="business_type"/>
|
|
<result property="method" column="method"/>
|
|
<result property="requestMethod" column="request_method"/>
|
|
<result property="operatorType" column="operator_type"/>
|
|
<result property="operUserId" column="oper_user_id"/>
|
|
<result property="operSfzh" column="oper_sfzh"/>
|
|
<result property="operName" column="oper_name"/>
|
|
<result property="ssbmid" column="ssbmid"/>
|
|
<result property="ssbmdm" column="ssbmdm"/>
|
|
<result property="ssbm" column="ssbm"/>
|
|
<result property="operUrl" column="oper_url"/>
|
|
<result property="operIp" column="oper_ip"/>
|
|
<result property="operParam" column="oper_param"/>
|
|
<result property="jsonResult" column="json_result"/>
|
|
<result property="status" column="status"/>
|
|
<result property="errorMsg" column="error_msg"/>
|
|
<result property="operTime" column="oper_time"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectOperLogVo">
|
|
select *
|
|
from sys_oper_log
|
|
</sql>
|
|
|
|
<insert id="insertOperlog" parameterType="com.mosty.common.base.entity.log.SysOperLog">
|
|
insert into sys_oper_log(mkmc, title, business_type, method, request_method, operator_type, oper_name,
|
|
ssbm, oper_user_id, oper_sfzh, ssbmid, ssbmdm,
|
|
oper_url, oper_ip, oper_param, json_result, status, error_msg,
|
|
oper_time)
|
|
values (#{mkmc}, #{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName},
|
|
#{ssbm}, #{operUserId}, #{operSfzh}, #{ssbmid}, #{ssbmdm},
|
|
#{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status},
|
|
#{errorMsg}, sysdate())
|
|
</insert>
|
|
|
|
<select id="selectOperLogList" parameterType="com.mosty.common.base.entity.log.SysOperLog"
|
|
resultMap="SysOperLogResult">
|
|
<include refid="selectOperLogVo"/>
|
|
<where>
|
|
<if test="title != null and title != ''">
|
|
AND title like concat('%', #{title}, '%')
|
|
</if>
|
|
<if test="businessType != null">
|
|
AND business_type = #{businessType}
|
|
</if>
|
|
<if test="businessTypes != null and businessTypes.length > 0">
|
|
AND business_type in
|
|
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
|
#{businessType}
|
|
</foreach>
|
|
</if>
|
|
<if test="status != null">
|
|
AND status = #{status}
|
|
</if>
|
|
<if test="operName != null and operName != ''">
|
|
AND oper_name like concat('%', #{operName}, '%')
|
|
</if>
|
|
<if test="params.beginTime != null and params.beginTime != ''">
|
|
<!-- 开始时间检索 -->
|
|
and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
</if>
|
|
<if test="params.endTime != null and params.endTime != ''">
|
|
<!-- 结束时间检索 -->
|
|
and date_format(oper_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<delete id="deleteOperLogByIds" parameterType="String">
|
|
delete from sys_oper_log where oper_id in
|
|
<foreach collection="array" item="operId" open="(" separator="," close=")">
|
|
#{operId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
|
<include refid="selectOperLogVo"/>
|
|
where oper_id = #{operId}
|
|
</select>
|
|
|
|
<update id="cleanOperLog">
|
|
truncate table sys_oper_log
|
|
</update>
|
|
|
|
<select id="getSycs" resultType="int">
|
|
select count(1) from sys_oper_log where 1 = 1
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
and status = #{status}
|
|
</if>
|
|
${useSql}
|
|
</select>
|
|
|
|
<select id="getFwrs" resultType="int">
|
|
select count(DISTINCT oper_user_id) from sys_oper_log where 1 = 1
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${useSql}
|
|
</select>
|
|
|
|
<select id="bmStatistics" resultType="java.util.Map">
|
|
select count,ssbmid,ssbmdm,ssbm,IfNULL(pass,0) pass,IfNULL(noPass,0) noPass from (
|
|
select count(1) count,a.ssbmid,a.ssbmdm,a.ssbm,
|
|
(select count(1) from sys_oper_log b where status = '0' and a.ssbmid = b.ssbmid
|
|
and b.ssbmid is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by ssbmid) pass,
|
|
(select count(1) from sys_oper_log b where status = '1' and a.ssbmid = b.ssbmid
|
|
and b.ssbmid is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by ssbmid) noPass
|
|
from sys_oper_log a where a.ssbmid is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${aUseSql}
|
|
group by a.ssbmid,a.ssbmdm,a.ssbm order by count(1) desc limit 10
|
|
) ta
|
|
</select>
|
|
|
|
<select id="ryStatistics" resultType="java.util.Map">
|
|
select count,oper_name,ssbm,IfNULL(pass,0) pass,IfNULL(noPass,0) noPass from (
|
|
select count(1) count,a.oper_name,a.ssbm,
|
|
(select count(1) from sys_oper_log b where status = '0' and a.oper_user_id = b.oper_user_id
|
|
and b.oper_user_id is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by oper_user_id) pass,
|
|
(select count(1) from sys_oper_log b where status = '1' and a.oper_user_id = b.oper_user_id
|
|
and b.oper_user_id is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by oper_user_id) noPass
|
|
from sys_oper_log a where a.oper_user_id is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${aUseSql}
|
|
group by a.oper_name,a.ssbm order by count(1) desc limit 10
|
|
) ta
|
|
</select>
|
|
|
|
<select id="mkStatistics" resultType="java.util.Map">
|
|
select count,mkmc,IfNULL(pass,0) pass,IfNULL(noPass,0) noPass from (
|
|
select count(1) count,a.mkmc,
|
|
(select count(1) from sys_oper_log b where status = '0' and a.mkmc = b.mkmc
|
|
and b.mkmc is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by mkmc) pass,
|
|
(select count(1) from sys_oper_log b where status = '1' and a.mkmc = b.mkmc
|
|
and b.mkmc is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${bUseSql}
|
|
group by mkmc) noPass
|
|
from sys_oper_log a where a.mkmc is not null
|
|
<if test="kssj != null and kssj != ''">
|
|
and oper_time >= #{kssj}
|
|
</if>
|
|
<if test="jssj != null and jssj != ''">
|
|
and oper_time <= #{jssj}
|
|
</if>
|
|
${aUseSql}
|
|
group by a.mkmc order by count(1) desc
|
|
) ta
|
|
</select>
|
|
</mapper> |