hi indresh..
beyond sample table that i gave.
explain matching from table shipment_assignment
where begin_date_time , origin_id and destination_id will search and matching date_time on table event_with_location where event_type 31 to end_date_time with event_type 30 AS end_date_time for fill end_date_time to table shipment_assignment
if look on table shipment_assignment for :
begin_date_time = 2017-06-17 00:00:00
origin_id = 105945
destination_id = 103024
so date_time on table event_with_location macth with begin_date_time , event_type and geofence_name where geofence_name is 'pool cikarang' match with origin_id = 105945
then match event_type = 30 with geofence_name 'FACTORY UNILEVER match with destination_id = 103024 then date_time on this field will update to end_date_time on table shipment_assignment
and i think all the combination should having by vehicle_id
![shipment_assignment](https://ibb.co/hO1LaF)
![shipment_assignment](https://ibb.co/ehZTUa)
![geofence](https://ibb.co/nEg8Ua)
![result](https://ibb.co/hZg8Ua)
Thanks...
I think this is My Detail..