select thisTab.id, thisTab.driver_id, thisTab.dispatch_id, thisTab.status , thisTab.vehicle_id from tms_driver_dispatch AS thisTab select count(0) from tms_driver_dispatch as thisTab and thisTab.driver_id = #{driverId} and thisTab.dispatch_id = #{dispatchId} and thisTab.status = #{status} and thisTab.vehicle_id = #{vehicleId} insert into tms_driver_dispatch driver_id, dispatch_id, status, vehicle_id, #{driverId}, #{dispatchId}, #{status}, #{vehicleId}, insert into tms_driver_dispatch id,driver_id,dispatch_id,status,vehicle_id, #{item.id},#{item.driverId},#{item.dispatchId},#{item.status},#{item.vehicleId}, update tms_driver_dispatch driver_id = #{driverId}, dispatch_id = #{dispatchId}, status = #{status}, vehicle_id = #{vehicleId}, where id = #{id} update tms_driver_dispatch driver_id = #{item.driverId}, dispatch_id = #{item.dispatchId}, status = #{item.status}, vehicle_id = #{item.vehicleId}, where id = #{item.id} delete from tms_driver_dispatch where id = #{id} delete from tms_driver_dispatch where id in #{id}