yuan
8 小时以前 47806d9e390ee00e1d29ad1da8c1aa908882a758
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -56,7 +56,6 @@
        T1.attachment_materials,
        T1.tenant_id,
        T1.contract_amount,
        T1.net_contract_amount,
        T1.contract_amount AS noInvoiceAmountTotal,
        T1.execution_date,
        T2.nick_name AS entry_person_name,
@@ -96,7 +95,7 @@
                AND T1.entry_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
            </if>
        </where>
        order by T1.entry_date desc
        order by T1.entry_date desc, T1.sales_contract_no desc
    </select>
    <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
@@ -111,17 +110,19 @@
        FROM sales_ledger
        GROUP BY customer_name
    </select>
    <select id="listSalesLedgerAndShipped" resultType="com.ruoyi.sales.dto.SalesLedgerDto">
        select distinct sl.id as 'disId', sl.* from
        sales_ledger sl
        left join sales_ledger_product slp on sl.id = slp.sales_ledger_id
        left join shipping_info si on slp.id = si.sales_ledger_product_id
        where si.status = '已发货'
        <if test="ew.customerName != null and ew.customerName != '' ">
            and sl.customer_name like concat('%',#{ew.customerName},'%')
        where si.status = '审核通过'
        <if test="ew.customerId != null and ew.customerId != '' ">
            and sl.customer_id = #{ew.customerId}
        </if>
        order by sl.execution_date desc
    </select>
    <select id="selectPurchaseReportVoPage" resultType="com.ruoyi.purchase.vo.PurchaseReportVo">
        select sl.sales_contract_no customerContractNo,
               c.customer_name,
@@ -133,12 +134,10 @@
        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>
            <if test="customerName != null and customerName != '' ">
                and c.customer_name like concat('%',#{customerName},'%')
            </if>
        </where>
        order by sl.entry_date desc
        where 1=1
        <if test="customerName != null and customerName != '' ">
            and c.customer_name like concat('%',#{customerName},'%')
        </if>
    </select>
</mapper>