|
@@ -51,13 +51,19 @@
|
|
|
select id,form_number,form_name,current_price,change_total as contractChangeAllTotal,
|
|
|
IF (cif.build_change_total is null ,0,1) as isCreateDivide,
|
|
|
(select is_over_meter from m_contract_info mci WHERE id = #{contractId}) as isContractOver,
|
|
|
+ (select up_pay_ratio from s_inventory_form_meter where is_deleted = 0
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = cif.id) as upPayRatio,
|
|
|
+ (select up_pay_money from s_inventory_form_meter where is_deleted = 0
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = cif.id) as upPayMoney,
|
|
|
IFNULL((select sum(change_build_picture_total) from s_inventory_form_meter where is_deleted = 0
|
|
|
and contract_meter_id = #{nodeId} and contract_form_id = cif.id),0) as change_total,
|
|
|
IFNULL((select sum(build_picture_total) from s_inventory_form_meter where is_deleted = 0
|
|
|
and contract_meter_id = #{nodeId} and contract_form_id = cif.id),0) as resolveTotal,
|
|
|
0 as currentMeterTotal,0 as containChangeTotal,0 as currentMeterMoney,
|
|
|
(IFNULL((select sum(current_meter_total) from s_inventory_form_apply where is_deleted = 0
|
|
|
- and contract_meter_id = #{nodeId} and contract_form_id = cif.id),0)) as allMeterTotal
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = cif.id),0)) as allMeterTotal,
|
|
|
+ (IFNULL((select sum(pay_money) from s_inventory_form_apply where is_deleted = 0
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = cif.id),0)) as otherPayMoney
|
|
|
from s_contract_inventory_form cif where contract_id = #{contractId} and is_deleted = 0 and is_form_node = 1
|
|
|
AND id in
|
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
@@ -121,7 +127,7 @@
|
|
|
</select>
|
|
|
<select id="getForm" resultType="org.springblade.meter.vo.MeterInventoryVO">
|
|
|
select ifa.id as taskDetailId,ifa.contract_form_id as id,ifa.form_number,ifa.form_name,ifa.current_price,ifa.build_picture_total as resolveTotal,
|
|
|
- ifa.change_build_picture_total as changeTotal,
|
|
|
+ ifa.change_build_picture_total as changeTotal,ifa.up_pay_ratio as upPayRatio,
|
|
|
ifa.current_meter_total as currentMeterTotal,0 as containChangeTotal,
|
|
|
ifa.current_meter_money as currentMeterMoney,
|
|
|
(select cif.change_total from s_contract_inventory_form cif where cif.id = ifa.contract_form_id ) as contractChangeAllTotal,
|
|
@@ -130,7 +136,11 @@
|
|
|
(IFNULL((select sum(current_meter_total) from s_inventory_form_apply where is_deleted = 0
|
|
|
and contract_meter_id = #{nodeId} and contract_form_id = ifa.contract_form_id and id != ifa.id),0)) as otherMeterTotal,
|
|
|
(IFNULL((select sum(current_meter_total) from s_inventory_form_apply where is_deleted = 0
|
|
|
- and contract_meter_id = #{nodeId} and contract_form_id = ifa.contract_form_id),0)) as allMeterTotal
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = ifa.contract_form_id),0)) as allMeterTotal,
|
|
|
+ (IFNULL((select sum(pay_money) from s_inventory_form_apply where is_deleted = 0
|
|
|
+ and contract_meter_id = #{nodeId} and contract_form_id = ifa.contract_form_id),0)) as otherPayMoney,
|
|
|
+ (select up_pay_money from s_inventory_form_meter ifm where ifm.is_deleted = 0
|
|
|
+ and ifm.contract_meter_id = #{nodeId} and ifm.contract_form_id = ifa.contract_form_id) as upPayMoney
|
|
|
from s_inventory_form_apply ifa
|
|
|
where ifa.contract_id = #{contractId} and ifa.is_deleted = 0
|
|
|
AND ifa.middle_meter_id = #{id}
|