| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.home.dto.IncomeExpenseAnalysisDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesTrendDto; |
| | | import com.ruoyi.sales.dto.StatisticsTableDto; |
| | |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface SalesLedgerMapper extends BaseMapper<SalesLedger> { |
| | | |
| | | List<IncomeExpenseAnalysisDto> selectIncomeStats(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("dateFormat") String dateFormat); |
| | | |
| | | List<com.ruoyi.dto.MapDto> selectCustomerSalesComposition(); |
| | | /** |
| | | * 查询指定日期的所有合同序列号 |
| | | * @param datePart 日期部分(格式:yyyyMMdd) |
| | |
| | | "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} " + |