src/main/resources/mapper/CustomStorageWarningRecordMapper.xml
@@ -22,7 +22,13 @@
        sum(t1.tax_inclusive_total_price) as totalPrice,
        sum(t1.inbound_num) as inboundNum,
        sum(t1.inbound_num) as inboundNum0,
        SUM(t1.inbound_num) - COALESCE(SUM(t2.inbound_num), 0) AS availableStock
        SUM(t1.inbound_num) - COALESCE(SUM(t2.inbound_num), 0) AS currentStock,
        ANY_VALUE(cswr.warning_level)        AS warningLevel,
        ANY_VALUE(cswr.warning_status)       AS warningStatus,
        ANY_VALUE(cswr.warning_time)         AS warningTime,
        ANY_VALUE(cswr.expectedShortageTime) AS expectedShortageTime,
        ANY_VALUE(cswr.suggestion_type)      AS suggestionType,
        ANY_VALUE(cswr.suggestion_content)   AS suggestionContent
        from custom_storage t1
        left join procurement_record_out t2 on t1.id = t2.procurement_record_storage_id and t2.type = 3
        inner join custom_storage_warning_record cswr on t1.id = cswr.custom_storage_id