TransactionOutLogV1ServiceDaoImplMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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="transactionOutLogV1ServiceDaoImpl">
  6. <!-- 保存调用外系统日志信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveTransactionOutLogInfo" parameterType="Map">
  8. insert into transaction_out_log(
  9. request_message,cost_time,request_url,request_method,response_header,log_id,request_header,state,response_message
  10. <if test="logType != null and logType != ''">
  11. ,log_type
  12. </if>
  13. ) values (
  14. #{requestMessage},#{costTime},#{requestUrl},#{requestMethod},#{responseHeader},#{logId},#{requestHeader},#{state},#{responseMessage}
  15. <if test="logType != null and logType != ''">
  16. ,#{logType}
  17. </if>
  18. )
  19. </insert>
  20. <!-- 查询调用外系统日志信息 add by wuxw 2018-07-03 -->
  21. <select id="getTransactionOutLogInfo" parameterType="Map" resultType="Map">
  22. select t.request_message,t.request_message requestMessage,t.cost_time,t.cost_time
  23. costTime,t.request_url,t.request_url requestUrl,t.request_method,t.request_method
  24. requestMethod,t.response_header,t.response_header responseHeader,t.log_id,t.log_id
  25. logId,t.request_header,t.request_header requestHeader,t.state,t.response_message,t.response_message
  26. responseMessage,t.log_type logType,t.create_time createTime
  27. from transaction_out_log t
  28. where 1 =1
  29. <if test="requestMessage !=null and requestMessage != ''">
  30. and t.request_message= #{requestMessage}
  31. </if>
  32. <if test="costTime !=null and costTime != ''">
  33. and t.cost_time= #{costTime}
  34. </if>
  35. <if test="requestUrl !=null and requestUrl != ''">
  36. and t.request_url= #{requestUrl}
  37. </if>
  38. <if test="requestMethod !=null and requestMethod != ''">
  39. and t.request_method= #{requestMethod}
  40. </if>
  41. <if test="responseHeader !=null and responseHeader != ''">
  42. and t.response_header= #{responseHeader}
  43. </if>
  44. <if test="logId !=null and logId != ''">
  45. and t.log_id= #{logId}
  46. </if>
  47. <if test="logType !=null and logType != ''">
  48. and t.log_type= #{logType}
  49. </if>
  50. <if test="requestHeader !=null and requestHeader != ''">
  51. and t.request_header= #{requestHeader}
  52. </if>
  53. <if test="state !=null and state != ''">
  54. and t.state= #{state}
  55. </if>
  56. <if test="responseMessage !=null and responseMessage != ''">
  57. and t.response_message= #{responseMessage}
  58. </if>
  59. <if test="startTime != null and startTime != ''">
  60. and t.create_time &gt; #{startTime}
  61. and t.create_time &lt; #{endTime}
  62. </if>
  63. order by t.create_time desc
  64. <if test="page != -1 and page != null ">
  65. limit #{page}, #{row}
  66. </if>
  67. </select>
  68. <!-- 修改调用外系统日志信息 add by wuxw 2018-07-03 -->
  69. <update id="updateTransactionOutLogInfo" parameterType="Map">
  70. update transaction_out_log t set t.status_cd = #{statusCd}
  71. <if test="newBId != null and newBId != ''">
  72. ,t.b_id = #{newBId}
  73. </if>
  74. <if test="requestMessage !=null and requestMessage != ''">
  75. , t.request_message= #{requestMessage}
  76. </if>
  77. <if test="costTime !=null and costTime != ''">
  78. , t.cost_time= #{costTime}
  79. </if>
  80. <if test="requestUrl !=null and requestUrl != ''">
  81. , t.request_url= #{requestUrl}
  82. </if>
  83. <if test="requestMethod !=null and requestMethod != ''">
  84. , t.request_method= #{requestMethod}
  85. </if>
  86. <if test="responseHeader !=null and responseHeader != ''">
  87. , t.response_header= #{responseHeader}
  88. </if>
  89. <if test="requestHeader !=null and requestHeader != ''">
  90. , t.request_header= #{requestHeader}
  91. </if>
  92. <if test="state !=null and state != ''">
  93. , t.state= #{state}
  94. </if>
  95. <if test="responseMessage !=null and responseMessage != ''">
  96. , t.response_message= #{responseMessage}
  97. </if>
  98. where 1=1
  99. <if test="logId !=null and logId != ''">
  100. and t.log_id= #{logId}
  101. </if>
  102. </update>
  103. <!-- 查询调用外系统日志数量 add by wuxw 2018-07-03 -->
  104. <select id="queryTransactionOutLogsCount" parameterType="Map" resultType="Map">
  105. select count(1) count
  106. from transaction_out_log t
  107. where 1 =1
  108. <if test="requestMessage !=null and requestMessage != ''">
  109. and t.request_message= #{requestMessage}
  110. </if>
  111. <if test="costTime !=null and costTime != ''">
  112. and t.cost_time= #{costTime}
  113. </if>
  114. <if test="requestUrl !=null and requestUrl != ''">
  115. and t.request_url= #{requestUrl}
  116. </if>
  117. <if test="requestMethod !=null and requestMethod != ''">
  118. and t.request_method= #{requestMethod}
  119. </if>
  120. <if test="responseHeader !=null and responseHeader != ''">
  121. and t.response_header= #{responseHeader}
  122. </if>
  123. <if test="logId !=null and logId != ''">
  124. and t.log_id= #{logId}
  125. </if>
  126. <if test="logType !=null and logType != ''">
  127. and t.log_type= #{logType}
  128. </if>
  129. <if test="requestHeader !=null and requestHeader != ''">
  130. and t.request_header= #{requestHeader}
  131. </if>
  132. <if test="state !=null and state != ''">
  133. and t.state= #{state}
  134. </if>
  135. <if test="responseMessage !=null and responseMessage != ''">
  136. and t.response_message= #{responseMessage}
  137. </if>
  138. <if test="startTime != null and startTime != ''">
  139. and t.create_time &gt; #{startTime}
  140. and t.create_time &lt; #{endTime}
  141. </if>
  142. </select>
  143. </mapper>