Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml
@@ -84,71 +84,7 @@
    <select id="queryIdleDriver" resultType="Driver">
        select
        id as id,
        account as account,
        jobNumber as jobNumber,
        phone as phone,
        phoneOperator as phoneOperator,
        password as password,
        lastName as lastName,
        firstName as firstName,
        sex as sex,
        idCard as idCard,
        companyId as companyId,
        franchiseeId as franchiseeId,
        headImgUrl as headImgUrl,
        faceImgUrl as faceImgUrl,
        idCardImgUrl1 as idCardImgUrl1,
        idCardImgUrl2 as idCardImgUrl2,
        placeOfEmployment as placeOfEmployment,
        birthday as birthday,
        bankCardNumber as bankCardNumber,
        driverNationality as driverNationality,
        driverNation as driverNation,
        driverMaritalStatus as driverMaritalStatus,
        driverLanguageLevel as driverLanguageLevel,
        driverEducation as driverEducation,
        driverCensus as driverCensus,
        driverAddress as driverAddress,
        driverContactAddress as driverContactAddress,
        driverAge as driverAge,
        driveCard as driveCard,
        driveCardImgUrl1 as driveCardImgUrl1,
        driveCardImgUrl2 as driveCardImgUrl2,
        driverType as driverType,
        getDriverLicenseDate as getDriverLicenseDate,
        driverLicenseOn as driverLicenseOn,
        driverLicenseOff as driverLicenseOff,
        taxiDriver as taxiDriver,
        taxiAptitudeCard as taxiAptitudeCard,
        networkCarlssueImg as networkCarlssueImg,
        networkCarlssueOrganization as networkCarlssueOrganization,
        networkCarlssueDate as networkCarlssueDate,
        getNetworkCarProofDate as getNetworkCarProofDate,
        networkCarProofOn as networkCarProofOn,
        networkCarProofOff as networkCarProofOff,
        registerDate as registerDate,
        fullTimeDriver as fullTimeDriver,
        inDriverBlacklist as inDriverBlacklist,
        commercialType as commercialType,
        contractCompany as contractCompany,
        contractOn as contractOn,
        contractOff as contractOff,
        emergencyContact as emergencyContact,
        emergencyContactPhone as emergencyContactPhone,
        emergencyContactAddress as emergencyContactAddress,
        remark as remark,
        isPlatCar as isPlatCar,
        carId as carId,
        authState as authState,
        state as state,
        addType as addType,
        balance as balance,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        *
        from t_driver
        where flag != 3 and state = 2 and authState = 2
        <if test="null != companyId">
@@ -175,71 +111,7 @@
    <select id="queryIdleDriver_" resultType="Driver">
        select * from (
        select
        id as id,
        account as account,
        jobNumber as jobNumber,
        phone as phone,
        phoneOperator as phoneOperator,
        password as password,
        lastName as lastName,
        firstName as firstName,
        sex as sex,
        idCard as idCard,
        companyId as companyId,
        franchiseeId as franchiseeId,
        headImgUrl as headImgUrl,
        faceImgUrl as faceImgUrl,
        idCardImgUrl1 as idCardImgUrl1,
        idCardImgUrl2 as idCardImgUrl2,
        placeOfEmployment as placeOfEmployment,
        birthday as birthday,
        bankCardNumber as bankCardNumber,
        driverNationality as driverNationality,
        driverNation as driverNation,
        driverMaritalStatus as driverMaritalStatus,
        driverLanguageLevel as driverLanguageLevel,
        driverEducation as driverEducation,
        driverCensus as driverCensus,
        driverAddress as driverAddress,
        driverContactAddress as driverContactAddress,
        driverAge as driverAge,
        driveCard as driveCard,
        driveCardImgUrl1 as driveCardImgUrl1,
        driveCardImgUrl2 as driveCardImgUrl2,
        driverType as driverType,
        getDriverLicenseDate as getDriverLicenseDate,
        driverLicenseOn as driverLicenseOn,
        driverLicenseOff as driverLicenseOff,
        taxiDriver as taxiDriver,
        taxiAptitudeCard as taxiAptitudeCard,
        networkCarlssueImg as networkCarlssueImg,
        networkCarlssueOrganization as networkCarlssueOrganization,
        networkCarlssueDate as networkCarlssueDate,
        getNetworkCarProofDate as getNetworkCarProofDate,
        networkCarProofOn as networkCarProofOn,
        networkCarProofOff as networkCarProofOff,
        registerDate as registerDate,
        fullTimeDriver as fullTimeDriver,
        inDriverBlacklist as inDriverBlacklist,
        commercialType as commercialType,
        contractCompany as contractCompany,
        contractOn as contractOn,
        contractOff as contractOff,
        emergencyContact as emergencyContact,
        emergencyContactPhone as emergencyContactPhone,
        emergencyContactAddress as emergencyContactAddress,
        remark as remark,
        isPlatCar as isPlatCar,
        carId as carId,
        authState as authState,
        state as state,
        addType as addType,
        balance as balance,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        *
        from t_driver
        where flag != 3 and state = 2 and authState = 2
        <if test="null != companyId">
@@ -258,8 +130,8 @@
        select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        and id in (select driverId from t_driver_orders where `type` = #{type})
        and id not in (select driverId from t_settlement_record where paymentStatus = 1)
        and carId in (select carId from t_car_service where `type` = #{type}
        <if test="null != serverCarModelId">
            and serverCarModelId = #{serverCarModelId}
        </if>
@@ -285,9 +157,8 @@
        CONCAT(F.`name`, d.`name`,  '.', c.carColor) as carName,
        (select sum(fraction) / count(id) from t_order_evaluate where driverId = a.id) as score,
        (
        (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_taxi where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id)
        (select count(id) from t_order_private_car where driverId = a.id and state in (6, 7, 8, 9)) +
        (select count(id) from t_order_logistics where driverId = a.id and state in (6, 7, 8, 9))
        ) as num,
        DATE_FORMAT(b.startServiceTime, '%m月%d日 %H:%i') as `time`,
        b.startAddress as `start`,
@@ -325,7 +196,7 @@
        a.idCard as idcode,
        b.carLicensePlate as licensePlate,
        b.carColor as carColor,
        CONCAT(d.`name`, c.`name`) as brand,
        CONCAT(d.`name`, " ", c.`name`) as brand,
        if((select count(id) from t_driver_work where state = 1 and driverId = a.id) = 0, 1, if(
        (
        (select count(id) from t_order_private_car where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id) +
@@ -333,9 +204,8 @@
        (select count(id) from t_order_cross_city where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id)
        ) = 0, 2, 3)) as state,
        (
        (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_taxi where state in (7, 8, 9) and driverId = a.id) +
        (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id)
        (select count(id) from t_order_private_car where driverId = a.id and state in (6, 7, 8, 9)) +
        (select count(id) from t_order_logistics where driverId = a.id and state in (6, 7, 8, 9))
        ) as orderNum,
        ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(id) from t_order_evaluate where driverId = a.id)) as fraction
        from t_driver a