SysLogMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~
  4. ~ Copyright (c) 2018-2025, lengleng All rights reserved.
  5. ~
  6. ~ Redistribution and use in source and binary forms, with or without
  7. ~ modification, are permitted provided that the following conditions are met:
  8. ~
  9. ~ Redistributions of source code must retain the above copyright notice,
  10. ~ this list of conditions and the following disclaimer.
  11. ~ Redistributions in binary form must reproduce the above copyright
  12. ~ notice, this list of conditions and the following disclaimer in the
  13. ~ documentation and/or other materials provided with the distribution.
  14. ~ Neither the name of the pig4cloud.com developer nor the names of its
  15. ~ contributors may be used to endorse or promote products derived from
  16. ~ this software without specific prior written permission.
  17. ~ Author: lengleng (wangiegie@gmail.com)
  18. ~
  19. -->
  20. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  21. <mapper namespace="com.pig4cloud.pigx.admin.mapper.SysLogMapper">
  22. <resultMap id="sysLogMap" type="com.pig4cloud.pigx.admin.api.entity.SysLog">
  23. <id property="id" column="id"/>
  24. <result property="type" column="type"/>
  25. <result property="title" column="title"/>
  26. <result property="serviceId" column="service_id"/>
  27. <result property="createBy" column="create_by"/>
  28. <result property="createTime" column="create_time"/>
  29. <result property="updateTime" column="update_time"/>
  30. <result property="remoteAddr" column="remote_addr"/>
  31. <result property="userAgent" column="user_agent"/>
  32. <result property="requestUri" column="request_uri"/>
  33. <result property="method" column="method"/>
  34. <result property="params" column="params"/>
  35. <result property="time" column="time"/>
  36. <result property="delFlag" column="del_flag"/>
  37. <result property="exception" column="exception"/>
  38. </resultMap>
  39. <!--sysLog简单分页查询-->
  40. <select id="getSysLogPage" resultMap="sysLogMap">
  41. SELECT
  42. id,
  43. type,
  44. title,
  45. service_id,
  46. create_by,
  47. create_time,
  48. update_time,
  49. remote_addr,
  50. user_agent,
  51. request_uri,
  52. method,
  53. params,
  54. time,
  55. del_flag,
  56. exception
  57. FROM sys_log
  58. <where>
  59. <if test="sysLog.id != null and sysLog.id.trim() != ''">
  60. AND id = #{sysLog.id}
  61. </if>
  62. <if test="sysLog.type != null and sysLog.type.trim() != ''">
  63. AND type = #{sysLog.type}
  64. </if>
  65. <if test="sysLog.title != null and sysLog.title.trim() != ''">
  66. AND title = #{sysLog.title}
  67. </if>
  68. <if test="sysLog.serviceId != null and sysLog.serviceId.trim() != ''">
  69. AND service_id = #{sysLog.serviceId}
  70. </if>
  71. <if test="sysLog.createBy != null and sysLog.createBy.trim() != ''">
  72. AND create_by = #{sysLog.createBy}
  73. </if>
  74. <if test="sysLog.createTime != null and sysLog.createTime.trim() != ''">
  75. AND create_time = #{sysLog.createTime}
  76. </if>
  77. <if test="sysLog.updateTime != null and sysLog.updateTime.trim() != ''">
  78. AND update_time = #{sysLog.updateTime}
  79. </if>
  80. <if test="sysLog.remoteAddr != null and sysLog.remoteAddr.trim() != ''">
  81. AND remote_addr LIKE CONCAT('%',#{sysLog.remoteAddr},'%')
  82. </if>
  83. <if test="sysLog.userAgent != null and sysLog.userAgent.trim() != ''">
  84. AND user_agent = #{sysLog.userAgent}
  85. </if>
  86. <if test="sysLog.requestUri != null and sysLog.requestUri.trim() != ''">
  87. AND request_uri LIKE CONCAT('%',#{sysLog.requestUri},'%')
  88. </if>
  89. <if test="sysLog.method != null and sysLog.method.trim() != ''">
  90. AND method = #{sysLog.method}
  91. </if>
  92. <if test="sysLog.params != null and sysLog.params.trim() != ''">
  93. AND params = #{sysLog.params}
  94. </if>
  95. <if test="sysLog.time != null and sysLog.time.trim() != ''">
  96. AND time = #{sysLog.time}
  97. </if>
  98. <if test="sysLog.delFlag != null and sysLog.delFlag.trim() != ''">
  99. AND del_flag = #{sysLog.delFlag}
  100. </if>
  101. <if test="sysLog.exception != null and sysLog.exception.trim() != ''">
  102. AND exception = #{sysLog.exception}
  103. </if>
  104. </where>
  105. </select>
  106. </mapper>