浏览代码

2023 12 11 保存更新

zhuwei 1 年之前
父节点
当前提交
70ee325dd1

+ 5 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractInventoryFormMapper.xml

@@ -81,7 +81,11 @@
     <select id="getContrFormAllByContrId" resultType="org.springblade.meter.vo.ContractFromVO">
         select x.*,contract_total-poseNum as residueNum from (
             select id,form_number,form_name,current_price,contract_total,change_total,
-            (SELECT build_picture_total from s_inventory_form_meter a where is_deleted=0 and a.contract_id=u.contract_id and a.contract_form_id=u.id) as poseNum,is_supplement
+            (SELECT sum(build_picture_total) from s_inventory_form_meter a where is_deleted=0 and a.contract_id=u.contract_id and a.contract_form_id=u.id
+            <if test="type==2">
+               and  contract_meter_id=#{meterId}
+            </if>
+            ) as poseNum,is_supplement
             from s_contract_inventory_form u
             where contract_id = #{contractId} and is_deleted = 0
             <if test="formNum != null and formNum != '' and type==1">