|
@@ -40,7 +40,7 @@
|
|
|
<select id="getFormList" resultType="org.springblade.meter.vo.ResolveInventoryVO">
|
|
|
select id,form_number,form_name,current_price,contract_total,change_total,
|
|
|
change_total as buildChangeTotal,
|
|
|
- (change_total - IFNULL((select sum(build_picture_total) from s_inventory_form_meter where is_deleted = 0 and contract_form_id = cif.id),0)) as resolveResidueTotal
|
|
|
+ (change_total - IFNULL((select sum(build_picture_total) from s_inventory_form_meter where is_deleted = 0 and contract_form_id = cif.id),0)) as resolveResidueTotal
|
|
|
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=")">
|
|
@@ -48,7 +48,9 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="getResolveFormInfo" resultType="org.springblade.meter.vo.MeterInventoryVO">
|
|
|
- select id,form_number,form_name,current_price,
|
|
|
+ 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,
|
|
|
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
|
|
@@ -122,6 +124,9 @@
|
|
|
ifa.change_build_picture_total as changeTotal,
|
|
|
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,
|
|
|
+ (select IF (cif.build_change_total is null ,0,1) from s_contract_inventory_form cif where cif.id = ifa.contract_form_id ) as isCreateDivide,
|
|
|
+ (select is_over_meter from m_contract_info mci WHERE id = #{contractId}) as isContractOver,
|
|
|
(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
|