TransactionLogServiceDaoImplMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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="transactionLogServiceDaoImpl">
  6. <!-- 保存交互日志信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveTransactionLogInfo" parameterType="Map">
  8. insert into transaction_log(
  9. src_ip,service_code,cost_time,ip,app_id,log_id,state,user_id,transaction_id,timestamp
  10. ) values (
  11. #{srcIp},#{serviceCode},#{costTime},#{ip},#{appId},#{logId},#{state},#{userId},#{transactionId},#{timestamp}
  12. )
  13. </insert>
  14. <!-- 查询交互日志信息 add by wuxw 2018-07-03 -->
  15. <select id="getTransactionLogInfo" parameterType="Map" resultType="Map">
  16. select t.src_ip,t.src_ip srcIp,t.service_code,t.service_code serviceCode,t.cost_time,t.cost_time
  17. costTime,t.ip,t.app_id,t.app_id appId,t.log_id,t.log_id logId,t.state,t.user_id,t.user_id
  18. userId,t.transaction_id,t.transaction_id transactionId,t.timestamp,t.create_time createTime
  19. from transaction_log t
  20. where 1 =1
  21. <if test="srcIp !=null and srcIp != ''">
  22. and t.src_ip= #{srcIp}
  23. </if>
  24. <if test="serviceCode !=null and serviceCode != ''">
  25. and t.service_code= #{serviceCode}
  26. </if>
  27. <if test="costTime !=null and costTime != ''">
  28. and t.cost_time= #{costTime}
  29. </if>
  30. <if test="ip !=null and ip != ''">
  31. and t.ip= #{ip}
  32. </if>
  33. <if test="appId !=null and appId != ''">
  34. and t.app_id= #{appId}
  35. </if>
  36. <if test="logId !=null and logId != ''">
  37. and t.log_id= #{logId}
  38. </if>
  39. <if test="state !=null and state != ''">
  40. and t.state= #{state}
  41. </if>
  42. <if test="userId !=null and userId != ''">
  43. and t.user_id= #{userId}
  44. </if>
  45. <if test="transactionId !=null and transactionId != ''">
  46. and t.transaction_id= #{transactionId}
  47. </if>
  48. <if test="timestamp !=null and timestamp != ''">
  49. and t.timestamp= #{timestamp}
  50. </if>
  51. order by t.create_time desc
  52. <if test="page != -1 and page != null ">
  53. limit #{page}, #{row}
  54. </if>
  55. </select>
  56. <!-- 修改交互日志信息 add by wuxw 2018-07-03 -->
  57. <update id="updateTransactionLogInfo" parameterType="Map">
  58. update transaction_log t
  59. <set>
  60. <if test="newBId != null and newBId != ''">
  61. t.b_id = #{newBId},
  62. </if>
  63. <if test="srcIp !=null and srcIp != ''">
  64. t.src_ip= #{srcIp},
  65. </if>
  66. <if test="serviceCode !=null and serviceCode != ''">
  67. t.service_code= #{serviceCode},
  68. </if>
  69. <if test="costTime !=null and costTime != ''">
  70. t.cost_time= #{costTime},
  71. </if>
  72. <if test="ip !=null and ip != ''">
  73. t.ip= #{ip},
  74. </if>
  75. <if test="appId !=null and appId != ''">
  76. t.app_id= #{appId},
  77. </if>
  78. <if test="state !=null and state != ''">
  79. t.state= #{state},
  80. </if>
  81. <if test="userId !=null and userId != ''">
  82. t.user_id= #{userId},
  83. </if>
  84. <if test="transactionId !=null and transactionId != ''">
  85. t.transaction_id= #{transactionId},
  86. </if>
  87. <if test="timestamp !=null and timestamp != ''">
  88. t.timestamp= #{timestamp},
  89. </if>
  90. </set>
  91. where 1=1
  92. <if test="logId !=null and logId != ''">
  93. and t.log_id= #{logId}
  94. </if>
  95. </update>
  96. <!-- 查询交互日志数量 add by wuxw 2018-07-03 -->
  97. <select id="queryTransactionLogsCount" parameterType="Map" resultType="Map">
  98. select count(1) count
  99. from transaction_log t
  100. where 1 =1
  101. <if test="srcIp !=null and srcIp != ''">
  102. and t.src_ip= #{srcIp}
  103. </if>
  104. <if test="serviceCode !=null and serviceCode != ''">
  105. and t.service_code= #{serviceCode}
  106. </if>
  107. <if test="costTime !=null and costTime != ''">
  108. and t.cost_time= #{costTime}
  109. </if>
  110. <if test="ip !=null and ip != ''">
  111. and t.ip= #{ip}
  112. </if>
  113. <if test="appId !=null and appId != ''">
  114. and t.app_id= #{appId}
  115. </if>
  116. <if test="logId !=null and logId != ''">
  117. and t.log_id= #{logId}
  118. </if>
  119. <if test="state !=null and state != ''">
  120. and t.state= #{state}
  121. </if>
  122. <if test="userId !=null and userId != ''">
  123. and t.user_id= #{userId}
  124. </if>
  125. <if test="transactionId !=null and transactionId != ''">
  126. and t.transaction_id= #{transactionId}
  127. </if>
  128. <if test="timestamp !=null and timestamp != ''">
  129. and t.timestamp= #{timestamp}
  130. </if>
  131. </select>
  132. </mapper>