Pu Zhibing
2025-02-08 0ecd24b3b8101c4717adc2775bbb498261253948
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCompanyMapper.xml
@@ -171,7 +171,7 @@
            sum(aa.cancelNum) as cancelNum,
            sum(aa.onlinePay) as onlinePay,
            sum(aa.offlinePay) as offlinePay,
            sum(aa.money) as money,
            ROUND(sum(aa.money), 2) as money,
            sum(aa.complaint) as complaint
            from (
            select DATE_FORMAT(insertTime, '%Y-%m-%d') as time, count(id) as register, 0 as `online`, 0 as orderNum, 0 as cancelNum, 0 as onlinePay, 0 as offlinePay, 0 as money, 0 as complaint
@@ -197,7 +197,7 @@
            </if>
            group by DATE_FORMAT(a.startTime, '%Y-%m-%d')
            union all
            <if test="1 == type">
            <if test="null == type or 1 == type">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_private_car where isDelete = 1
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -208,7 +208,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="2 == type">
            <if test="null == type or 2 == type">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_taxi where isDelete = 1
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -219,7 +219,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="3 == type">
            <if test="null == type or 3 == type">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_cross_city where isDelete = 1
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -230,7 +230,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="4 == type">
            <if test="null == type or 4 == type">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, count(id), 0, 0, 0, 0, 0 from t_order_logistics where isDelete = 1
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -241,7 +241,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 1">
            <if test="null == type or type == 1">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_private_car where isDelete = 1 and state in (10, 12)
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -252,7 +252,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 2">
            <if test="null == type or type == 2">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_taxi where isDelete = 1 and state in (10, 12)
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -263,7 +263,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 3">
            <if test="null == type or type == 3">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_cross_city where isDelete = 1 and state in (10, 12)
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -274,7 +274,7 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 4">
            <if test="null == type or type == 4">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, count(id), 0, 0, 0, 0 from t_order_logistics where isDelete = 1 and state in (10, 12)
                <if test="null != companyId">
                    and companyId = #{companyId}
@@ -285,8 +285,30 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 1">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payManner = 1
            <if test="null == type or type == 1">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payType in (1, 2, 3)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
                select DATE_FORMAT(insertTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(money), 0 from t_order_cancel where orderType = 1
                <if test="null != companyId">
                    and orderId in (select id from t_order_private_car where isDelete = 1 and companyId = #{companyId} and state = 10)
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(insertTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(insertTime, '%Y-%m-%d')
                union all
            </if>
            <if test="null == type or type == 2">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payType in (1, 2, 3)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
@@ -296,8 +318,8 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 2">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payManner = 1
            <if test="null == type or type == 3">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payType in (1, 2, 3)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
@@ -307,8 +329,28 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 3">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payManner = 1
            <if test="null == type or type == 4">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payType in (1, 2, 3)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
                select DATE_FORMAT(insertTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(money), 0 from t_order_cancel where orderType = 4
                <if test="null != companyId">
                    and orderId in (select id from t_order_logistics where isDelete = 1 and companyId = #{companyId} and state = 10)
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(insertTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(insertTime, '%Y-%m-%d')
                union all
            </if>
            <if test="null == type or type == 1">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_private_car where isDelete = 1 and payType in (4)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
@@ -318,8 +360,8 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 4">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, count(id), 0, sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payManner = 1
            <if test="null == type or type == 2">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_taxi where isDelete = 1 and payType in (4)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
@@ -329,8 +371,8 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 1">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_private_car where isDelete = 1 and payManner = 2
            <if test="null == type or type == 3">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_cross_city where isDelete = 1 and payType in (4)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
@@ -340,30 +382,8 @@
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 2">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_taxi where isDelete = 1 and payManner = 2
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 3">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_cross_city where isDelete = 1 and payManner = 2
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>
                <if test="null != start and '' != start and null != end and '' != end">
                    and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end}
                </if>
                group by DATE_FORMAT(travelTime, '%Y-%m-%d')
                union all
            </if>
            <if test="type == 4">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), 0, 0 from t_order_logistics where isDelete = 1 and payManner = 2
            <if test="null == type or type == 4">
                select DATE_FORMAT(travelTime, '%Y-%m-%d'), 0, 0, 0, 0, 0, count(id), sum(payMoney), 0 from t_order_logistics where isDelete = 1 and payType in (4)
                <if test="null != companyId">
                    and companyId = #{companyId}
                </if>