select id, plan_factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type, factory_code, prod_spc ,car_num,del_flag from pro_order insert into pro_order id, plan_factory_code, factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type, prod_spc, car_num, sync_user, from_sap_time, cegci, #{id}, #{planFactoryCode}, #{factoryCode}, #{orderType}, #{orderCode}, #{prodCode}, #{prodDesc}, #{quantity}, #{quantitySplit}, #{unit}, #{workerOrder}, #{planProDate}, #{planComplete}, #{atrr1}, #{atrr2}, #{atrr3}, #{status}, #{parentOrder}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{prodType}, #{prodSpc}, #{carNum}, #{syncUser}, GETDATE(), #{cegci}, insert into sys_sap_log (id,messsge,create_time,reqcode,method,remark,status) values( #{id},#{messsge}, #{createTime}, #{reqcode},#{method},#{remark},#{status}) update pro_order plan_factory_code = #{planFactoryCode}, factory_code = #{factoryCode}, order_type = #{orderType}, order_code = #{orderCode}, prod_code = #{prodCode}, prod_desc = #{prodDesc}, quantity = #{quantity}, quantity_split = #{quantitySplit}, unit = #{unit}, worker_order = #{workerOrder}, plan_pro_date = #{planProDate}, plan_complete = #{planComplete}, atrr1 = #{atrr1}, atrr2 = #{atrr2}, atrr3 = #{atrr3}, status = #{status}, parent_order = #{parentOrder}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, prod_type = #{prodType}, prod_spc = #{prodSpc}, from_sap_time = GETDATE(), cegci = #{cegci}, sync_user = #{syncUser}, where id = #{id} update pro_order quantity_split = #{quantitySplit}, update_by = #{updateBy}, update_time = #{updateTime}, status = #{status}, car_num = #{carNum}, where id = #{id} update pro_order set quantity_split = quantity_split-#{worker.quantitySplit}, update_time = GETDATE(), status = 'o1' where id = #{worker.orderId} update pro_order set del_flag = '1', update_time = GETDATE() where id = #{worker.orderId} update pro_order plan_factory_code = #{planFactoryCode}, factory_code = #{factoryCode}, order_type = #{orderType}, order_code = #{orderCode}, prod_code = #{prodCode}, prod_desc = #{prodDesc}, quantity = #{quantity}, quantity_split = #{quantitySplit}, unit = #{unit}, worker_order = #{workerOrder}, plan_pro_date = #{planProDate}, plan_complete = #{planComplete}, atrr1 = #{atrr1}, atrr2 = #{atrr2}, atrr3 = #{atrr3}, status = #{status}, parent_order = #{parentOrder}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, prod_type = #{prodType}, prod_spc = #{prodSpc}, where order_code = #{orderCode} and del_flag = '0' update pro_order set status = 'o1' where parent_order = #{orderCode} and del_flag = '0' update pro_order quantity += #{quantity}, quantity_split += #{quantitySplit}, update_by = #{updateBy}, update_time = #{updateTime}, status = #{status}, car_num = #{carNum}, where id = #{id} update pro_order set status = 'o2' where parent_order = #{orderCode} and del_flag = '0' update pro_order set del_flag = '1' where id in #{id} update pro_order set del_flag = '1' where id = #{id} update pro_order set del_flag = '1' where id in #{id}