|
@@ -247,14 +247,14 @@
|
|
SELECT
|
|
SELECT
|
|
c.id,c.office_id,
|
|
c.id,c.office_id,
|
|
ifnull(lastwua.reading, IFNULL(d.new_meter_start,0)),
|
|
ifnull(lastwua.reading, IFNULL(d.new_meter_start,0)),
|
|
- ifnull(lastwua.recorddate,ifnull(d.install_time,d.date_create)),c.metercode,
|
|
|
|
|
|
+ ifnull(lastwua.recorddate,d.date_create),c.metercode,
|
|
c.watermeter_id,#{month},null,null,null,NULL,1,
|
|
c.watermeter_id,#{month},null,null,null,NULL,1,
|
|
c.waterproperty_id,#{year},c.account_id,c.accountname,c.accountnumber,c.address,
|
|
c.waterproperty_id,#{year},c.account_id,c.accountname,c.accountnumber,c.address,
|
|
- c.watertype,null,d.electronic_no,null,null,1,NOW(),
|
|
|
|
|
|
+ c.watertype,null,d.water_meter_no,null,null,1,NOW(),
|
|
1,now(),'批量生成抄表计划',0,c.site_id,c.customer_id
|
|
1,now(),'批量生成抄表计划',0,c.site_id,c.customer_id
|
|
FROM
|
|
FROM
|
|
pay_base_customerandmeterrela c
|
|
pay_base_customerandmeterrela c
|
|
- left join sc_install_list d on d.device_id =c.watermeter_id
|
|
|
|
|
|
+ left join sc_device d on d.id =c.watermeter_id
|
|
LEFT JOIN pay_amount_waterusedamount amount ON amount.watermeter_id = c.watermeter_id
|
|
LEFT JOIN pay_amount_waterusedamount amount ON amount.watermeter_id = c.watermeter_id
|
|
AND amount.YEAR = #{year}
|
|
AND amount.YEAR = #{year}
|
|
AND amount.MONTH = #{month}
|
|
AND amount.MONTH = #{month}
|
|
@@ -456,32 +456,6 @@
|
|
group by c.customer_id, c.site_id
|
|
group by c.customer_id, c.site_id
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id ="getRepalceRecordDetail" resultType="com.bz.smart_city.dto.pay.ReplaceMeterDto">
|
|
|
|
- SELECT
|
|
|
|
- pc.device_id AS deviceId,
|
|
|
|
- pc.date_create AS replaceTime,
|
|
|
|
- pc.new_begin_wsv AS newBegin,
|
|
|
|
- pc.old_end_wsv AS oldEnd
|
|
|
|
- FROM
|
|
|
|
- sc_water_meter_replace_log pc LEFT JOIN sc_device scd on pc.device_id = scd.id
|
|
|
|
- <where>
|
|
|
|
- <if test="stTime != null"> and pc.date_create >= #{stTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
- <if test="etTime != null"> and pc.date_create <= #{etTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
- <if test="siteId != null"> and scd.site_id = #{siteId}</if>
|
|
|
|
- <if test="customerId != null"> and scd.customer_id = #{customerId}</if>
|
|
|
|
- <if test="list != null and list.size() != 0">
|
|
|
|
- and pc.device_id IN
|
|
|
|
- <foreach collection="list" item="listItem" open="(" close=")" separator=",">
|
|
|
|
- <if test="listItem != null and listItem != ''">
|
|
|
|
- #{listItem}
|
|
|
|
- </if>
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </where>
|
|
|
|
-
|
|
|
|
- </select>
|
|
|
|
|
|
|
|
<select id="getLastReadrecord" resultType="com.bz.smart_city.dto.pay.AmountWaterUsedAmountDto">
|
|
<select id="getLastReadrecord" resultType="com.bz.smart_city.dto.pay.AmountWaterUsedAmountDto">
|
|
SELECT
|
|
SELECT
|