gongchunyi
20 小时以前 18fa07479d3c7f5a9b683ab0f698528d9bd2a9ec
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -55,6 +55,7 @@
        T1.customer_name,
        T1.entry_person,
        T1.remarks,
        T1.customer_remarks,
        T1.attachment_materials,
        T1.tenant_id,
        T1.contract_amount,
@@ -63,6 +64,7 @@
        T2.nick_name AS entry_person_name,
        T1.payment_method,
        T1.delivery_date,
        T1.stock_status,
        DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff,
        T1.delivery_status AS deliveryStatus
        FROM sales_ledger T1
@@ -90,8 +92,25 @@
            <if test="salesLedgerDto.deliveryStatus != null">
                AND T1.delivery_status = #{salesLedgerDto.deliveryStatus}
            </if>
            <if test="salesLedgerDto.stockStatus != null">
                AND T1.stock_status = #{salesLedgerDto.stockStatus}
            </if>
            <if test="salesLedgerDto.width != null or salesLedgerDto.height != null">
                AND EXISTS (
                SELECT 1
                FROM sales_ledger_product SLP
                WHERE SLP.sales_ledger_id = T1.id
                AND SLP.type = 1
                <if test="salesLedgerDto.width != null">
                    AND SLP.width = #{salesLedgerDto.width}
                </if>
                <if test="salesLedgerDto.height != null">
                    AND SLP.height = #{salesLedgerDto.height}
                </if>
                )
            </if>
        </where>
        ORDER BY T1.entry_date DESC
        ORDER BY T1.entry_date DESC,T1.id DESC
    </select>
    <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">