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.status, p.is_settled,
p.project_no, p.remark, p.submitter_id,
COALESCE(bp.name, u.user_name) as submitter_name,
p.create_by, p.create_time, p.update_by, p.update_time
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
insert into biz_project_plan
plan_id,
plan_name,
plan_direction,
plan_direction_id,
plan_category,
project_form,
design_file_url,
status,
is_settled,
project_no,
remark,
submitter_id,
#{planId},
#{planName},
#{planDirection},
#{planDirectionId},
#{planCategory},
#{projectForm},
#{designFileUrl},
#{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},
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}