Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTaxiMapper.xml
@@ -64,7 +64,7 @@
    <!--根据条件查询出租车订单列表-->
    <select id="getTaxiOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
        SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.`name`,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car,
        SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, ' ', di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car,
        ot.* FROM t_order_taxi as ot
        LEFT JOIN t_user as ui on ui.id = ot.userId
        LEFT JOIN t_driver as di on di.id = ot.driverId
@@ -125,7 +125,7 @@
        case when ot.payType = 1 then '微信'
        when ot.payType = 2 then '支付宝'
        when ot.payType = 3 then '余额' else '' end as payTypeStr,
        CONCAT(di.`name`,'-',di.phone) as driver,
        CONCAT(di.firstName, ' ', di.lastName,'-',di.phone) as driver,
        CONCAT(cb.`name`,'-',ci.carLicensePlate) as car,
        cc.`name` as companyName,ot.*
         FROM t_order_taxi as ot
@@ -146,7 +146,7 @@
        <where>
            (dd.companyId = #{companyId} or dd.franchiseeId = #{companyId}) and dd.authState = 2 and dd.state = 2 and (ds.id is not null ) and (dd.carId is not null)
            <if test="name != null and name != ''">
                and dd.name LIKE CONCAT('%',#{name},'%')
                and CONCAT(dd.firstName, ' ', dd.lastName) LIKE CONCAT('%',#{name},'%')
            </if>
            <if test="phone != null and phone != ''">
                and dd.phone LIKE CONCAT('%',#{phone},'%')
@@ -207,7 +207,7 @@
    <!--查询所有总交易金额-->
    <select id="getAllTradeMoney" resultType="java.lang.Double">
        SELECT IFNULL(SUM(num),0) as value FROM (
        SELECT ROUND(IFNULL(SUM(num),0), 2) as value FROM (
        (SELECT IFNULL(SUM(payMoney),0) as num FROM t_order_taxi where FIND_IN_SET(state,'8,9')
        <if test="companyId != null and companyId != ''">
            and companyId = #{companyId}
@@ -243,12 +243,34 @@
            AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
        </if>
        )
        union all
        select IFNULL(SUM(money),0) as num from t_order_cancel where state = 2
        <if test="companyId != null and companyId != ''">
            and (
            if(orderType = 1, orderId in (select id from t_order_private_car where state = 10 and companyId = #{companyId}),
            orderId in (select id from t_order_logistics where state = 10 and companyId = #{companyId}))
            )
        </if>
        <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
            AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
        </if>
        union all
        select IFNULL(SUM(money),0) as num from t_reassign where state in (2, 3)
        <if test="companyId != null and companyId != ''">
            and (
            if(orderType = 1, orderId in (select id from t_order_private_car where state = 10 and companyId = #{companyId}),
            orderId in (select id from t_order_logistics where state = 10 and companyId = #{companyId}))
            )
        </if>
        <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
            AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
        </if>
        ) as o
    </select>
    <!--查询所有总收益-->
    <select id="getAllIncomeMoney" resultType="java.lang.Double">
        SELECT IFNULL(SUM(money),0) as value FROM t_income where userType = 1
        SELECT ROUND(IFNULL(SUM(money),0), 2) as value FROM t_income where userType = 1
        <if test="companyId != null and companyId != ''">
            and objectId = #{companyId}
        </if>