You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.7 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gaotao.modules.sys.dao.InterfaceLogDao">
  4. <!-- 查询接口日志列表 -->
  5. <select id="queryList" resultType="map">
  6. SELECT
  7. id,
  8. site,
  9. bu_no AS buNo,
  10. request_id AS requestId,
  11. interface_name AS interfaceName,
  12. request_group_id AS requestGroupId,
  13. re_document_no AS reDocumentNo,
  14. re_document_type AS reDocumentType,
  15. order_no AS orderNo,
  16. seq_no AS seqNo,
  17. status_code AS statusCode,
  18. message,
  19. source_system AS sourceSystem,
  20. target_system AS targetSystem,
  21. need_retry_flag AS needRetryFlag,
  22. retry_count AS retryCount,
  23. max_retry_count AS maxRetryCount,
  24. retry_interval AS retryInterval,
  25. next_retry_time AS nextRetryTime,
  26. last_retry_time AS lastRetryTime,
  27. created_by AS createdBy,
  28. created_date AS createdDate
  29. FROM api_log
  30. <where>
  31. <if test="interfaceName != null and interfaceName.trim() != ''">
  32. AND interface_name LIKE '%' + #{interfaceName} + '%'
  33. </if>
  34. <if test="requestId != null and requestId.trim() != ''">
  35. AND request_id = #{requestId}
  36. </if>
  37. <if test="reDocumentNo != null and reDocumentNo.trim() != ''">
  38. AND re_document_no LIKE '%' + #{reDocumentNo} + '%'
  39. </if>
  40. <if test="reDocumentType != null and reDocumentType.trim() != ''">
  41. AND re_document_type LIKE '%' + #{reDocumentType} + '%'
  42. </if>
  43. <if test="statusCode != null and statusCode.trim() != ''">
  44. AND status_code = #{statusCode}
  45. </if>
  46. <if test="sourceSystem != null and sourceSystem.trim() != ''">
  47. AND source_system = #{sourceSystem}
  48. </if>
  49. <if test="targetSystem != null and targetSystem.trim() != ''">
  50. AND target_system = #{targetSystem}
  51. </if>
  52. <if test="needRetryFlag != null">
  53. AND need_retry_flag = #{needRetryFlag}
  54. </if>
  55. <if test="startDate != null and startDate.trim() != ''">
  56. AND CONVERT(varchar(10), created_date, 23) &gt;= #{startDate}
  57. </if>
  58. <if test="endDate != null and endDate.trim() != ''">
  59. AND CONVERT(varchar(10), created_date, 23) &lt;= #{endDate}
  60. </if>
  61. </where>
  62. ORDER BY created_date DESC
  63. <if test="offset != null and limit != null">
  64. OFFSET #{offset} ROWS
  65. FETCH NEXT #{limit} ROWS ONLY
  66. </if>
  67. </select>
  68. <!-- 查询接口日志总数 -->
  69. <select id="queryTotal" resultType="int">
  70. SELECT COUNT(*)
  71. FROM api_log
  72. <where>
  73. <if test="interfaceName != null and interfaceName.trim() != ''">
  74. AND interface_name LIKE '%' + #{interfaceName} + '%'
  75. </if>
  76. <if test="requestId != null and requestId.trim() != ''">
  77. AND request_id = #{requestId}
  78. </if>
  79. <if test="reDocumentNo != null and reDocumentNo.trim() != ''">
  80. AND re_document_no LIKE '%' + #{reDocumentNo} + '%'
  81. </if>
  82. <if test="reDocumentType != null and reDocumentType.trim() != ''">
  83. AND re_document_type LIKE '%' + #{reDocumentType} + '%'
  84. </if>
  85. <if test="statusCode != null and statusCode.trim() != ''">
  86. AND status_code = #{statusCode}
  87. </if>
  88. <if test="sourceSystem != null and sourceSystem.trim() != ''">
  89. AND source_system = #{sourceSystem}
  90. </if>
  91. <if test="targetSystem != null and targetSystem.trim() != ''">
  92. AND target_system = #{targetSystem}
  93. </if>
  94. <if test="needRetryFlag != null">
  95. AND need_retry_flag = #{needRetryFlag}
  96. </if>
  97. <if test="startDate != null and startDate.trim() != ''">
  98. AND CONVERT(varchar(10), created_date, 23) &gt;= #{startDate}
  99. </if>
  100. <if test="endDate != null and endDate.trim() != ''">
  101. AND CONVERT(varchar(10), created_date, 23) &lt;= #{endDate}
  102. </if>
  103. </where>
  104. </select>
  105. <!-- 批量删除 -->
  106. <delete id="deleteBatch">
  107. DELETE FROM api_log WHERE id IN
  108. <foreach item="id" collection="ids" open="(" separator="," close=")">
  109. #{id}
  110. </foreach>
  111. </delete>
  112. </mapper>