12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.tld.mapper.ErrorMapper">
- <!-- 如果失败存入报错信息跟数据 -->
- <insert id="addError">
- insert into tld_error (url,error_info,data_val,scrq,type,transmission_type) value (#{url},#{errorInfo},#{dataVal},now(),#{type},'1')
- </insert>
- <!--查询error错误日志信息-->
- <select id="getErrorList" resultType="java.util.Map">
- SELECT
- id,
- url,
- error_info as errorInfo,
- data_val as dataVal,
- scrq,
- type,
- transmission_type as transmissionType
- FROM
- tld_error
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="startTime != null and startTime != ''">
- and scrq <![CDATA[>=]]> #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- and scrq <![CDATA[<=]]> #{endTime}
- </if>
- <if test="url != null and url != ''">
- and url like CONCAT(CONCAT('%', #{url}), '%')
- </if>
- <if test="errorInfo != null and errorInfo != ''">
- and error_info like CONCAT(CONCAT('%', #{errorInfo}), '%')
- </if>
- <if test="dataVal != null and dataVal != ''">
- and data_val like CONCAT(CONCAT('%', #{dataVal}), '%')
- </if>
- <if test="type != null and type != ''">
- and type like CONCAT(CONCAT('%', #{type}), '%')
- </if>
- <if test="transmissionType != null and transmissionType != ''">
- and transmission_type like CONCAT(CONCAT('%', #{transmissionType}), '%')
- </if>
- </trim>
- ORDER BY scrq DESC
- </select>
- <!--查询error错误日志信息导出-->
- <select id="getErrorExcel" resultType="java.util.LinkedHashMap">
- SELECT
- url,
- error_info,
- data_val,
- scrq
- FROM
- tld_error
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="startTime != null and startTime != ''">
- and scrq <![CDATA[>=]]> #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- and scrq <![CDATA[<=]]> #{endTime}
- </if>
- <if test="url != null and url != ''">
- and url like CONCAT(CONCAT('%', #{url}), '%')
- </if>
- <if test="errorInfo != null and errorInfo != ''">
- and error_info like CONCAT(CONCAT('%', #{errorInfo}), '%')
- </if>
- <if test="dataVal != null and dataVal != ''">
- and data_val like CONCAT(CONCAT('%', #{dataVal}), '%')
- </if>
- </trim>
- ORDER BY scrq DESC
- </select>
- <delete id="delError">
- delete from tld_error where id = #{id}
- </delete>
- <!-- 修改日志状态 -->
- <update id="updateError">
- update tld_error set transmission_type = '0' where id = #{id}
- </update>
- </mapper>
|