AbnormalPackageMapper.xml
3.74 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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.yoho.order.dal.AbnormalPackageMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.AbnormalPackage">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="seller_waybillCode" property="sellerWaybillCode" jdbcType="VARCHAR" />
<result column="is_del" property="isDel" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="operate_uid" property="operateUid" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="depot_no" property="depotNo" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, seller_waybillCode, is_del, create_time, operate_uid, update_time, depot_no
</sql>
<select id="selectValidCnt" resultType="java.lang.Integer">
select count(1) from abnormal_package where is_del = 0
<if test="depotNo !=null ">
and depot_no = #{depotNo}
</if>
<if test="sellerWaybillCode!=null and sellerWaybillCode != ''">
and seller_waybillCode = #{sellerWaybillCode}
</if>
</select>
<sql id="Query_Sql" >
<if test="buyerOrderReq.depotNo !=null ">
and depot_no = #{buyerOrderReq.depotNo}
</if>
<if test="buyerOrderReq.sellerWaybillCode!=null and buyerOrderReq.sellerWaybillCode != ''">
and seller_waybillCode = #{buyerOrderReq.sellerWaybillCode}
</if>
<if test="buyerOrderReq.startTime!=null">
and create_time >= #{buyerOrderReq.startTime}
</if>
<if test="buyerOrderReq.endTime !=null">
and create_time <= #{buyerOrderReq.endTime}
</if>
<if test="buyerOrderReq.status !=null and buyerOrderReq.status == 0">
and is_del = 0
</if>
<if test="buyerOrderReq.status !=null and buyerOrderReq.status == 1">
and is_del = 1
</if>
</sql>
<select id="selectCntByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
select count(1) from abnormal_package where 1=1
<include refid="Query_Sql" />
</select>
<select id="selectValidSellerWaybillCodeList" resultType="java.lang.String" parameterType="com.yoho.order.model.BuyerOrderReq">
select seller_waybillCode from abnormal_package where 1=1
<include refid="Query_Sql" />
order by id
<if test="buyerOrderReq.start!=null and buyerOrderReq.size != null">
limit #{buyerOrderReq.start},#{buyerOrderReq.size}
</if>
</select>
<select id="selectBySellerWaybillCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from abnormal_package where seller_waybillCode = #{sellerWaybillCode}
</select>
<insert id="insert" parameterType="com.yoho.order.model.AbnormalPackage">
insert into abnormal_package(id, seller_waybillCode, is_del, create_time, operate_uid, update_time, depot_no)
values (#{id}, #{sellerWaybillCode}, #{isDel}, #{createTime}, #{operateUid}, #{updateTime}, #{depotNo})
</insert>
<update id="update">
update abnormal_package set operate_uid=#{operateUid}, update_time=#{updateTime}, depot_no=#{depotNo}, is_del=0
where seller_waybillCode = #{sellerWaybillCode}
</update>
<update id="updateToDealed">
update abnormal_package set operate_uid=#{operateUid}, update_time=#{updateTime}, is_del=1
where seller_waybillCode = #{sellerWaybillCode}
</update>
</mapper>