id
,group_id,pid,
station_id,src_id,dept_id,
create_time,day,type,
digital,elec,rate_type,price,total
insert into earnings_calculate
id,group_id,pid,station_id,src_id,dept_id,create_time,day,type,digital,elec,rate_type,price,total,#{id,jdbcType=INTEGER},#{groupId,jdbcType=INTEGER},#{pid,jdbcType=INTEGER},#{stationId,jdbcType=INTEGER},#{srcId,jdbcType=INTEGER},#{deptId,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{day,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{digital,jdbcType=VARCHAR},#{elec},#{rateType},#{price},#{total},
delete
from earnings_calculate
and day = #{day}
and type in
#{item}
delete
from earnings_calculate
and day = #{day}
and type in
#{item}
and station_id=#{stationId}
INSERT INTO earnings_calculate
(group_id, pid, station_id, src_id, dept_id, create_time, day, type,
digital,elec,rate_type,price,total,discount)
VALUES
(
#{item.groupId},#{item.pid},#{item.stationId},#{item.srcId},#{item.deptId}, now(),
#{item.day},#{item.type},#{item.digital},#{item.elec},#{item.rateType},#{item.price},#{item.total},#{item.discount}
)
insert into mon_freeze_total (station_id,total_charge,total_discharge,month)
values
(#{item.stationId},#{item.totalCharge},#{item.totalDischarge},#{item.month})
delete
from earnings_calculate
and day = #{day}
and station_id = #{stationId}
and type in
#{item}