Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml
@@ -128,7 +128,8 @@
        trackId as trackId,
        isDelete as isDelete,
        telX as telX,
        bindId as bindId
        bindId as bindId,
        tripId
        from t_order_logistics where isDelete = 1
        <if test="null != start and null != end">
            and insertTime between #{start} and #{end}
@@ -159,7 +160,10 @@
        payMoney as payMoney,
        ifnull(discountMoney, 0) as discountMoney,
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney,
        cancelMidway
        cancelMidway,
        tripId,
        remark,
        companyId
        from t_order_logistics as a where userId = #{uid} and isDelete = 1 order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -237,11 +241,27 @@
        a.endLat as endLat,
        a.endAddress as endAddress,
      a.driverId as driverId,
      a.orderMoney as orderMoney,
      a.redPacketMoney as redPacketMoney,
      a.couponMoney as couponMoney,
      a.discountMoney as discountMoney,
      a.payMoney as payMoney,
        a.orderMoney as orderMoney,
        a.startMileage as startMileage,
        a.mileage as mileage,
        a.startMoney as startMoney,
        a.mileageKilometers as mileageKilometers,
        a.mileageMoney as mileageMoney,
        a.duration as duration,
        a.durationMoney as durationMoney,
        a.wait as wait,
        a.waitMoney as waitMoney,
        a.longDistance as longDistance,
        a.longDistanceMoney as longDistanceMoney,
        a.parkMoney as parkMoney,
        a.roadTollMoney as roadTollMoney,
        a.redPacketMoney as redPacketMoney,
        a.couponMoney as couponMoney,
        a.discount as discount,
        a.discountMoney as discountMoney,
        a.priceDifference,
        a.payType,
        a.payMoney as payMoney,
        a.remark as remark,
        a.companyId,
      b.headImgUrl as driverAvatar,
@@ -250,12 +270,10 @@
      c.carColor as carColor,
      CONCAT(f.`name`, d.`name`) as brand,
      ((select sum(fraction) from t_order_evaluate where driverId = a.driverId) / (select count(id) from t_order_evaluate where driverId = a.driverId)) as score,
      (
      (select count(id) from t_order_private_car where driverId = a.driverId and state in (7, 8, 9)) +
      (select count(id) from t_order_taxi where driverId = a.driverId and state in (7, 8, 9)) +
      (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) +
      (select count(id) from t_order_logistics where driverId = a.driverId and state in (6, 9))
      ) as orderNum,
        (
        (select count(id) from t_order_private_car where driverId = a.driverId and state in (6, 7, 8, 9)) +
        (select count(id) from t_order_logistics where driverId = a.driverId and state in (6, 7, 8, 9))
        ) as orderNum,
      b.phone as driverPhone,
      if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = a.type and state = 1 order by insertTime desc limit 0, 1), if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = a.type and state = 2 order by insertTime desc limit 0, 1), 0)) as cancelPayMoney,
      if(a.state = 10, (select id from t_order_cancel where orderId = a.id and orderType = a.type and state = 1 order by insertTime desc limit 0, 1), 0) as cancelId,
@@ -266,7 +284,9 @@
      h.money as cancelMoney,
      h.reason as cancelReason,
      h.remark as cancelRemark,
        a.snatchOrderTime
        a.tripId,
        a.snatchOrderTime,
        a.startDuration
        from t_order_logistics a
      left join t_driver b on (a.driverId = b.id)
      left join t_car c on (a.carId = c.id)
@@ -284,6 +304,24 @@
            DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time,
        ('包裹') as name,
        UNIX_TIMESTAMP(insertTime) as insertTime
        from t_order_logistics where userId = #{uid} and state in (8, 9) and redPacketId is not null
        from t_order_logistics where userId = #{uid} and redPacketId is not null
    </select>
    <select id="queryByState" resultType="OrderLogistics">
        select *
        from t_order_logistics where isDelete = 1 and isFrozen = 1 and userId = #{uid}
        <if test="null != orderType">
            and orderType = #{orderType}
        </if>
        <if test="null != state">
            and state in
            <foreach collection="state" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != type">
            and `type` = #{type}
        </if>
    </select>
</mapper>