select
d.year_plan_id,
d.date_of_completion,
d.overall_comment,
d.score,
d.id,
d.staff_id,
d.APPROVE_STATUS,
u.nick_name,
d.plant_name,
d.del_flag,
d.createdate,
d.updatedate,
d.dept_id,
d.start_date,
d.end_date,
d.class_hour,
d.class_content,
d.study_state,
u1.nick_name as updateBy,
u2.nick_name as createBy,
s.dept_name,
suc.MENTOR_STAFF_ID
from t_st_plan d
left join sys_dept s on s.dept_id = d.dept_id
left join sys_user u on d.staff_id = u.staffid
LEFT JOIN SYS_USER u1 on d.updater_code = u1.USER_ID
LEFT JOIN SYS_USER u2 on d.creater_code = u2.USER_ID
left join T_ST_SUCCESSOR suc on d.STAFF_ID = suc.STAFF_ID
SELECT seq_t_st_plan.NEXTVAL as id FROM DUAL
insert into t_st_plan
id,staff_id,plant_name,del_flag,creater_code,createdate,updater_code,updatedate,dept_id,start_date,end_date,class_hour,class_content,study_state,APPROVE_STATUS,year_plan_id,#{id},#{staffId},#{plantName},#{delFlag},#{createrCode},#{createdate},#{updaterCode},#{updatedate},#{deptId},#{startDate},#{endDate},#{classHour},#{classContent},#{studyState},#{approveStatus},#{yearPlanId},
update t_st_plan
staff_id = #{staffId},plant_name = #{plantName},del_flag = #{delFlag},creater_code = #{createrCode},createdate = #{createdate},updater_code = #{updaterCode},updatedate = #{updatedate},dept_id = #{deptId},start_date = #{startDate},end_date = #{endDate},class_hour = #{classHour},class_content = #{classContent},study_state = #{studyState},
score = #{score},
date_of_completion = SYSDATE,
overall_comment = #{overallComment},approve_status = #{approveStatus},date_of_completion = #{dateOfCompletion}
where id = #{id}
update t_st_plan set del_flag = 2 where id = #{id}
update t_st_plan set del_flag = 2 where id in
#{id}