select d.id, d.plant_code, d.time, d.team, d.reporter, d.reportno, d.abnormalphen, d.treatprocess, d.reason, d.measures, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_abnormalreport d left join sys_dept s on s.dept_id = d.dept_id SELECT seq_t_abnormalreport.NEXTVAL as id FROM DUAL insert into t_abnormalreport id, plant_code, time, team, reporter, reportno, abnormalphen, treatprocess, reason, measures, del_flag, creater_code, createdate, updater_code, updatedate, remarks, dept_id, #{id}, #{plantCode}, #{time}, #{team}, #{reporter}, #{reportno}, #{abnormalphen}, #{treatprocess}, #{reason}, #{measures}, #{delFlag}, #{createrCode}, #{createdate}, #{updaterCode}, #{updatedate}, #{remarks}, #{deptId}, update t_abnormalreport plant_code = #{plantCode}, time = #{time}, team = #{team}, reporter = #{reporter}, reportno = #{reportno}, abnormalphen = #{abnormalphen}, treatprocess = #{treatprocess}, reason = #{reason}, measures = #{measures}, del_flag = #{delFlag}, creater_code = #{createrCode}, createdate = #{createdate}, updater_code = #{updaterCode}, updatedate = #{updatedate}, remarks = #{remarks}, dept_id = #{deptId}, where id = #{id} update t_abnormalreport set del_flag = 2 where id = #{id} update t_abnormalreport set del_flag = 2 where id in #{id}