7 天以前 30ef534fcffe0520bebe7a34abe69d7afbbf227f
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -78,8 +78,9 @@
        left join purchase_ledger sl on slp.sales_ledger_id = sl.id
        <where>
            slp.type = 2
            <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != '' ">
                AND sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%')
            <if test="req.supplierNameOrContractNo != null and req.supplierNameOrContractNo != '' ">
                AND sl.purchase_contract_number like concat('%',#{req.supplierNameOrContractNo},'%')
                or sl.supplier_name like concat('%',#{req.supplierNameOrContractNo},'%')
            </if>
            <if test="req.approvalStatus != null and req.approvalStatus != ''">
                and sl.approval_status = #{req.approvalStatus}
@@ -90,15 +91,19 @@
            <if test="req.projectName != null and req.projectName != '' ">
                AND sl.project_name like concat('%',#{req.projectName},'%')
            </if>
            <if test="req.customerName != null and req.customerName != '' ">
                AND sl.customer_name like concat('%',#{req.customerName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != '' ">
                AND slp.product_category like concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.status != null and req.status ">
                AND slp.pending_tickets_total &gt; 0
            </if>
            <if test="req.ticketsTotal != null and req.ticketsTotal.doubleValue() != 0.0">
                AND slp.tickets_total = #{req.ticketsTotal}
            </if>
            <if test="req.registrationtDate != null and req.registrationtDate != ''">
                AND DATE(slp.register_date) = #{req.registrationtDate}
            </if>
        </where>
        order by slp.register_date desc
    </select>
@@ -131,9 +136,7 @@
        <if test="req.productCategory != null and req.productCategory != ''">
            AND slp.product_category = #{req.productCategory}
        </if>
        <!-- 按产品大类分组聚合 -->
        GROUP BY slp.product_category
        <!-- 按产品大类排序 -->
        GROUP BY slp.product_category, slp.specification_model, sl.supplier_name
        ORDER BY slp.product_category
    </select>
    <select id="selectProductBomStructure" resultType="com.ruoyi.sales.dto.LossProductModelDto">