select thisTab.id, thisTab.customer_name, thisTab.carrier, thisTab.dispatch_no, thisTab.driver_name, thisTab.driver_mobile, thisTab.license_plate_number, thisTab.order_time, thisTab.order_created_time, thisTab.dispatch_created_time, thisTab.key_collection_time, thisTab.estimated_departure_time, thisTab.required_arrival_time, thisTab.consignor_address, thisTab.consignee_address, thisTab.main_driver, thisTab.point_num, thisTab.transport_mode, thisTab.assistant_driver, thisTab.quantity, thisTab.dispatch_quantity, thisTab.remark, thisTab.box_num , thisTab.required_departure_time from key_collection_info AS thisTab
select count(0) from key_collection_info as thisTab
and thisTab.customer_name like concat('%', #{customerName}, '%')
and thisTab.carrier = #{carrier}
and thisTab.dispatch_no = #{dispatchNo}
and thisTab.driver_name like concat('%', #{driverName}, '%')
and thisTab.driver_mobile = #{driverMobile}
and thisTab.license_plate_number = #{licensePlateNumber}
and thisTab.order_time = #{orderTime}
and thisTab.order_created_time = #{orderCreatedTime}
and thisTab.dispatch_created_time = #{dispatchCreatedTime}
and thisTab.key_collection_time = #{keyCollectionTime}
and thisTab.estimated_departure_time = #{estimatedDepartureTime}
and thisTab.required_arrival_time = #{requiredArrivalTime}
and thisTab.consignor_address = #{consignorAddress}
and thisTab.consignee_address = #{consigneeAddress}
and thisTab.main_driver = #{mainDriver}
and thisTab.point_num = #{pointNum}
and thisTab.transport_mode = #{transportMode}
and thisTab.assistant_driver = #{assistantDriver}
and thisTab.quantity = #{quantity}
and thisTab.box_num = #{boxNum}
and thisTab.dispatch_quantity = #{dispatchQuantity}
insert into key_collection_info
customer_name,
carrier,
dispatch_no,
driver_name,
driver_mobile,
license_plate_number,
order_time,
order_created_time,
dispatch_created_time,
key_collection_time,
estimated_departure_time,
required_arrival_time,
consignor_address,
consignee_address,
main_driver,
point_num,
transport_mode,
assistant_driver,
quantity,
dispatch_quantity,
remark,
box_num,
required_departure_time,
#{customerName},
#{carrier},
#{dispatchNo},
#{driverName},
#{driverMobile},
#{licensePlateNumber},
#{orderTime},
#{orderCreatedTime},
#{dispatchCreatedTime},
#{keyCollectionTime},
#{estimatedDepartureTime},
#{requiredArrivalTime},
#{consignorAddress},
#{consigneeAddress},
#{mainDriver},
#{pointNum},
#{transportMode},
#{assistantDriver},
#{quantity},
#{dispatchQuantity},
#{remark},
#{boxNum},
#{requiredDepartureTime},
insert into key_collection_info
id,customer_name,carrier,dispatch_no,driver_name,driver_mobile,license_plate_number,order_time,order_created_time,dispatch_created_time,key_collection_time,estimated_departure_time,required_arrival_time,consignor_address,consignee_address,main_driver,point_num,transport_mode,assistant_driver,quantity,dispatch_quantity,remark,
#{item.id},#{item.customerName},#{item.carrier},#{item.dispatchNo},#{item.driverName},#{item.driverMobile},#{item.licensePlateNumber},#{item.orderTime},#{item.orderCreatedTime},#{item.dispatchCreatedTime},#{item.keyCollectionTime},#{item.estimatedDepartureTime},#{item.requiredArrivalTime},#{item.consignorAddress},#{item.consigneeAddress},#{item.mainDriver},#{item.pointNum},#{item.transportMode},#{item.assistantDriver},#{item.quantity},#{item.dispatchQuantity},#{item.remark},
update key_collection_info
customer_name = #{customerName},
carrier = #{carrier},
dispatch_no = #{dispatchNo},
driver_name = #{driverName},
driver_mobile = #{driverMobile},
license_plate_number = #{licensePlateNumber},
order_time = #{orderTime},
order_created_time = #{orderCreatedTime},
dispatch_created_time = #{dispatchCreatedTime},
key_collection_time = #{keyCollectionTime},
estimated_departure_time = #{estimatedDepartureTime},
required_arrival_time = #{requiredArrivalTime},
consignor_address = #{consignorAddress},
consignee_address = #{consigneeAddress},
main_driver = #{mainDriver},
point_num = #{pointNum},
transport_mode = #{transportMode},
assistant_driver = #{assistantDriver},
quantity = #{quantity},
dispatch_quantity = #{dispatchQuantity},
remark = #{remark},
where id = #{id}
update key_collection_info
customer_name = #{item.customerName},
carrier = #{item.carrier},
dispatch_no = #{item.dispatchNo},
driver_name = #{item.driverName},
driver_mobile = #{item.driverMobile},
license_plate_number = #{item.licensePlateNumber},
order_time = #{item.orderTime},
order_created_time = #{item.orderCreatedTime},
dispatch_created_time = #{item.dispatchCreatedTime},
key_collection_time = #{item.keyCollectionTime},
estimated_departure_time = #{item.estimatedDepartureTime},
required_arrival_time = #{item.requiredArrivalTime},
consignor_address = #{item.consignorAddress},
consignee_address = #{item.consigneeAddress},
main_driver = #{item.mainDriver},
point_num = #{item.pointNum},
transport_mode = #{item.transportMode},
assistant_driver = #{item.assistantDriver},
quantity = #{item.quantity},
dispatch_quantity = #{item.dispatchQuantity},
remark = #{item.remark},
where id = #{item.id}
delete from key_collection_info where id = #{id}
delete from key_collection_info where id in
#{id}