ProxyOperLogMapper.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.fs.proxy.mapper.ProxyOperLogMapper">
  6. <resultMap id="ProxyOperLogResult" type="com.fs.proxy.domain.ProxyOperLog">
  7. <id property="operId" column="oper_id"/>
  8. <result property="proxyId" column="proxy_id"/>
  9. <result property="proxyName" column="proxy_name"/>
  10. <result property="title" column="title"/>
  11. <result property="businessType" column="business_type"/>
  12. <result property="method" column="method"/>
  13. <result property="requestMethod" column="request_method"/>
  14. <result property="operatorType" column="operator_type"/>
  15. <result property="operName" column="oper_name"/>
  16. <result property="deptName" column="dept_name"/>
  17. <result property="operUrl" column="oper_url"/>
  18. <result property="operIp" column="oper_ip"/>
  19. <result property="operLocation" column="oper_location"/>
  20. <result property="operParam" column="oper_param"/>
  21. <result property="jsonResult" column="json_result"/>
  22. <result property="status" column="status"/>
  23. <result property="errorMsg" column="error_msg"/>
  24. <result property="operTime" column="oper_time"/>
  25. </resultMap>
  26. <insert id="insertProxyOperLog" useGeneratedKeys="true" keyProperty="operId">
  27. insert into proxy_oper_log(proxy_id, title, business_type, method, request_method,
  28. operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location,
  29. oper_param, json_result, status, error_msg, oper_time)
  30. values(#{proxyId}, #{title}, #{businessType}, #{method}, #{requestMethod},
  31. #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation},
  32. #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{operTime})
  33. </insert>
  34. <select id="selectProxyOperLogList" resultMap="ProxyOperLogResult">
  35. select ol.*, p.proxy_name as proxy_name
  36. from proxy_oper_log ol
  37. left join proxy p on p.proxy_id = ol.proxy_id
  38. <where>
  39. <if test="proxyId != null">and ol.proxy_id = #{proxyId}</if>
  40. <if test="title != null and title != ''">and ol.title like concat('%', #{title}, '%')</if>
  41. <if test="operName != null and operName != ''">and ol.oper_name like concat('%', #{operName}, '%')</if>
  42. <if test="status != null">and ol.status = #{status}</if>
  43. <if test="beginTime != null and beginTime != ''">and ol.oper_time &gt;= #{beginTime}</if>
  44. <if test="endTime != null and endTime != ''">and ol.oper_time &lt;= #{endTime}</if>
  45. </where>
  46. order by ol.oper_time desc
  47. </select>
  48. <select id="selectProxyOperLogById" resultMap="ProxyOperLogResult">
  49. select ol.*, p.proxy_name as proxy_name from proxy_oper_log ol
  50. left join proxy p on p.proxy_id = ol.proxy_id
  51. where ol.oper_id = #{operId}
  52. </select>
  53. <delete id="deleteProxyOperLogByIds">
  54. delete from proxy_oper_log where oper_id in
  55. <foreach collection="array" item="operId" open="(" separator="," close=")">#{operId}</foreach>
  56. </delete>
  57. <delete id="deleteProxyOperLogById">delete from proxy_oper_log where oper_id = #{operId}</delete>
  58. </mapper>