MachineTranslateErrorServiceDaoImplMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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="machineTranslateErrorServiceDaoImpl">
  6. <!-- 保存IOT同步错误日志记录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMachineTranslateErrorInfo" parameterType="Map">
  8. insert into machine_translate_error(
  9. req_header,machine_translate_id,res_body,req_body,log_id,community_id,req_path,req_type
  10. ) values (
  11. #{reqHeader},#{machineTranslateId},#{resBody},#{reqBody},#{logId},#{communityId},#{reqPath},#{reqType}
  12. )
  13. </insert>
  14. <!-- 查询IOT同步错误日志记录信息 add by wuxw 2018-07-03 -->
  15. <select id="getMachineTranslateErrorInfo" parameterType="Map" resultType="Map">
  16. select t.req_header,t.req_header reqHeader,t.machine_translate_id,t.machine_translate_id
  17. machineTranslateId,t.res_body,t.res_body resBody,t.req_body,t.req_body reqBody,t.log_id,t.log_id
  18. logId,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,
  19. t.req_path reqPath,t.req_type reqType
  20. from machine_translate_error t
  21. where 1 =1
  22. <if test="reqHeader !=null and reqHeader != ''">
  23. and t.req_header= #{reqHeader}
  24. </if>
  25. <if test="machineTranslateId !=null and machineTranslateId != ''">
  26. and t.machine_translate_id= #{machineTranslateId}
  27. </if>
  28. <if test="resBody !=null and resBody != ''">
  29. and t.res_body= #{resBody}
  30. </if>
  31. <if test="reqBody !=null and reqBody != ''">
  32. and t.req_body= #{reqBody}
  33. </if>
  34. <if test="logId !=null and logId != ''">
  35. and t.log_id= #{logId}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="communityId !=null and communityId != ''">
  41. and t.community_id= #{communityId}
  42. </if>
  43. order by t.create_time desc
  44. <if test="page != -1 and page != null ">
  45. limit #{page}, #{row}
  46. </if>
  47. </select>
  48. <!-- 修改IOT同步错误日志记录信息 add by wuxw 2018-07-03 -->
  49. <update id="updateMachineTranslateErrorInfo" parameterType="Map">
  50. update machine_translate_error t set t.status_cd = #{statusCd}
  51. <if test="newBId != null and newBId != ''">
  52. ,t.b_id = #{newBId}
  53. </if>
  54. <if test="reqHeader !=null and reqHeader != ''">
  55. , t.req_header= #{reqHeader}
  56. </if>
  57. <if test="machineTranslateId !=null and machineTranslateId != ''">
  58. , t.machine_translate_id= #{machineTranslateId}
  59. </if>
  60. <if test="resBody !=null and resBody != ''">
  61. , t.res_body= #{resBody}
  62. </if>
  63. <if test="reqBody !=null and reqBody != ''">
  64. , t.req_body= #{reqBody}
  65. </if>
  66. <if test="communityId !=null and communityId != ''">
  67. , t.community_id= #{communityId}
  68. </if>
  69. where 1=1
  70. <if test="logId !=null and logId != ''">
  71. and t.log_id= #{logId}
  72. </if>
  73. </update>
  74. <!-- 查询IOT同步错误日志记录数量 add by wuxw 2018-07-03 -->
  75. <select id="queryMachineTranslateErrorsCount" parameterType="Map" resultType="Map">
  76. select count(1) count
  77. from machine_translate_error t
  78. where 1 =1
  79. <if test="reqHeader !=null and reqHeader != ''">
  80. and t.req_header= #{reqHeader}
  81. </if>
  82. <if test="machineTranslateId !=null and machineTranslateId != ''">
  83. and t.machine_translate_id= #{machineTranslateId}
  84. </if>
  85. <if test="resBody !=null and resBody != ''">
  86. and t.res_body= #{resBody}
  87. </if>
  88. <if test="reqBody !=null and reqBody != ''">
  89. and t.req_body= #{reqBody}
  90. </if>
  91. <if test="logId !=null and logId != ''">
  92. and t.log_id= #{logId}
  93. </if>
  94. <if test="statusCd !=null and statusCd != ''">
  95. and t.status_cd= #{statusCd}
  96. </if>
  97. <if test="communityId !=null and communityId != ''">
  98. and t.community_id= #{communityId}
  99. </if>
  100. </select>
  101. </mapper>