MOrderCheckErrorMapper.xml
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?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.monitor.mysql.mapper.MOrderCheckErrorMapper">
<resultMap id="BaseResultMap" type="com.model.OrderInfoCheck">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="event" property="event" jdbcType="VARCHAR"/>
<result column="context" property="context" jdbcType="VARCHAR"/>
<result column="ip" property="ip" jdbcType="VARCHAR"/>
<result column="order_code" property="orderCode" jdbcType="VARCHAR"/>
<result column="response" property="response" jdbcType="VARCHAR"/>
<result column="body" property="body" jdbcType="LONGVARCHAR"/>
<result column="is_send" property="isSend" jdbcType="CHAR"/>
<result column="influxdb" property="influxdb" jdbcType="VARCHAR"/>
<result column="influx_time" property="influxTime" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, event, context, ip, order_code, response, influxdb, influx_time, is_send, body, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as create_time, DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%S') as update_time
</sql>
<select id="selectOrderCheck" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_info_check
ORDER BY ID DESC
LIMIT #{offsetCount},#{limitCount}
</select>
<select id="selectByid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_info_check
where id = #{id}
</select>
<insert id="insert" parameterType="com.model.OrderInfoCheck">
INSERT INTO order_info_check
(event, context, ip, order_code, response,
body, influxdb,influx_time, create_time, update_time)
VALUES (#{event,jdbcType=VARCHAR},#{context,jdbcType=VARCHAR},
#{ip,jdbcType=VARCHAR},#{orderCode,jdbcType=VARCHAR},
#{response,jdbcType=VARCHAR},#{body,jdbcType=LONGVARCHAR},
#{influxdb,jdbcType=VARCHAR},#{influxTime,jdbcType=VARCHAR},NOW(),NOW())
</insert>
<update id="updateSendStatus" >
update order_info_check
set is_send = 'Y',
update_time = now()
where id = #{id}
</update>
<select id="selectBodyByid" resultType="java.lang.String" parameterType="java.lang.Integer">
select
body
from order_info_check
where id = #{id}
</select>
<select id="selectOrderCount" resultType="java.lang.Integer">
SELECT COUNT(1) FROM order_info_check
</select>
</mapper>