Files
klp-oa/klp-aps/src/main/java/com/klp/aps/mapper/ApsAutoScheduleMapper.java

65 lines
2.8 KiB
Java
Raw Normal View History

2026-03-08 16:02:44 +08:00
package com.klp.aps.mapper;
import com.klp.aps.domain.entity.ApsScheduleChangeLogEntity;
import com.klp.aps.domain.entity.ApsScheduleOperationEntity;
import com.klp.aps.domain.row.ApsLineCapabilityRow;
import com.klp.aps.domain.row.ApsLineMetaRow;
import com.klp.aps.domain.row.ApsOrderDetailRow;
import com.klp.aps.domain.row.ApsPlanDetailRow;
import com.klp.aps.domain.row.ApsProductMetaRow;
import com.klp.aps.domain.row.ApsSchedulePlanRow;
import com.klp.aps.domain.row.ApsShiftSlotRow;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.time.LocalDate;
import java.util.List;
public interface ApsAutoScheduleMapper {
ApsSchedulePlanRow selectPlanByIdForUpdate(@Param("planId") Long planId);
List<ApsOrderDetailRow> selectOrderDetailsByOrderId(@Param("orderId") Long orderId);
List<ApsPlanDetailRow> selectPlanDetailsByPlanId(@Param("planId") Long planId);
List<ApsLineCapabilityRow> selectLineCandidatesByProductAndLine(@Param("productId") Long productId,
@Param("lineId") Long lineId);
ApsLineMetaRow selectLineMetaById(@Param("lineId") Long lineId);
ApsProductMetaRow selectProductMetaById(@Param("productId") Long productId);
List<ApsShiftSlotRow> selectAvailableShifts(@Param("lineId") Long lineId,
@Param("startDate") LocalDate startDate,
@Param("endDate") LocalDate endDate);
Long selectPlanDetailId(@Param("planId") Long planId, @Param("taskId") Long taskId);
int deleteUnlockedOperationsByPlanId(@Param("planId") Long planId);
/**
* 返回冲突记录的 end_time若无冲突返回 null
*/
LocalDateTime selectFirstConflictEndTime(@Param("lineId") Long lineId,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime,
@Param("excludeOperationId") Long excludeOperationId);
/**
* 返回命中锁定的 lock_end_time若未命中返回 null
*/
LocalDateTime selectFirstHitLockEndTime(@Param("lineId") Long lineId,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime,
@Param("planId") Long planId,
@Param("excludeOperationId") Long excludeOperationId);
int insertOperation(ApsScheduleOperationEntity op);
int insertChangeLog(ApsScheduleChangeLogEntity log);
int updatePlanStatus(@Param("planId") Long planId, @Param("status") Integer status, @Param("updateBy") String updateBy);
}