select d.id, d.plant_code, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, s.dept_name from t_staffmgr d
left join sys_dept s on s.dept_id = d.dept_id
SELECT seq_t_staffmgr.NEXTVAL as id FROM DUAL
insert into t_staffmgr
id,
plant_code,
staffid,
name,
sex,
birthday,
unit,
team,
actualpost,
contact,
education,
en_ability,
mail,
accident_num,
del_flag,
creater_code,
createdate,
updater_code,
updatedate,
dept_id,
remarks,
skill_score,
photo,
p_id,
special_duty,
#{id},
#{plantCode},
#{staffid},
#{name},
#{sex},
#{birthday},
#{unit},
#{team},
#{actualpost},
#{contact},
#{education},
#{enAbility},
#{mail},
#{accidentNum},
#{delFlag},
#{createrCode},
#{createdate},
#{updaterCode},
#{updatedate},
#{deptId},
#{remarks},
#{skillScore},
#{photo},
#{pId},
#{specialDuty},
update t_staffmgr
plant_code = #{plantCode},
staffid = #{staffid},
name = #{name},
sex = #{sex},
birthday = #{birthday},
unit = #{unit},
team = #{team},
actualpost = #{actualpost},
contact = #{contact},
education = #{education},
en_ability = #{enAbility},
accident_num = #{accidentNum},
mail = #{mail},
skill_score = #{skillScore},
del_flag = #{delFlag},
creater_code = #{createrCode},
createdate = #{createdate},
updater_code = #{updaterCode},
updatedate = #{updatedate},
dept_id = #{deptId},
remarks = #{remarks},
photo = #{photo},
p_id = #{pId},
special_duty = #{specialDuty},
where id = #{id}
update t_staffmgr set del_flag = 2 where id = #{id}
update t_staffmgr set del_flag = 9 where id = #{id}
update t_staffmgr set del_flag = 0 where id = #{id}
update t_staffmgr set del_flag = 2 where id in
#{id}