shiyunteng
2025-04-01 ffbddedac17c4a7d18d382c4917b3f375356e061
platformx-device-biz/src/main/resources/mapper/ReceivingNoteItemMapper.xml
@@ -39,4 +39,20 @@
         and rni.note_id = #{queryDTO.noteId}
      </if>
   </select>
    <select id="selectDeviceNumByContractId" resultType="java.lang.Integer">
      select
         ifnull(sum(rni.num),0)
      from
         receiving_note_item rni
      where
         rni.device_id = #{deviceId}
        and exists (
            select
               *
            from
               receiving_note rn
            where
               rn.contract_id = #{contractId}
              and rn.id = rni.note_id)
   </select>
</mapper>