select thisTab.id, thisTab.plan_code, thisTab.plan_name, thisTab.customer_id, thisTab.customer_name, thisTab.project_id, thisTab.contract_id, thisTab.project_name, thisTab.order_type, thisTab.sign_type, thisTab.vehicle_provider_id, thisTab.contract_name, thisTab.is_urgent, thisTab.shipper_id, thisTab.shipper_mobile, thisTab.vehicle_provider_name, thisTab.shipper_address, thisTab.shipper_region_code, thisTab.receiver_id, thisTab.shipper_name, thisTab.receiver_mobile, thisTab.receiver_address, thisTab.receiver_region_code, thisTab.vehicle_type_ids, thisTab.plan_start_time, thisTab.plan_end_time, thisTab.receiver_name, thisTab.plan_total_count, thisTab.allow_over_dispatch, thisTab.required_load_time, thisTab.required_unload_time, thisTab.transport_type, thisTab.load_method, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_plan_order AS thisTab
select count(0) from tms_plan_order as thisTab
and thisTab.plan_code = #{planCode}
and thisTab.plan_name like concat('%', #{planName}, '%')
and thisTab.customer_id = #{customerId}
and thisTab.customer_name like concat('%', #{customerName}, '%')
and thisTab.project_id = #{projectId}
and thisTab.contract_id = #{contractId}
and thisTab.project_name like concat('%', #{projectName}, '%')
and thisTab.order_type = #{orderType}
and thisTab.sign_type = #{signType}
and thisTab.vehicle_provider_id = #{vehicleProviderId}
and thisTab.contract_name like concat('%', #{contractName}, '%')
and thisTab.is_urgent = #{isUrgent}
and thisTab.shipper_id = #{shipperId}
and thisTab.vehicle_provider_name like concat('%', #{vehicleProviderName}, '%')
and thisTab.receiver_id = #{receiverId}
and thisTab.shipper_name like concat('%', #{shipperName}, '%')
and thisTab.receiver_name like concat('%', #{receiverName}, '%')
and thisTab.status = #{status}
insert into tms_plan_order
plan_code,
plan_name,
customer_id,
customer_name,
project_id,
contract_id,
project_name,
order_type,
sign_type,
vehicle_provider_id,
contract_name,
is_urgent,
shipper_id,
shipper_mobile,
vehicle_provider_name,
shipper_address,
shipper_region_code,
receiver_id,
shipper_name,
receiver_mobile,
receiver_address,
receiver_region_code,
vehicle_type_ids,
plan_start_time,
plan_end_time,
receiver_name,
plan_total_count,
allow_over_dispatch,
required_load_time,
required_unload_time,
transport_type,
load_method,
status,
create_by,
create_time,
update_by,
update_time,
remark,
#{planCode},
#{planName},
#{customerId},
#{customerName},
#{projectId},
#{contractId},
#{projectName},
#{orderType},
#{signType},
#{vehicleProviderId},
#{contractName},
#{isUrgent},
#{shipperId},
#{shipperMobile},
#{vehicleProviderName},
#{shipperAddress},
#{shipperRegionCode},
#{receiverId},
#{shipperName},
#{receiverMobile},
#{receiverAddress},
#{receiverRegionCode},
#{vehicleTypeIds},
#{planStartTime},
#{planEndTime},
#{receiverName},
#{planTotalCount},
#{allowOverDispatch},
#{requiredLoadTime},
#{requiredUnloadTime},
#{transportType},
#{loadMethod},
#{status},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
insert into tms_plan_order
id,plan_code,plan_name,customer_id,customer_name,project_id,contract_id,project_name,order_type,sign_type,vehicle_provider_id,contract_name,is_urgent,shipper_id,shipper_mobile,vehicle_provider_name,shipper_address,shipper_region_code,receiver_id,shipper_name,receiver_mobile,receiver_address,receiver_region_code,vehicle_type_ids,plan_start_time,plan_end_time,receiver_name,plan_total_count,allow_over_dispatch,required_load_time,required_unload_time,transport_type,load_method,status,create_by,create_time,update_by,update_time,remark,
#{item.id},#{item.planCode},#{item.planName},#{item.customerId},#{item.customerName},#{item.projectId},#{item.contractId},#{item.projectName},#{item.orderType},#{item.signType},#{item.vehicleProviderId},#{item.contractName},#{item.isUrgent},#{item.shipperId},#{item.shipperMobile},#{item.vehicleProviderName},#{item.shipperAddress},#{item.shipperRegionCode},#{item.receiverId},#{item.shipperName},#{item.receiverMobile},#{item.receiverAddress},#{item.receiverRegionCode},#{item.vehicleTypeIds},#{item.planStartTime},#{item.planEndTime},#{item.receiverName},#{item.planTotalCount},#{item.allowOverDispatch},#{item.requiredLoadTime},#{item.requiredUnloadTime},#{item.transportType},#{item.loadMethod},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
update tms_plan_order
plan_code = #{planCode},
plan_name = #{planName},
customer_id = #{customerId},
customer_name = #{customerName},
project_id = #{projectId},
contract_id = #{contractId},
project_name = #{projectName},
order_type = #{orderType},
sign_type = #{signType},
vehicle_provider_id = #{vehicleProviderId},
contract_name = #{contractName},
is_urgent = #{isUrgent},
shipper_id = #{shipperId},
shipper_mobile = #{shipperMobile},
vehicle_provider_name = #{vehicleProviderName},
shipper_address = #{shipperAddress},
shipper_region_code = #{shipperRegionCode},
receiver_id = #{receiverId},
shipper_name = #{shipperName},
receiver_mobile = #{receiverMobile},
receiver_address = #{receiverAddress},
receiver_region_code = #{receiverRegionCode},
vehicle_type_ids = #{vehicleTypeIds},
plan_start_time = #{planStartTime},
plan_end_time = #{planEndTime},
receiver_name = #{receiverName},
plan_total_count = #{planTotalCount},
allow_over_dispatch = #{allowOverDispatch},
required_load_time = #{requiredLoadTime},
required_unload_time = #{requiredUnloadTime},
transport_type = #{transportType},
load_method = #{loadMethod},
status = #{status},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark},
where id = #{id}
update tms_plan_order
plan_code = #{item.planCode},
plan_name = #{item.planName},
customer_id = #{item.customerId},
customer_name = #{item.customerName},
project_id = #{item.projectId},
contract_id = #{item.contractId},
project_name = #{item.projectName},
order_type = #{item.orderType},
sign_type = #{item.signType},
vehicle_provider_id = #{item.vehicleProviderId},
contract_name = #{item.contractName},
is_urgent = #{item.isUrgent},
shipper_id = #{item.shipperId},
shipper_mobile = #{item.shipperMobile},
vehicle_provider_name = #{item.vehicleProviderName},
shipper_address = #{item.shipperAddress},
shipper_region_code = #{item.shipperRegionCode},
receiver_id = #{item.receiverId},
shipper_name = #{item.shipperName},
receiver_mobile = #{item.receiverMobile},
receiver_address = #{item.receiverAddress},
receiver_region_code = #{item.receiverRegionCode},
vehicle_type_ids = #{item.vehicleTypeIds},
plan_start_time = #{item.planStartTime},
plan_end_time = #{item.planEndTime},
receiver_name = #{item.receiverName},
plan_total_count = #{item.planTotalCount},
allow_over_dispatch = #{item.allowOverDispatch},
required_load_time = #{item.requiredLoadTime},
required_unload_time = #{item.requiredUnloadTime},
transport_type = #{item.transportType},
load_method = #{item.loadMethod},
status = #{item.status},
create_by = #{item.createBy},
create_time = #{item.createTime},
update_by = #{item.updateBy},
update_time = #{item.updateTime},
remark = #{item.remark},
where id = #{item.id}
delete from tms_plan_order where id = #{id}
delete from tms_plan_order where id in
#{id}