2026-05-30 8e52d3e600ff49869cc612fd9bf1cc64ac304f50
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -62,7 +62,8 @@
        T1.payment_method,
        T1.delivery_date,
        DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff,
        IFNULL(shipping_status_counts.is_all_shipped, FALSE) AS is_fh
        IFNULL(shipping_status_counts.is_all_shipped, FALSE) AS is_fh,
        T3.purchase_contract_number
        FROM sales_ledger T1
        LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id
        LEFT JOIN (
@@ -74,6 +75,7 @@
        FROM shipping_info
        GROUP BY sales_ledger_id
        ) shipping_status_counts ON T1.id = shipping_status_counts.sales_ledger_id
        LEFT JOIN purchase_ledger T3 ON T1.purchase_ledger_id = T3.id
        <where>
            <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
@@ -132,10 +134,12 @@
        from sales_ledger sl
        left join purchase_ledger pl on sl.id = pl.sales_ledger_id
        left join customer c on sl.customer_id = c.id
        where 1=1
        <if test="customerName != null and customerName != '' ">
            and c.customer_name like concat('%',#{customerName},'%')
        </if>
        <where>
            <if test="customerName != null and customerName != '' ">
                and c.customer_name like concat('%',#{customerName},'%')
            </if>
        </where>
        order by sl.entry_date desc
    </select>
</mapper>