select d.id, u1.nick_name confirm1_name, u2.nick_name confirm2_name, d.sub_id, d.approve_id, d.unit, d.position, d.pid_no, d.filter_number, d.cleaning, d.back_loading, d.confirmer1, d.confirmer2, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_pump_cleaning d left join sys_dept s on s.dept_id = d.dept_id left join sys_user u1 on u1.user_id = d.CONFIRMER1 left join sys_user u2 on u2.user_id = d.CONFIRMER2 SELECT seq_t_pssr_pump_cleaning.NEXTVAL as id FROM DUAL insert into t_pssr_pump_cleaning id, sub_id, approve_id, unit, position, pid_no, filter_number, cleaning, back_loading, confirmer1, confirmer2, confirmation_date, del_flag, creater_code, createdate, updater_code, updatedate, dept_id, remarks, approve_status, #{id}, #{subId}, #{approveId}, #{unit}, #{position}, #{pidNo}, #{filterNumber}, #{cleaning}, #{backLoading}, #{confirmer1}, #{confirmer2}, #{confirmationDate}, #{delFlag}, #{createrCode}, #{createdate}, #{updaterCode}, #{updatedate}, #{deptId}, #{remarks}, #{approveStatus}, update t_pssr_pump_cleaning approve_status = #{approveStatus}, updater_code = #{updaterCode}, updatedate = #{updatedate}, where sub_id= #{subId} and APPROVE_STATUS=0 update t_pssr_pump_cleaning sub_id = #{subId}, approve_id = #{approveId}, unit = #{unit}, position = #{position}, pid_no = #{pidNo}, filter_number = #{filterNumber}, cleaning = #{cleaning}, back_loading = #{backLoading}, confirmer1 = #{confirmer1}, confirmer2 = #{confirmer2}, confirmation_date = #{confirmationDate}, del_flag = #{delFlag}, creater_code = #{createrCode}, createdate = #{createdate}, updater_code = #{updaterCode}, updatedate = #{updatedate}, dept_id = #{deptId}, remarks = #{remarks}, approve_status = #{approveStatus}, where id = #{id} update t_pssr_pump_cleaning confirmer1 = #{confirmer1}, confirmer2 = #{confirmer2}, confirmation_date = #{confirmationDate}, creater_code = #{createrCode}, createdate = #{createdate}, updater_code = #{updaterCode}, updatedate = #{updatedate}, remarks = #{remarks}, where id in #{id} update t_pssr_pump_cleaning set del_flag = 2 where id = #{id} update t_pssr_pump_cleaning set del_flag = 2 where id in #{id}