OperLogMapper.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.monitor.operlog.mapper.OperLogMapper">
  6. <resultMap type="OperLog" id="OperLogResult">
  7. <id property="operId" column="oper_id" />
  8. <result property="title" column="title" />
  9. <result property="action" column="action" />
  10. <result property="method" column="method" />
  11. <result property="channel" column="channel" />
  12. <result property="loginName" column="login_name" />
  13. <result property="deptName" column="dept_name" />
  14. <result property="operUrl" column="oper_url" />
  15. <result property="operIp" column="oper_ip" />
  16. <result property="operParam" column="oper_param" />
  17. <result property="status" column="status" />
  18. <result property="errorMsg" column="error_msg" />
  19. <result property="operTime" column="oper_time" />
  20. </resultMap>
  21. <insert id="insertOperlog" parameterType="OperLog">
  22. insert into sys_oper_log(title, action, method, channel, login_name, dept_name, oper_url, oper_ip, oper_param, status, error_msg, oper_time)
  23. values (#{title}, #{action}, #{method}, #{channel}, #{loginName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{status}, #{errorMsg}, sysdate())
  24. </insert>
  25. <select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
  26. select * from sys_oper_log
  27. <where>
  28. <if test="searchValue != null and searchValue != ''">
  29. AND login_name like concat(concat('%', #{searchValue}), '%')
  30. </if>
  31. </where>
  32. </select>
  33. <delete id="batchDeleteOperLog" parameterType="Integer">
  34. delete from sys_oper_log where oper_id in
  35. <foreach collection="array" item="operId" open="(" separator="," close=")">
  36. #{operId}
  37. </foreach>
  38. </delete>
  39. <select id="selectOperLogById" parameterType="Long" resultMap="OperLogResult">
  40. select *
  41. from sys_oper_log
  42. where oper_id = #{operId}
  43. </select>
  44. </mapper>