select d.id, d.plant_code, d.name, d.employeeid, d.classes, d.post, d.idtype, d.container_idnum, d.boiler, d.container, d.pipe, d.alkylation, d.aromatic, d.recertificatedate, d.validity, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.pipe_idnum, d.alkylation_idnum, d.pipe_date, d.alkylation_date, d.container_date, d.boiler_idnum, d.boiler_date ,s.dept_name from t_byx_worklicense d
left join sys_dept s on s.dept_id = d.dept_id
SELECT seq_t_byx_worklicense.NEXTVAL as id FROM DUAL
insert into t_byx_worklicense
id,
plant_code,
name,
employeeid,
classes,
post,
idtype,
container_idnum,
boiler,
container,
pipe,
alkylation,
aromatic,
recertificatedate,
validity,
del_flag,
creater_code,
createdate,
updater_code,
updatedate,
remarks,
dept_id,
pipe_idnum,
alkylation_idnum,
pipe_date,
alkylation_date,
container_date,
boiler_idnum,
boiler_date,
#{id},
#{plantCode},
#{name},
#{employeeid},
#{classes},
#{post},
#{idtype},
#{containerIdnum},
0,
0,
0,
0,
1,
1,
1,
1,
#{recertificatedate},
#{validity},
#{delFlag},
#{createrCode},
#{createdate},
#{updaterCode},
#{updatedate},
#{remarks},
#{deptId},
#{pipeIdnum},
#{alkylationIdnum},
#{pipeDate},
#{alkylationDate},
#{containerDate},
#{boilerIdnum},
#{boilerDate},
update t_byx_worklicense
plant_code = #{plantCode},
name = #{name},
employeeid = #{employeeid},
classes = #{classes},
post = #{post},
idtype = #{idtype},
container_idnum = #{containerIdnum},
boiler =0,
container =0,
pipe =0,
alkylation =0,
boiler =1,
container =1,
pipe =1,
alkylation =1,
aromatic = #{aromatic},
recertificatedate = #{recertificatedate},
validity = #{validity},
del_flag = #{delFlag},
creater_code = #{createrCode},
createdate = #{createdate},
updater_code = #{updaterCode},
updatedate = #{updatedate},
remarks = #{remarks},
dept_id = #{deptId},
pipe_idnum = #{pipeIdnum},
alkylation_idnum = #{alkylationIdnum},
pipe_date = #{pipeDate},
alkylation_date = #{alkylationDate},
container_date = #{containerDate},
boiler_idnum = #{boilerIdnum},
boiler_date = #{boilerDate},
where id = #{id}
update t_byx_worklicense set del_flag = 2 where id = #{id}
update t_byx_Worklicense set del_flag = 2 where id in
#{id}