huminmin
2 天以前 441dfbd1908affc1accc52006a2fe81a5067052d
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -62,6 +62,7 @@
        T1.payment_method,
        T1.delivery_date,
        DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff,
        COALESCE(T1.stock_type, 'qualified') AS stock_type,
        IFNULL(shipping_status_counts.is_all_shipped, FALSE) AS is_fh
        FROM sales_ledger T1
        LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id
@@ -93,6 +94,10 @@
            </if>
            <if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
                AND T1.entry_date &lt;= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
            </if>
            <if test="salesLedgerDto.stockType != null and salesLedgerDto.stockType != '' ">
                AND COALESCE(T1.stock_type, 'qualified') = #{salesLedgerDto.stockType}
            </if>
        </where>
        order by T1.entry_date desc
@@ -132,10 +137,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>