id, template_code, name, status, remark, type, station_id, free_time, occupy_fee, public_flag,
create_time, update_by, update_time, del_flag
id, template_code, time_type, electricity_price, service_price, apply_time, create_by,
create_time, update_by, update_time, del_flag
select
from pile_billing_template
insert into pile_billing_template
template_code,
public_flag,
name,
status,
remark,
type,
station_id,
free_time,
occupy_fee,
create_by,
create_time,
update_by,
update_time,
del_flag,
#{templateCode},
#{publicFlag},
#{name},
#{status},
#{remark},
#{type},
#{stationId},
#{freeTime},
#{occupyFee},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{delFlag},
update pile_billing_template
template_code = #{templateCode},
public_flag = #{publicFlag},
name = #{name},
status = #{status},
remark = #{remark},
type = #{type},
station_id = #{stationId},
free_time = #{freeTime},
occupy_fee = #{occupyFee},
publish_time = #{publishTime},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
del_flag = #{delFlag},
where id = #{id}
delete
from pile_billing_template
where id = #{id}
delete
from pile_billing_template where id in
#{id}
delete
from pile_billing_detail
where template_code in
#{templateCode}
delete
from pile_billing_detail
where template_code = #{templateCode}
insert into pile_billing_detail
(id, template_code, time_type, electricity_price, service_price, apply_time,
create_by, update_by)
values
(#{item.id}, #{item.templateCode}, #{item.timeType}, #{item.electricityPrice}, #{item.servicePrice},
#{item.applyTime}, #{item.createBy}, #{item.updateBy})
insert into pile_billing_relation
(pile_sn, billing_template_code, station_id)
values
(#{item.pileSn}, #{item.billingTemplateCode}, #{item.stationId})
delete
from pile_billing_relation
where pile_sn in
#{pileSn,jdbcType=VARCHAR}
update pile_billing_template
set status = #{status,jdbcType=VARCHAR}
where station_id = #{stationId,jdbcType=VARCHAR}
update pile_billing_template
set status = #{status,jdbcType=VARCHAR}
where id = #{templateId,jdbcType=VARCHAR}