Pu Zhibing
4 天以前 4c4dc127cdc9c41f2bfb3c138108529856e031b8
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
<?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.supersavedriving.user.modular.system.dao.TOrderCheckMapper">
 
    <select id="queryOrderInfo" resultType="com.supersavedriving.user.modular.system.warpper.CheckOrderInfoWarpper"
            parameterType="java.lang.Long">
        select
            a.id,
            b.id as userId,
            b.avatar,
            b.nickname userName,
            b.phone userPhone,
            a.createTime,
            a.state,
            a.startAddress,
            a.startLat,
            a.startLng,
            a.endAddress,
            a.endLat,
            a.endLng,
            a.orderTakingTime,
            a.arrivalTimeAtTheAppointmentPoint,
            a.checkPayTime,
            a.startTime,
            a.endTime,
            a.goTime,
            a.successTime,
            a.payTime,
            a.checkStatus,
            a.checkIntro,
            a.checkImg,
            a.commentRate,
            a.commentStr,
            a.commentTime,
            a.reservationTime,
            a.reInspection,
            a.checkMoney,
            a.payMoney as serviceMoney
        from t_order a
                 left join t_app_user b on (a.userId = b.id)
        where a.id = #{orderId}
    </select>
    <select id="queryCheckOrderList"
            resultType="com.supersavedriving.user.modular.system.warpper.CheckOrderListWarpper">
        select * from(
        select id,createTime,startAddress,endAddress,checkStatus,
        case
        when state !=109 and state !=110 and state !=111 then 1
        when state =111 then 3
        else 2 end as state
        from t_order_check where userId = #{uid}
        ) t1 where 1=1
        <if test="null != state ">
            and state =#{ state}
        </if>
        order by t1.createTime desc limit #{pageNum}, #{pageSize}
    </select>
</mapper>