liujie
2023-08-16 db7fa6a91b9534ac90e219b6f554c54c43c83a5a
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
@@ -59,6 +59,7 @@
        <result column="oldState" property="oldState"/>
        <result column="status" property="status" />
        <result column="createTime" property="createTime" />
        <result column="routeRecord" property="routeRecord"/>
    </resultMap>
@@ -69,8 +70,8 @@
        b.avatar,
        a.userName,
        a.userPhone,
        (select count(1) from t_order where userPhone = a.userPhone and state in (107, 108)) as orderTimes,
        (select count(1) from t_order where userPhone = a.userPhone and state in (301)) as cancelTimes,
        (select count(1) from t_order where userId = a.userId and state in (107, 108, 109)) as orderTimes,
        (select count(1) from t_order where userId = a.userId and state in (301)) as cancelTimes,
        a.source,
        UNIX_TIMESTAMP(a.createTime) * 1000 as createTime,
        a.startAddress,
@@ -84,7 +85,7 @@
        a.startPrice
        from t_order a
        left join t_app_user b on (a.userId = b.id)
        where a.`status` = 1 and a.hallOrder = 1 and a.state = 101 order by a.createTime desc
        where a.`status` = 1 and a.hallOrder = 1 and a.state in (101, 201) order by a.createTime desc
    </select>
@@ -92,11 +93,12 @@
    <select id="queryOrderInfo" resultType="com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper">
        select
        a.id,
        b.id as userId,
        b.avatar,
        a.userName,
        a.userPhone,
        (select count(1) from t_order where userPhone = a.userPhone and state in (107, 108)) as orderTimes,
        (select count(1) from t_order where userPhone = a.userPhone and state in (301)) as cancelTimes,
        (select count(1) from t_order where userId = a.userId and state in (107, 108, 109)) as orderTimes,
        (select count(1) from t_order where userId = a.userId and state in (301)) as cancelTimes,
        a.source,
        UNIX_TIMESTAMP(a.createTime) * 1000 as createTime,
        a.startAddress,
@@ -107,8 +109,9 @@
        a.endLng,
        a.estimatedPrice,
        a.estimatedMileage,
        a.estimatedTime,
        a.startPrice,
        a.waitTime,
        a.waitTime + a.outWaitTime as waitTime,
        a.actualMileage,
        a.state,
        (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(a.startTime)) / 60 as travelTime
@@ -174,9 +177,10 @@
    </select>
    <select id="queryDriverrank" resultType="com.supersavedriving.driver.modular.system.warpper.PerformanceRankingWarpper">
    <select id="queryDriverRank" resultType="com.supersavedriving.driver.modular.system.warpper.PerformanceRankingWarpper">
        select
        aa.driverId,
        @ROW :=@ROW + 1 as rank,
        aa.name,
        UNIX_TIMESTAMP(aa.createTime) * 1000 as createTime,
        aa.number as amountOfData
@@ -188,7 +192,7 @@
            count(1) as number
            from t_order a
            left join t_driver b on (a.driverId = b.id)
            where a.state in (107, 108, 108) and a.`status` = 1
            where a.state in (107, 108, 109) and a.`status` = 1
            <if test="null != dayType and 1 == dayType"><!--天-->
                <if test="null != time and '' != time">
                    and DATE_FORMAT(a.createTime, '%Y年%m月%d日') = #{time}
@@ -205,6 +209,11 @@
                </if>
            </if>
            group by a.driverId,b.`name`
        ) as aa order by aa.number desc
        ) as aa,( SELECT @ROW := 0 ) AS itable order by aa.number desc
    </select>
    <update id="completeCollection">
        update t_order set state = 108 where state = 107 and status = 1 and payType = 3
    </update>
</mapper>