|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectCarByYear" resultType="com.hnac.hzims.safeproduct.vo.CarMilesYearVO"> |
|
|
|
|
SELECT |
|
|
|
|
DISTINCT t1.unit, t1.car_brand, t1.plate_number, t1.create_time |
|
|
|
|
DISTINCT t1.unit, t1.car_brand, t1.plate_number, t1.create_time, t1.create_user, t1.create_dept |
|
|
|
|
FROM |
|
|
|
|
hzims_car t1 |
|
|
|
|
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id |
|
|
|
@ -22,7 +22,8 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectMilesByCar" resultType="com.hnac.hzims.safeproduct.dto.CarMilesYearDTO"> |
|
|
|
|
SELECT |
|
|
|
|
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles |
|
|
|
|
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles, |
|
|
|
|
t1.create_user, t1.create_dept |
|
|
|
|
FROM |
|
|
|
|
hzims_car t1 |
|
|
|
|
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id |
|
|
|
|