ErrorMapper.xml 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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) value (#{url},#{errorInfo},#{dataVal},now())
  8. </insert>
  9. <!--查询error错误日志信息-->
  10. <select id="getErrorList" resultType="java.util.Map">
  11. SELECT
  12. id,
  13. url,
  14. error_info,
  15. data_val,
  16. scrq
  17. FROM
  18. tld_error
  19. <trim prefix="WHERE" prefixOverrides="and |or">
  20. <if test="startTime != null and startTime != ''">
  21. and scrq <![CDATA[>=]]> #{startTime}
  22. </if>
  23. <if test="endTime != null and endTime != ''">
  24. and scrq <![CDATA[<=]]> #{endTime}
  25. </if>
  26. <if test="url != null and url != ''">
  27. and url like CONCAT(CONCAT('%', #{url}), '%')
  28. </if>
  29. </trim>
  30. ORDER BY scrq DESC
  31. </select>
  32. </mapper>