select p.plan_id, p.plan_name, p.plan_direction, p.plan_direction_id, s.title as plan_direction_title, p.plan_category, p.project_form, p.design_file_url, p.subject_direction, p.status, p.is_settled, p.project_no, p.remark, p.audit_opinion, p.audit_by, p.audit_time, p.submitter_id, COALESCE(bp.name, u.user_name) as submitter_name, proj.project_name as project_name, p.create_by, p.create_time, p.update_by, p.update_time, p.is_deleted from biz_project_plan p left join biz_special_plan s on s.id = p.plan_direction_id left join sys_user u on u.user_id = p.submitter_id left join biz_person bp on bp.user_id = u.user_id left join biz_project proj on proj.project_no = p.project_no and proj.is_deleted = 0 insert into biz_project_plan plan_id, plan_name, plan_direction, plan_direction_id, plan_category, project_form, design_file_url, subject_direction, status, is_settled, project_no, remark, submitter_id, #{planId}, #{planName}, #{planDirection}, #{planDirectionId}, #{planCategory}, #{projectForm}, #{designFileUrl}, #{subjectDirection}, #{status}, #{isSettled}, #{projectNo}, #{remark}, #{submitterId}, update biz_project_plan plan_name = #{planName}, plan_direction = #{planDirection}, plan_direction_id = #{planDirectionId}, plan_category = #{planCategory}, project_form = #{projectForm}, design_file_url = #{designFileUrl}, subject_direction = #{subjectDirection}, is_settled = #{isSettled}, project_no = #{projectNo}, audit_opinion = #{auditOpinion}, audit_by = #{auditBy}, audit_time = #{auditTime}, status = #{status}, remark = #{remark}, submitter_id = #{submitterId}, where plan_id = #{planId} delete from biz_project_plan where plan_id = #{planId} delete from biz_project_plan where plan_id in #{planId} update biz_project_plan set is_deleted = 1 where project_no = #{projectNo}