select d.id, d.staff_id,u.nick_name, d.name,d.plan_year, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.approve_status ,s.dept_name from t_st_yearplan 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 T_ST_SUCCESSOR suc on d.STAFF_ID = suc.STAFF_ID
SELECT seq_t_st_yearplan.NEXTVAL as id FROM DUAL
insert into t_st_yearplan
id,staff_id,name,del_flag,creater_code,createdate,updater_code,updatedate,dept_id,approve_status,plan_year,#{id},#{staffId},#{name},#{delFlag},#{createrCode},#{createdate},#{updaterCode},#{updatedate},#{deptId},#{approveStatus},#{planYear},
update t_st_yearplan
staff_id = #{staffId},name = #{name},del_flag = #{delFlag},creater_code = #{createrCode},createdate = #{createdate},updater_code = #{updaterCode},updatedate = #{updatedate},dept_id = #{deptId},approve_status = #{approveStatus},plan_year = #{planYear},
where id = #{id}
update t_st_yearplan set del_flag = 2 where id = #{id}
update t_st_yearplan set del_flag = 2 where staff_id = #{staffId}
update t_st_yearplan set del_flag = 2 where id in
#{id}