select d.id, d.report_month, d.report_year, d.nap, d.c5, d.c6_c8_na, d.wison_ethane, d.lpg_to_furnace, d.raff3_fr_bd, d.raffinate2p_fr_2ph, d.c2_fr_ldpe, d.c3_fr_oxo, d.mixed_c3_c4, d.hy_c9, d.pgu_offgas, d.wash_oil, d.toluene, d.hy_c4_fr_r800, d.cracker_raw_input, d.cracker_raw_feed from t_monthly_production_report d
SELECT SEQ_T_MONTHLY_REPORT.NEXTVAL as id FROM DUAL
insert into t_monthly_production_report
id,
report_month,
report_year,
nap,
c5,
c6_c8_na,
wison_ethane,
lpg_to_furnace,
raff3_fr_bd,
raffinate2p_fr_2ph,
c2_fr_ldpe,
c3_fr_oxo,
mixed_c3_c4,
hy_c9,
pgu_offgas,
wash_oil,
toluene,
hy_c4_fr_r800,
cracker_raw_input,
cracker_raw_feed,
#{id},
#{reportMonth},
#{reportYear},
#{nap},
#{c5},
#{c6C8Na},
#{wisonEthane},
#{lpgToFurnace},
#{raff3FrBd},
#{raffinate2pFr2ph},
#{c2FrLdpe},
#{c3FrOxo},
#{mixedC3C4},
#{hyC9},
#{pguOffgas},
#{washOil},
#{toluene},
#{hyC4FrR800},
#{crackerRawInput},
#{crackerRawFeed},
update t_monthly_production_report
report_month = #{reportMonth},
report_year = #{reportYear},
nap = #{nap},
c5 = #{c5},
c6_c8_na = #{c6C8Na},
wison_ethane = #{wisonEthane},
lpg_to_furnace = #{lpgToFurnace},
raff3_fr_bd = #{raff3FrBd},
raffinate2p_fr_2ph = #{raffinate2pFr2ph},
c2_fr_ldpe = #{c2FrLdpe},
c3_fr_oxo = #{c3FrOxo},
mixed_c3_c4 = #{mixedC3C4},
hy_c9 = #{hyC9},
pgu_offgas = #{pguOffgas},
wash_oil = #{washOil},
toluene = #{toluene},
hy_c4_fr_r800 = #{hyC4FrR800},
cracker_raw_input = #{crackerRawInput},
cracker_raw_feed = #{crackerRawFeed},
where id = #{id}
update t_monthly_production_report set del_flag = 2 where id = #{id}
update t_monthly_production_report set del_flag = 2 where id in
#{id}