wlzboy
6 天以前 09e6dc3fb7266620fafb5e341808a8eb36e080a1
ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
@@ -88,16 +88,17 @@
    </select>
    <select id="selectTaskTimeIntervals" resultMap="TaskTimeIntervalResult">
        select tv.task_id, t.create_time as start_time,
        select tv.task_id, t.actual_start_time as start_time,
               IFNULL(t.actual_end_time, NOW()) as end_time
        from sys_task_vehicle tv
        inner join sys_task t on tv.task_id = t.task_id
        where tv.vehicle_id = #{vehicleId}
          and t.del_flag = '0'
          and t.actual_end_time is not null
          and t.create_time &lt; #{endTime}
          and t.actual_end_time &gt; #{startTime}
        order by t.create_time
          and (
                (t.actual_end_time is not null and t.actual_start_time &gt; #{startTime} and t.actual_end_time &lt; #{endTime})
                or (t.actual_end_time is null and t.actual_start_time &gt; #{startTime})
        )
        order by t.actual_start_time
    </select>
        
    <insert id="insertVehicleMileageStats" parameterType="VehicleMileageStats" useGeneratedKeys="true" keyProperty="statsId">