|
@@ -0,0 +1,128 @@
|
|
|
+<?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.css.simulation.resource.log.mapper.LogMapper" >
|
|
|
+
|
|
|
+ <insert id="insertOperationLog" parameterType="api.common.pojo.po.log.LogOperationPO">
|
|
|
+ INSERT INTO log_operation (
|
|
|
+ id,
|
|
|
+ user_id,
|
|
|
+ username,
|
|
|
+ ip,
|
|
|
+ module,
|
|
|
+ operationType,
|
|
|
+ create_time)
|
|
|
+ VALUES(
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ #{userId,jdbcType=VARCHAR},
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
+ #{ip,jdbcType=VARCHAR},
|
|
|
+ #{module,jdbcType=VARCHAR},
|
|
|
+ #{operationType,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="getLoginLogPageList" parameterType="api.common.pojo.param.log.LogPageParam" resultType="api.common.pojo.po.log.LogLoginPO">
|
|
|
+ SELECT
|
|
|
+ user_id,
|
|
|
+ username,
|
|
|
+ ip,
|
|
|
+ state,
|
|
|
+ create_time
|
|
|
+ FROM log_login
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="createTimeBegin != null">
|
|
|
+ and create_time >= #{createTimeBegin,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="createTimeEnd != null">
|
|
|
+ and create_time <= #{createTimeEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getOperationLogPageList" parameterType="api.common.pojo.param.log.LogPageParam" resultType="api.common.pojo.po.log.LogOperationPO">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ user_id,
|
|
|
+ username,
|
|
|
+ ip,
|
|
|
+ module,
|
|
|
+ operationType,
|
|
|
+ create_time
|
|
|
+ FROM log_operation
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="module != null and module != ''">
|
|
|
+ and module = #{module,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="operationType != null and operationType != ''">
|
|
|
+ and operation_type = #{operationType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="createTimeBegin != null">
|
|
|
+ and create_time >= #{createTimeBegin,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="createTimeEnd != null">
|
|
|
+ and create_time <= #{createTimeEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getSystemLogPageList" parameterType="api.common.pojo.param.log.LogPageParam" resultType="api.common.pojo.po.log.LogSystemPO">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ user_id,
|
|
|
+ username,
|
|
|
+ role_code,
|
|
|
+ module,
|
|
|
+ operation_type,
|
|
|
+ content,
|
|
|
+ create_time
|
|
|
+ FROM log_system
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="module != null and module != ''">
|
|
|
+ and module = #{module,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="operationType != null and operationType != ''">
|
|
|
+ and operation_type = #{operationType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content like CONCAT('%',#{content,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="createTimeBegin != null">
|
|
|
+ and create_time >= #{createTimeBegin,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="createTimeEnd != null">
|
|
|
+ and create_time <= #{createTimeEnd,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSystemLog" parameterType="api.common.pojo.po.log.LogSystemPO">
|
|
|
+ INSERT INTO log_system(
|
|
|
+ id,
|
|
|
+ user_id,
|
|
|
+ username,
|
|
|
+ role_code,
|
|
|
+ module,
|
|
|
+ operation_type,
|
|
|
+ content,
|
|
|
+ create_time
|
|
|
+ )VALUES(
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ #{userId,jdbcType=VARCHAR},
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
+ #{roleCode,jdbcType=VARCHAR},
|
|
|
+ #{module,jdbcType=VARCHAR},
|
|
|
+ #{operationType,jdbcType=VARCHAR},
|
|
|
+ #{content,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+</mapper>
|