select id, site_id, year, month, peak, high, flat, valley, create_by, create_time, update_by, update_time, remark from ems_energy_price_config
insert into ems_energy_price_config
site_id,
year,
month,
peak,
high,
flat,
valley,
create_by,
create_time,
update_by,
update_time,
remark,
#{siteId},
#{year},
#{month},
#{peak},
#{high},
#{flat},
#{valley},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
update ems_energy_price_config
site_id = #{siteId},
year = #{year},
month = #{month},
peak = #{peak},
high = #{high},
flat = #{flat},
valley = #{valley},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark},
where id = #{id}
delete from ems_energy_price_config where id = #{id}
delete from ems_energy_price_config where id in
#{id}
INSERT INTO ems_energy_price_config (
id,
site_id,
year,
month,
peak,
high,
flat,
valley,
create_by,
create_time,
update_by,
update_time,
remark
) VALUES (
#{id},
#{siteId},
#{year},
#{month},
#{peak},
#{high},
#{flat},
#{valley},
'system',
NOW(),
'system',
NOW(),
#{remark}
) ON DUPLICATE KEY UPDATE
peak = #{peak},
high = #{high},
flat = #{flat},
valley = #{valley},
update_time = NOW();