l3能源成本分摊(部分完成留存)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.klp.ems.domain.CostCoilDailyEnergy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 访问 wms_cost_coil_daily(仅更新能源成本字段)。
|
||||
*/
|
||||
@Mapper
|
||||
public interface CostCoilDailyMapper {
|
||||
|
||||
/**
|
||||
* 更新成本日表中的能源成本与拆分信息,按 coil_id + calc_date 命中。
|
||||
*/
|
||||
int updateEnergyCost(CostCoilDailyEnergy energyCost);
|
||||
|
||||
/**
|
||||
* 查询成本日表现有的能源成本信息(energy_cost_amount、energy_cost_breakdown)。
|
||||
*/
|
||||
CostCoilDailyEnergy selectEnergyCost(CostCoilDailyEnergy energyCost);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.klp.ems.mapper;
|
||||
|
||||
import com.klp.ems.domain.EmsEnergyConsumption;
|
||||
import com.klp.ems.domain.bo.TimeRangeWithMetersBo;
|
||||
import com.klp.ems.domain.bo.EmsEnergyConsumptionBo;
|
||||
import com.klp.ems.domain.vo.EmsEnergyConsumptionVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.ems.domain.vo.SummaryDailyVo;
|
||||
@@ -9,6 +10,7 @@ import com.klp.ems.domain.vo.SummaryMonthlyVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 能耗记录Mapper接口
|
||||
@@ -35,4 +37,24 @@ public interface EmsEnergyConsumptionMapper extends BaseMapperPlus<EmsEnergyCons
|
||||
List<SummaryDailyVo> selectDailySummaryWithMeters(TimeRangeWithMetersBo range);
|
||||
|
||||
List<SummaryMonthlyVo> selectMonthlySummaryWithMeters(TimeRangeWithMetersBo range);
|
||||
|
||||
EmsEnergyConsumption selectLatestBefore(@Param("meterId") Long meterId, @Param("endTime") String endTime);
|
||||
|
||||
List<EmsEnergyConsumption> selectOverlapRange(@Param("meterId") Long meterId,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
EmsEnergyConsumption selectCoveringRange(@Param("meterId") Long meterId,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 查询指定计量表最近的两条抄表记录(按endTime倒序)
|
||||
*/
|
||||
List<EmsEnergyConsumption> selectLatestTwoReadings(@Param("meterId") Long meterId);
|
||||
|
||||
/**
|
||||
* 获取能耗统计信息(用SQL聚合函数计算)
|
||||
*/
|
||||
Map<String, Object> getStatistics(EmsEnergyConsumptionBo bo);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.klp.ems.mapper;
|
||||
import com.klp.ems.domain.EmsEnergyRate;
|
||||
import com.klp.ems.domain.vo.EmsEnergyRateVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 能源费率(currency 为 INT:0=CNY,1=USD,2=EUR)Mapper接口
|
||||
@@ -12,4 +15,9 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface EmsEnergyRateMapper extends BaseMapperPlus<EmsEnergyRateMapper, EmsEnergyRate, EmsEnergyRateVo> {
|
||||
|
||||
/**
|
||||
* 按能源类型与日期获取生效费率。
|
||||
*/
|
||||
EmsEnergyRate selectEffectiveRate(@Param("energyTypeId") Long energyTypeId,
|
||||
@Param("calcDate") LocalDate calcDate);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.klp.ems.domain.EmsRateTier;
|
||||
import com.klp.ems.domain.vo.EmsRateTierVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 梯度费率Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
public interface EmsRateTierMapper extends BaseMapperPlus<EmsRateTierMapper, EmsRateTier, EmsRateTierVo> {
|
||||
|
||||
/**
|
||||
* 根据费率ID查询梯度费率列表
|
||||
*/
|
||||
List<EmsRateTierVo> selectByRateId(Long energyRateId);
|
||||
|
||||
/**
|
||||
* 物理删除指定费率的所有梯度
|
||||
*/
|
||||
int deleteByRateIdPhysical(Long energyRateId);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.klp.ems.domain.EmsRateTierPeriodLink;
|
||||
import com.klp.ems.domain.vo.EmsRateTierPeriodLinkVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 梯度与时段关联 Mapper 接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
public interface EmsRateTierPeriodLinkMapper extends BaseMapper<EmsRateTierPeriodLink> {
|
||||
|
||||
/**
|
||||
* 根据梯度ID查询所有关联的时段费率
|
||||
*
|
||||
* @param tierId 梯度ID
|
||||
* @return 梯度-时段关联列表
|
||||
*/
|
||||
List<EmsRateTierPeriodLink> selectByTierId(@Param("tierId") Long tierId);
|
||||
|
||||
/**
|
||||
* 根据梯度ID删除所有关联的时段费率(逻辑删除)
|
||||
*
|
||||
* @param tierId 梯度ID
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteByTierId(@Param("tierId") Long tierId);
|
||||
|
||||
/**
|
||||
* 根据梯度ID物理删除所有关联的时段费率
|
||||
*
|
||||
* @param tierId 梯度ID
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteByTierIdPhysical(@Param("tierId") Long tierId);
|
||||
|
||||
/**
|
||||
* 根据费率ID删除所有关联的梯度-时段费率(逻辑删除)
|
||||
*
|
||||
* @param energyRateId 费率ID
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteByEnergyRateId(@Param("energyRateId") Long energyRateId);
|
||||
|
||||
/**
|
||||
* 根据费率ID物理删除所有关联的梯度-时段费率
|
||||
*
|
||||
* @param energyRateId 费率ID
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteByEnergyRateIdPhysical(@Param("energyRateId") Long energyRateId);
|
||||
|
||||
/**
|
||||
* 查询梯度-时段关联的完整信息(包含梯度和时段详情)
|
||||
*
|
||||
* @param energyRateId 费率ID
|
||||
* @return 梯度-时段关联VO列表
|
||||
*/
|
||||
List<EmsRateTierPeriodLinkVo> selectVoByEnergyRateId(@Param("energyRateId") Long energyRateId);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.klp.ems.domain.EmsRateTimePeriodLink;
|
||||
import com.klp.ems.domain.vo.EmsRateTimePeriodLinkVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 费率与时间段关联Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
public interface EmsRateTimePeriodLinkMapper extends BaseMapperPlus<EmsRateTimePeriodLinkMapper, EmsRateTimePeriodLink, EmsRateTimePeriodLinkVo> {
|
||||
|
||||
/**
|
||||
* 根据费率ID查询峰谷时段费率列表
|
||||
*/
|
||||
List<EmsRateTimePeriodLinkVo> selectByRateId(Long energyRateId);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.klp.ems.domain.EmsTimePeriod;
|
||||
import com.klp.ems.domain.vo.EmsTimePeriodVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 时间段Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
public interface EmsTimePeriodMapper extends BaseMapperPlus<EmsTimePeriodMapper, EmsTimePeriod, EmsTimePeriodVo> {
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.klp.ems.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.ems.domain.WmsEnergyCoilDaily;
|
||||
import com.klp.ems.domain.bo.EnergyCostReportBo;
|
||||
import com.klp.ems.domain.vo.EnergyCostSummaryVo;
|
||||
import com.klp.ems.domain.vo.WmsEnergyCoilDailyStatisticsVo;
|
||||
import com.klp.ems.domain.vo.WmsEnergyCoilDailyVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 钢卷日能源成本分摊结果 Mapper
|
||||
*/
|
||||
public interface WmsEnergyCoilDailyMapper extends BaseMapperPlus<WmsEnergyCoilDailyMapper, WmsEnergyCoilDaily, WmsEnergyCoilDailyVo> {
|
||||
|
||||
/** 物理清理指定任务的明细 */
|
||||
int deleteByTaskId(Long taskId);
|
||||
|
||||
/** 查询指定任务的所有分摊记录 */
|
||||
List<WmsEnergyCoilDaily> selectListByTask(Long taskId);
|
||||
|
||||
/** 按能源类型汇总 */
|
||||
List<EnergyCostSummaryVo> summaryByEnergyType(@Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 按逻辑库区汇总 */
|
||||
List<EnergyCostSummaryVo> summaryByWarehouse(@Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 按计量设备汇总 */
|
||||
List<EnergyCostSummaryVo> summaryByMeter(@Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 按任务汇总 */
|
||||
List<EnergyCostSummaryVo> summaryByTask(@Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 概览统计 */
|
||||
Map<String, Object> selectEnergyOverview(@Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 明细分页 */
|
||||
Page<WmsEnergyCoilDailyVo> selectReportDetail(Page<WmsEnergyCoilDailyVo> page, @Param("bo") EnergyCostReportBo bo);
|
||||
|
||||
/** 查询待操作钢卷的能源成本(一次性SQL查询) */
|
||||
List<WmsEnergyCoilDailyVo> selectPendingActionCoilCost();
|
||||
|
||||
/** 查询待操作钢卷的能源成本统计 */
|
||||
WmsEnergyCoilDailyStatisticsVo selectPendingActionCoilCostStatistics(
|
||||
@Param("enterCoilNo") String enterCoilNo,
|
||||
@Param("currentCoilNo") String currentCoilNo,
|
||||
@Param("warehouseId") Long warehouseId
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user