insert into tb_monthly_plan (monthly_plan,inspection_station_id,inspection_station_name,plan_major_id,business_type_id,
project_name,work_content,plan_category_id,tower_base_number,planned_start_time,
planned_end_time,plan_personnel,plan_car_num,plan_skilled_worker_num,plan_auxiliary_worker_num,
plan_sub_car_num,create_user,create_time,actual_working_day)
values (#{monthlyPlan},#{inspectionStationId},#{inspectionStationName},#{planMajorId},#{businessTypeId},
#{projectName},#{workContent},#{planCategoryId},#{towerBaseNumber},#{plannedStartTime},#{plannedEndTime},
#{planPersonnel},#{planCarNum},#{planSkilledWorkerNum},#{planAuxiliaryWorkerNum},#{planSubCarNum},
#{createUser},#{createTime},#{actualWorkingDay})
insert into tb_personnel_arrangement (monthly_plan_id,day,personnel_names)
values (#{monthlyPlanId},#{day},#{personnelNames})
insert into tb_workload (plan_id,workload_category_id,workload_category_name,unit_price,workload_num,data_source)
values (#{planId},#{workloadCategoryId},#{workloadCategoryName},#{unitPrice},#{workloadNum},#{dataSource})
update tb_monthly_plan
monthly_plan=#{monthlyPlan},
inspection_station_id=#{inspectionStationId},
inspection_station_name=#{inspectionStationName},
plan_major_id=#{planMajorId},
business_type_id=#{businessTypeId},
project_name=#{projectName},
work_content=#{workContent},
plan_category_id=#{planCategoryId},
tower_base_number=#{towerBaseNumber},
planned_start_time=#{plannedStartTime},
planned_end_time=#{plannedEndTime},
plan_personnel=#{planPersonnel},
plan_car_num=#{planCarNum},
plan_skilled_worker_num=#{planSkilledWorkerNum},
plan_auxiliary_worker_num=#{planAuxiliaryWorkerNum},
plan_sub_car_num=#{planSubCarNum},
update_time=#{updateTime},
update_user=#{updateUser},
actual_working_day=#{actualWorkingDay},
where monthly_plan_id = #{monthlyPlanId}
update tb_monthly_plan set is_active ='0' where monthly_plan_id = #{monthlyPlanId}
delete from tb_personnel_arrangement where monthly_plan_id = #{monthlyPlanId}
delete from tb_workload where plan_id= #{monthlyPlanId}