ErrorMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.tld.mapper.ErrorMapper">
  5. <!-- 如果失败存入报错信息跟数据 -->
  6. <insert id="addError">
  7. insert into tld_error (url,error_info,data_val,scrq,type,transmission_type) value (#{url},#{errorInfo},#{dataVal},now(),#{type},'1')
  8. </insert>
  9. <!--查询error错误日志信息-->
  10. <select id="getErrorList" resultType="java.util.Map">
  11. SELECT
  12. id,
  13. url,
  14. error_info as errorInfo,
  15. data_val as dataVal,
  16. scrq,
  17. type,
  18. transmission_type as transmissionType
  19. FROM
  20. tld_error
  21. <trim prefix="WHERE" prefixOverrides="and |or">
  22. <if test="startTime != null and startTime != ''">
  23. and scrq <![CDATA[>=]]> #{startTime}
  24. </if>
  25. <if test="endTime != null and endTime != ''">
  26. and scrq <![CDATA[<=]]> #{endTime}
  27. </if>
  28. <if test="url != null and url != ''">
  29. and url like CONCAT(CONCAT('%', #{url}), '%')
  30. </if>
  31. <if test="errorInfo != null and errorInfo != ''">
  32. and error_info like CONCAT(CONCAT('%', #{errorInfo}), '%')
  33. </if>
  34. <if test="dataVal != null and dataVal != ''">
  35. and data_val like CONCAT(CONCAT('%', #{dataVal}), '%')
  36. </if>
  37. <if test="type != null and type != ''">
  38. and type like CONCAT(CONCAT('%', #{type}), '%')
  39. </if>
  40. <if test="transmissionType != null and transmissionType != ''">
  41. and transmission_type like CONCAT(CONCAT('%', #{transmissionType}), '%')
  42. </if>
  43. </trim>
  44. ORDER BY scrq DESC
  45. </select>
  46. <!--查询error错误日志信息导出-->
  47. <select id="getErrorExcel" resultType="java.util.LinkedHashMap">
  48. SELECT
  49. url,
  50. error_info,
  51. data_val,
  52. scrq
  53. FROM
  54. tld_error
  55. <trim prefix="WHERE" prefixOverrides="and |or">
  56. <if test="startTime != null and startTime != ''">
  57. and scrq <![CDATA[>=]]> #{startTime}
  58. </if>
  59. <if test="endTime != null and endTime != ''">
  60. and scrq <![CDATA[<=]]> #{endTime}
  61. </if>
  62. <if test="url != null and url != ''">
  63. and url like CONCAT(CONCAT('%', #{url}), '%')
  64. </if>
  65. <if test="errorInfo != null and errorInfo != ''">
  66. and error_info like CONCAT(CONCAT('%', #{errorInfo}), '%')
  67. </if>
  68. <if test="dataVal != null and dataVal != ''">
  69. and data_val like CONCAT(CONCAT('%', #{dataVal}), '%')
  70. </if>
  71. </trim>
  72. ORDER BY scrq DESC
  73. </select>
  74. <delete id="delError">
  75. delete from tld_error where id = #{id}
  76. </delete>
  77. <!-- 修改日志状态 -->
  78. <update id="updateError">
  79. update tld_error set transmission_type = '0' where id = #{id}
  80. </update>
  81. </mapper>