insert into business_inspection_task( plan_user_id,act_ins_time,plan_ins_time,act_user_name,operate,sign_type,inspection_plan_id,plan_user_name,community_id,b_id,act_user_id,task_id,state ) values ( #{planUserId},#{actInsTime},#{planInsTime},#{actUserName},#{operate},#{signType},#{inspectionPlanId},#{planUserName},#{communityId},#{bId},#{actUserId},#{taskId},#{state} ) insert into inspection_task( plan_user_id,act_ins_time,plan_ins_time,status_cd,act_user_name,sign_type,inspection_plan_id,plan_user_name,community_id,b_id,act_user_id,task_id,state ) select t.plan_user_id,t.act_ins_time,t.plan_ins_time,'0',t.act_user_name,t.sign_type,t.inspection_plan_id,t.plan_user_name,t.community_id,t.b_id,t.act_user_id,t.task_id,t.state from business_inspection_task t where 1=1 and t.plan_user_id= #{planUserId} and t.act_ins_time= #{actInsTime} and t.plan_ins_time= #{planInsTime} and t.act_user_name= #{actUserName} and t.operate= 'ADD' and t.sign_type= #{signType} and t.inspection_plan_id= #{inspectionPlanId} and t.plan_user_name= #{planUserName} and t.community_id= #{communityId} and t.b_id= #{bId} and t.act_user_id= #{actUserId} and t.task_id= #{taskId} and t.state= #{state} update inspection_task t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.plan_user_id= #{planUserId} , t.state= #{state} , t.act_ins_time= #{actInsTime} , t.plan_ins_time= #{planInsTime} , t.act_user_name= #{actUserName} , t.sign_type= #{signType} , t.inspection_plan_id= #{inspectionPlanId} , t.plan_user_name= #{planUserName} , t.community_id= #{communityId} , t.act_user_id= #{actUserId} where 1=1 and t.b_id= #{bId} and t.task_id= #{taskId} insert into inspection_task( plan_user_id,plan_ins_time,sign_type,inspection_plan_id,plan_user_name,community_id,b_id,task_id,state,ip_staff_id ) (#{task.planUserId},#{task.planInsTime},#{task.signType},#{task.inspectionPlanId},#{task.planUserName},#{task.communityId},'-1',#{task.taskId},'20200405',#{task.ipStaffId}) insert into inspection_task_detail( task_detail_id,b_id,community_id,task_id,inspection_id,inspection_name,state ) (#{task.taskDetailId},'-1',#{task.communityId},#{task.taskId},#{task.inspectionId},#{task.inspectionName},'20200405')