BuyerOrderMapper.xml
3.04 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
<?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.BuyerOrderMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.BuyerOrder">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="seller_uid" property="sellerUid" jdbcType="INTEGER" />
<result column="client_type" property="clientType" jdbcType="TINYINT" />
<result column="payment" property="payment" jdbcType="TINYINT" />
<result column="payment_type" property="paymentType" jdbcType="TINYINT" />
<result column="is_cancel" property="isCancel" jdbcType="TINYINT" />
<result column="amount" property="uid" jdbcType="DECIMAL" />
<result column="ship_fee" property="shipFee" jdbcType="DECIMAL" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="order_status" property="orderStatus" jdbcType="TINYINT" />
<result column="channel_no" property="channelNo" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel,
amount, ship_fee, status, create_time, update_time, order_status, channel_no
</sql>
<select id="selectById" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from buyer_order where id = #{id}
</select>
<select id="selectCountByStatus" resultType="java.lang.Integer">
select count(1)
from buyer_order where status in
<foreach collection="list" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</select>
<sql id="Query_Order_Sql" >
<if test="buyerOrderReq.statusList != null and buyerOrderReq.statusList.size() > 0">
and status in
<foreach collection="buyerOrderReq.statusList" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</if>
</sql>
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
select count(1)
from buyer_order
where 1=1
<include refid="Query_Order_Sql" />
</select>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BuyerOrderReq">
select <include refid="Base_Column_List" />
from buyer_order
where 1=1
<include refid="Query_Order_Sql" />
order by create_time desc
<if test="buyerOrderReq.start!=null and buyerOrderReq.size != null">
limit #{buyerOrderReq.start},#{buyerOrderReq.size}
</if>
</select>
</mapper>