select d.id, d.plant_code, d.year, d.ethylene, d.btx, d.kpi, d.jan, d.feb, d.mar, d.apr, d.may, d.jun, d.jul, d.aug, d.sep, d.oct, d.nov, d.dec, d.ytd, d.target, d.sort, d.item, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_monthplan d
left join sys_dept s on s.dept_id = d.dept_id
SELECT seq_t_monthplan.NEXTVAL as id FROM DUAL
insert into t_monthplan
id,
plant_code,
year,
ethylene,
btx,
kpi,
jan,
feb,
mar,
apr,
may,
jun,
jul,
aug,
sep,
oct,
nov,
dec,
ytd,
target,
sort,
item,
del_flag,
creater_code,
createdate,
updater_code,
updatedate,
remarks,
dept_id,
#{id},
#{plantCode},
#{year},
#{ethylene},
#{btx},
#{kpi},
#{jan},
#{feb},
#{mar},
#{apr},
#{may},
#{jun},
#{jul},
#{aug},
#{sep},
#{oct},
#{nov},
#{dec},
#{ytd},
#{target},
#{sort},
#{item},
#{delFlag},
#{createrCode},
#{createdate},
#{updaterCode},
#{updatedate},
#{remarks},
#{deptId},
update t_monthplan
plant_code = #{plantCode},
year = #{year},
ethylene = #{ethylene},
btx = #{btx},
kpi = #{kpi},
jan = #{jan},
feb = #{feb},
mar = #{mar},
apr = #{apr},
may = #{may},
jun = #{jun},
jul = #{jul},
aug = #{aug},
sep = #{sep},
oct = #{oct},
nov = #{nov},
dec = #{dec},
ytd = #{ytd},
target = #{target},
sort = #{sort},
item = #{item},
del_flag = #{delFlag},
creater_code = #{createrCode},
createdate = #{createdate},
updater_code = #{updaterCode},
updatedate = #{updatedate},
remarks = #{remarks},
dept_id = #{deptId},
where id = #{id}
update t_monthplan set del_flag = 2 where id = #{id}
update t_monthplan set del_flag = 2 where id in
#{id}