package com.klp.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.klp.common.core.mapper.BaseMapperPlus; import com.klp.domain.WmsCoilPendingAction; import com.klp.domain.vo.WmsCoilPendingActionVo; import com.klp.domain.vo.WmsCoilPendingActionIdCoilVo; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 钢卷待操作Mapper接口 * * @author Joshi * @date 2025-11-03 */ public interface WmsCoilPendingActionMapper extends BaseMapperPlus { Page selectVoPagePlus(Page build,@Param("ew") QueryWrapper lqw); /** * 分页查询待操作记录中,关联钢卷已是历史钢卷(dataType=0)且操作未完成(actionStatus != 2)的记录 */ Page selectStaleActionVoPagePlus(Page page, @Param("ew") QueryWrapper lqw); /** * 仅返回 actionId 与 coilId */ java.util.List selectActionIdCoilIdList(@Param("ew") QueryWrapper lqw); /** * 更新删除标志(绕过@TableLogic注解限制) * @param actionId 操作ID * @param delFlag 删除标志(0=正常,1=已删除) * @return 更新行数 */ int updateDelFlag(@Param("actionId") Long actionId, @Param("delFlag") Integer delFlag); /** * 根据操作ID和删除标志查询记录(包含已删除记录) * @param actionId 操作ID * @param delFlag 删除标志(0=正常,1=已删除) * @return 待操作记录 */ WmsCoilPendingAction selectByActionIdAndDelFlag(@Param("actionId") Long actionId, @Param("delFlag") Integer delFlag); /** * 批量查询:找出 processed_coil_ids 中包含给定 coilId 列表中任意一个的记录, * 只返回 action_type 和 processed_coil_ids 两列(供规程同步线路匹配用)。 */ List selectActionTypeByProcessedCoilIds(@Param("coilIds") List coilIds); /** * 获取所有有效待操作记录的 processed_coil_ids 字符串列表(供规程同步主键展开用)。 */ List selectAllProcessedCoilIdStrings(); /** * 获取所有有效待操作记录的 processed_coil_ids + action_status + action_type, * 供规程同步页面同时构建"已处理钢卷 ID 集"和"录入状态"映射。 */ List selectAllProcessedCoilIdsAndActionStatus(); /** * 规程同步:按 actionType 集合查询全部待操作记录(含未录入和已录入)。 * 返回 action_id / coil_id / action_type / action_status / processed_coil_ids 五列。 */ List selectPendingByActionTypes( @Param("actionTypes") java.util.Collection actionTypes); }