longz
2026-06-04 da780b14b8db78043d2c0f27d3bfd73111e6d550
UserYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/LineSiteMapper.xml
@@ -27,8 +27,10 @@
        d.carColor as carColor,
        CONCAT((b.totalSeat - b.laveSeat), '/', b.totalSeat) as `number`,
        (select sum(fraction)/count(fraction) from t_order_evaluate where driverId = b.driverId) as evaluate,
        h.type as priceType,
        h.content as content,
        null as priceType,
        null as content,
        (select price5 from t_line_destination where lineId = a.lineId and state != 3 order by isMain desc, id asc limit 1) as defaultPrice5,
        (select price7 from t_line_destination where lineId = a.lineId and state != 3 order by isMain desc, id asc limit 1) as defaultPrice7,
        b.driverId as driverId,
        c.carId as carId,
        b.totalSeat as totalSeat,
@@ -42,7 +44,6 @@
        left join t_car_brand e on (d.carBrandId = e.id)
        left join t_car_model f on (d.carModelId = f.id)
        left join t_car_service g on (d.id = g.carId and g.`type` = 3)
        left join t_line_price h on (g.serverCarModelId = h.serverCarModelId and a.lineId = h.lineId)
        where b.driverId in (select driverId from t_driver_work where state = 1 and type like '%3%')
        <if test="null != lineId">
            and a.lineId = #{lineId}
@@ -55,4 +56,50 @@
        </if>
        order by a.startTime
    </select>
</mapper>
    <select id="queryDriverBySelfTripId" resultType="map">
        select
        st.id as id,
        st.id as lineShiftDriverId,
        st.driverId as driverId,
        st.startTime as startTime,
        d.headImgUrl as headImgUrl,
        CONCAT(left(d.`name`, 1), '师傅') as `name`,
        c.carLicensePlate as carLicensePlate,
        CONCAT(cb.`name`, cm.`name`) as brand,
        c.carColor as carColor,
        CONCAT('0', '/', st.seat) as `number`,
        (select sum(fraction)/count(fraction) from t_order_evaluate where driverId = st.driverId) as evaluate,
        null as priceType,
        null as content,
        d.carId as carId,
        st.seat as totalSeat,
        cs.serverCarModelId as serverCarModelId,
        '' as laveSeatNumber,
        st.seat as laveSeat
        from t_driver_self_trip st
        left join t_driver d on d.id = st.driverId
        left join t_car c on c.id = d.carId
        left join t_car_brand cb on cb.id = c.carBrandId
        left join t_car_model cm on cm.id = c.carModelId
        left join t_car_service cs on cs.carId = c.id and cs.`type` = 3
        where st.state = 1
          and st.id = #{selfTripId}
          and st.driverId in (select driverId from t_driver_work where state = 1 and type like '%3%')
        <if test="null != day">
            and DATE_FORMAT(st.day, '%Y-%m-%d') = DATE_FORMAT(#{day}, '%Y-%m-%d')
        </if>
        <if test="null != driverId">
            and st.driverId = #{driverId}
        </if>
        limit 1
    </select>
    <select id="queryChooseSeatByDriverId" resultType="java.lang.Integer">
        select ifnull(c.isCanSelectSeat, 2)
        from t_driver d
        left join t_company c on c.id = ifnull(d.companyId, d.franchiseeId)
        where d.id = #{driverId}
        limit 1
    </select>
</mapper>