重构
This commit is contained in:
@ -14,27 +14,23 @@
|
||||
|
||||
<insert id="upsertHistoryJsonByMinute">
|
||||
insert into ${tableName} (
|
||||
site_id, statis_minute, data_json, create_by, create_time, update_by, update_time
|
||||
site_id, statis_minute, data_json,
|
||||
hot_soc, hot_total_active_power, hot_total_reactive_power, hot_day_charged_cap, hot_day_dis_charged_cap,
|
||||
create_by, create_time, update_by, update_time
|
||||
) values (
|
||||
#{siteId}, #{statisMinute}, #{dataJson}, #{operName}, now(), #{operName}, now()
|
||||
#{siteId}, #{statisMinute}, #{dataJson},
|
||||
#{hotSoc}, #{hotTotalActivePower}, #{hotTotalReactivePower}, #{hotDayChargedCap}, #{hotDayDisChargedCap},
|
||||
#{operName}, now(), #{operName}, now()
|
||||
)
|
||||
on duplicate key update
|
||||
data_json = values(data_json),
|
||||
hot_soc = values(hot_soc),
|
||||
hot_total_active_power = values(hot_total_active_power),
|
||||
hot_total_reactive_power = values(hot_total_reactive_power),
|
||||
hot_day_charged_cap = values(hot_day_charged_cap),
|
||||
hot_day_dis_charged_cap = values(hot_day_dis_charged_cap),
|
||||
update_by = values(update_by),
|
||||
update_time = now()
|
||||
</insert>
|
||||
|
||||
<update id="updateHistoryHotColumns">
|
||||
update ${tableName}
|
||||
set hot_soc = #{hotSoc},
|
||||
hot_total_active_power = #{hotTotalActivePower},
|
||||
hot_total_reactive_power = #{hotTotalReactivePower},
|
||||
hot_day_charged_cap = #{hotDayChargedCap},
|
||||
hot_day_dis_charged_cap = #{hotDayDisChargedCap},
|
||||
update_by = #{operName},
|
||||
update_time = now()
|
||||
where site_id = #{siteId}
|
||||
and statis_minute = #{statisMinute}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user