OrderOverTimeMapper.xml
2.51 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
<?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.yohoufo.dal.order.OrderOverTimeMapper" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.OrderOverTime" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="delivery_time" property="deliveryTime" jdbcType="INTEGER" />
<result column="delivery_minutes" property="deliveryMinutes" jdbcType="INTEGER" />
<result column="sham_send_time" property="shamSendTime" jdbcType="INTEGER" />
<result column="mini_fault_confirm_minutes" property="miniFaultConfirmMinutes" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, delivery_time, delivery_minutes, sham_send_time,mini_fault_confirm_minutes
</sql>
<insert id="insertDeliveryTime" parameterType="com.yohoufo.dal.order.model.OrderOverTime" >
insert into order_over_time (order_code, delivery_time, delivery_minutes)
values (#{orderCode,jdbcType=BIGINT}, #{deliveryTime,jdbcType=INTEGER}, #{deliveryMinutes,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE delivery_time = #{deliveryTime, jdbcType=INTEGER}, delivery_minutes = #{deliveryMinutes,jdbcType=INTEGER}
</insert>
<insert id="insertShamSendTime" parameterType="com.yohoufo.dal.order.model.OrderOverTime" >
insert into order_over_time (order_code, sham_send_time)
values (#{orderCode,jdbcType=BIGINT}, #{shamSendTime,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE sham_send_time = #{shamSendTime,jdbcType=INTEGER}
</insert>
<insert id="insertMiniFaultConfirmTime" parameterType="com.yohoufo.dal.order.model.OrderOverTime" >
insert into order_over_time (order_code, mini_fault_confirm_minutes)
values (#{orderCode,jdbcType=BIGINT}, #{miniFaultConfirmMinutes,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE mini_fault_confirm_minutes = #{miniFaultConfirmMinutes,jdbcType=INTEGER}
</insert>
<select id="selectByOrderCodes" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_over_time
where order_code IN
<foreach collection="orderCodeList" open="(" close=")" separator="," item="item">
#{item, jdbcType=BIGINT}
</foreach>
</select>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_over_time where order_code = #{orderCode, jdbcType=BIGINT}
</select>
</mapper>