|
|
@@ -106,6 +106,128 @@
|
|
|
<include refid="selectOperLogVo"/>
|
|
|
where oper_id = #{operId}
|
|
|
</select>
|
|
|
+ <select id="selectOperLogCalc" resultType="com.doc.system.domain.vo.LogCalcVO">
|
|
|
+ select
|
|
|
+ operator_type,
|
|
|
+ business_type,
|
|
|
+ oper_name,
|
|
|
+ oper_ip,
|
|
|
+ sum(1) times
|
|
|
+ from sys_oper_log
|
|
|
+ <where>
|
|
|
+ <if test="title != null and title != ''">
|
|
|
+ AND title like concat('%', #{title}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="eventType != null">
|
|
|
+ AND event_type = #{eventType}
|
|
|
+ </if>
|
|
|
+ <if test="eventLevel != null">
|
|
|
+ AND event_level = #{eventLevel}
|
|
|
+ </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 oper_time >= #{params.beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ AND oper_time <= #{params.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by event_type, business_type, oper_name, oper_ip
|
|
|
+ </select>
|
|
|
+ <select id="selectOperLogAnal" resultType="com.doc.system.domain.vo.LogAnalVO"></select>
|
|
|
+ <select id="selectTypeCalc" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ business_type,
|
|
|
+ sum(1) value
|
|
|
+ from sys_oper_log
|
|
|
+ <where>
|
|
|
+ <if test="title != null and title != ''">
|
|
|
+ AND title like concat('%', #{title}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="eventType != null">
|
|
|
+ AND event_type = #{eventType}
|
|
|
+ </if>
|
|
|
+ <if test="eventLevel != null">
|
|
|
+ AND event_level = #{eventLevel}
|
|
|
+ </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 oper_time >= #{params.beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ AND oper_time <= #{params.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by business_type
|
|
|
+ </select>
|
|
|
+ <select id="selectTimeCalc" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ DATE_FORMAT(oper_time, '%H') name,
|
|
|
+ sum(1) value
|
|
|
+ from sys_oper_log
|
|
|
+ <where>
|
|
|
+ <if test="title != null and title != ''">
|
|
|
+ AND title like concat('%', #{title}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="eventType != null">
|
|
|
+ AND event_type = #{eventType}
|
|
|
+ </if>
|
|
|
+ <if test="eventLevel != null">
|
|
|
+ AND event_level = #{eventLevel}
|
|
|
+ </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 oper_time >= #{params.beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ AND oper_time <= #{params.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by DATE_FORMAT(oper_time, '%H')
|
|
|
+ order by name
|
|
|
+ </select>
|
|
|
|
|
|
<update id="cleanOperLog">
|
|
|
truncate table sys_oper_log
|