luofl
2025-03-13 4f97bdbaadcdc19df9dfb0971b930d799c4aeddc
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -101,12 +101,14 @@
    </select>
    <select id="getOrderStatistics" resultType="com.ruoyi.order.vo.OrderStatistics">
        SELECT
            SUM( CASE WHEN tor.order_status!=5 THEN 1 ELSE 0 END ) as total,
            SUM( CASE WHEN tor.order_type = 1 and tor.order_status!=5 THEN 1 ELSE 0 END ) as serviceTotal,
            SUM( CASE WHEN tor.order_type = 2 and tor.order_status!=5 THEN 1 ELSE 0 END ) as singleTotal,
            SUM( CASE WHEN tor.order_status!=5 THEN tor.total_amount ELSE 0 END ) as totalMoney,
            SUM( CASE WHEN tor.order_type = 1 and tor.order_status!=5 THEN tor.total_amount ELSE 0 END ) as serviceTotalMoney,
            SUM( CASE WHEN tor.order_type = 2 and tor.order_status!=5 THEN tor.total_amount ELSE 0 END ) as singleTotalMoney
        coalesce(SUM( CASE WHEN tor.order_status!=5 THEN 1 ELSE 0 END ), 0) as total,
        coalesce(SUM( CASE WHEN tor.order_type = 1 and tor.order_status!=5 THEN 1 ELSE 0 END ),0) as serviceTotal,
        coalesce(SUM( CASE WHEN tor.order_type = 2 and tor.order_status!=5 THEN 1 ELSE 0 END ),0) as singleTotal,
        coalesce(SUM( CASE WHEN tor.order_status!=5 THEN tor.total_amount ELSE 0 END ),0) as totalMoney,
        coalesce(SUM( CASE WHEN tor.order_type = 1 and tor.order_status!=5 THEN tor.total_amount ELSE 0 END ),0) as
        serviceTotalMoney,
        coalesce( SUM( CASE WHEN tor.order_type = 2 and tor.order_status!=5 THEN tor.total_amount ELSE 0 END ),0) as
        singleTotalMoney
        FROM
        t_order tor where 1 = 1 AND tor.del_flag = 0
        <if test="null != shopId">
@@ -160,6 +162,7 @@
            o.order_status,
            o.order_number,
            o.order_type,
            o.distribution_mode,
            o.address_Json,
            o.create_time,
            o.app_user_id,