select d.id, d.plant_code,d.onboard, d.company, d.device, d.staff_id, d.tds,d.post_card,d.craft, d.year, d.name, d.employeeid, d.classes, d.companysafe, d.plantsafe, d.teamsafe, d.sub, d.cracking, d.hotarea, d.coldarea, d.aeupgu, d.upscore, d.downscore, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_trainingrecords d left join sys_dept s on s.dept_id = d.dept_id SELECT seq_t_trainingrecords.NEXTVAL as id FROM DUAL insert into t_trainingrecords id, plant_code, year, name, employeeid, classes, companysafe, plantsafe, teamsafe, boiler, cracking, hotarea, coldarea, aromatic, upscore, downscore, del_flag, creater_code, createdate, updater_code, updatedate, remarks, dept_id, onboard, tds, post_card , craft, company, device, staff_id, #{id}, #{plantCode}, #{year}, #{name}, #{employeeid}, #{classes}, #{companysafe}, #{plantsafe}, #{teamsafe}, 10, 10, 10, 10, 10, #{upscore}, #{downscore}, #{delFlag}, #{createrCode}, #{createdate}, #{updaterCode}, #{updatedate}, #{remarks}, #{deptId}, #{onboard}, #{tds}, #{postCard }, #{craft}, #{company}, #{device}, #{staffId}, update t_trainingrecords plant_code = #{plantCode}, year = #{year}, name = #{name}, employeeid = #{employeeid}, classes = #{classes}, companysafe = #{companysafe}, plantsafe = #{plantsafe}, teamsafe = #{teamsafe}, sub = 10, cracking = 10, hotarea = 10, coldarea = 10, aeupgu = 10, sub = NULL, cracking = NULL, hotarea = NULL, coldarea = NULL, aeupgu = NULL, upscore = #{upscore}, downscore = #{downscore}, del_flag = #{delFlag}, creater_code = #{createrCode}, createdate = #{createdate}, updater_code = #{updaterCode}, updatedate = #{updatedate}, remarks = #{remarks}, dept_id = #{deptId}, onboard = #{onboard}, tds = #{tds}, post_card = #{postCard }, craft = #{craft}, company = #{company}, device = #{device}, staff_id = #{staffId}, where id = #{id} update t_trainingrecords set del_flag = 2 where id = #{id} update t_trainingrecords set del_flag = 2 where id in #{id}