|
@@ -590,6 +590,9 @@
|
|
|
,#{customerId}
|
|
|
from pay_base_customerandmeterrela c
|
|
|
left join pay_base_waterproperty p on c.waterproperty_id=p.id
|
|
|
+ LEFT JOIN pay_amount_waterusedamount amount ON amount.watermeter_id = c.watermeter_id
|
|
|
+ AND amount.YEAR = #{year}
|
|
|
+ AND amount.MONTH = #{month}
|
|
|
left join sc_device d on c.watermeter_id=d.id
|
|
|
left join (
|
|
|
select
|
|
@@ -606,7 +609,7 @@
|
|
|
) aLast
|
|
|
left join pay_amount_waterusedamount a on a.ele_no=aLast.ele_no and a.create_date=aLast.create_date
|
|
|
) amount on amount.watermeter_id=c.watermeter_id
|
|
|
- where c.businessstate= 1 and c.site_id=#{siteId} and c.customer_id=#{customerId}
|
|
|
+ where c.businessstate= 1 and amount.id is null and c.site_id=#{siteId} and c.customer_id=#{customerId}
|
|
|
</insert>
|
|
|
|
|
|
<select id="getSynAmountMetercode" resultType="java.lang.String">
|