| | |
| | | tc.phone as phone, |
| | | tc2.name as communityName |
| | | from t_courier tc |
| | | left join t_community_courier on tc.id = tcc.courier_id |
| | | left join t_community_courier tcc on tc.id = tcc.courier_id |
| | | left join t_community tc2 on tcc.community_id = tc2.id |
| | | where |
| | | tc.del_flag=0 |
| | |
| | | from |
| | | t_order o |
| | | left join t_evaluation te on o.id = te.order_id |
| | | where |
| | | o.courier_id = #{courierId} -- 替换为实际跑腿ID |
| | | AND o.del_flag = 0 -- 过滤未删除的订单 |
| | | and o.payStatus = 2 -- 过滤未支付的订单 |
| | | and o.pay_status = 2 -- 过滤未支付的订单 |
| | | <if test="orderStatus !=null and orderStatus !=0"> |
| | | AND o.order_status = #{orderStatus} -- 订单状态筛选条件 |
| | | </if> |
| | | ORDER BY |
| | | CASE WHEN o.order_status = 1 THEN 0 ELSE 1 END, -- 待确认订单置顶 |
| | | o.order_time DESC; -- 其余订单按下单时间倒序 |
| | | CASE WHEN o.order_status = 1 THEN 0 ELSE 1 END, -- 待确认订单置顶 其余订单按下单时间倒序 |
| | | o.order_time DESC |
| | | </select> |
| | | <select id="getCourierPageList" resultType="com.ruoyi.errand.object.vo.sys.CourierPageListVO"> |
| | | select |