|
@@ -83,8 +83,16 @@
|
|
|
where ifm.contract_id = #{contractId} and ifm.is_deleted = 0 and ifm.contract_form_id = cif.id),0) as changeTotal
|
|
|
from s_contract_inventory_form cif
|
|
|
where id in
|
|
|
- (select contract_form_id from s_inventory_form_meter
|
|
|
- where contract_id = #{contractId} and is_deleted = 0 group by contract_form_id)
|
|
|
+ (SELECT contract_form_id
|
|
|
+ FROM s_inventory_form_meter
|
|
|
+ WHERE contract_id = #{contractId}
|
|
|
+ and is_deleted = 0
|
|
|
+ and contract_meter_id in (SELECT id
|
|
|
+ FROM s_meter_tree_contract mtc
|
|
|
+ WHERE contract_id = #{contractId}
|
|
|
+ and is_deleted = 0
|
|
|
+ and (mtc.id = #{nodeId} or FIND_IN_SET(#{nodeId}, ancestor) > 0))
|
|
|
+ GROUP BY contract_form_id)
|
|
|
</select>
|
|
|
<select id="getZeroChange" resultType="org.springblade.meter.vo.ZeroChangeVO">
|
|
|
select id,form_number,form_name,current_price,contract_total,contract_money,
|