gongchunyi
5 天以前 4277ab30de3fedfd5bea68bfa0e111e21df73839
src/main/java/com/ruoyi/sales/mapper/SalesLedgerMapper.java
@@ -10,6 +10,7 @@
import com.ruoyi.sales.dto.SalesTrendDto;
import com.ruoyi.sales.dto.StatisticsTableDto;
import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.pojo.SalesLedgerProcessRoute;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -69,7 +70,8 @@
            "SUM(CASE WHEN slp.approve_status = 2 THEN 1 ELSE 0 END) / COUNT(DISTINCT sl.id) * 100), 2) AS ship_rate " +
            "FROM sales_ledger sl " +
            "LEFT JOIN sales_ledger_product slp ON sl.id = slp.sales_ledger_id " +
            "WHERE sl.entry_date BETWEEN #{statisticsTableDto.entryDateStart} AND #{statisticsTableDto.entryDateEnd} " +
            "WHERE sl.entry_date >= DATE_FORMAT(#{statisticsTableDto.entryDateStart}, '%Y-%m-01') " +
            "AND sl.entry_date <= LAST_DAY(#{statisticsTableDto.entryDateEnd}) " +
            // 产品大类筛选
            "<if test='statisticsTableDto.productCategory != null and statisticsTableDto.productCategory != \"\"'>" +
            "AND slp.product_category = #{statisticsTableDto.productCategory} " +
@@ -82,4 +84,9 @@
            "ORDER BY month" +
            "</script>")
    List<SalesTrendDto> statisticsTable(@Param("statisticsTableDto")StatisticsTableDto statisticsTableDto);
    IPage<SalesLedgerDto> listSalesLedgerAndShipped(Page page, @Param("ew") SalesLedgerDto salesLedgerDto);
    List<SalesLedgerProcessRoute> selectSalesProcess(Long salesLedgerId);
}