package cn.iocoder.lyzsys.module.tjt.dal.mysql.outputsplit;

import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.outputsplit.ProjectOutputSplitDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.Collection;
import java.util.List;

/**
 * 页面 4 拆分比例 Mapper
 *
 * @author Codex
 */
@Mapper
public interface ProjectOutputSplitMapper extends BaseMapperX<ProjectOutputSplitDO> {

    default ProjectOutputSplitDO selectByPlanningId(Long planningId) {
        return selectOne(new LambdaQueryWrapperX<ProjectOutputSplitDO>()
                .eq(ProjectOutputSplitDO::getPlanningId, planningId));
    }

    default List<ProjectOutputSplitDO> selectListByPlanningIds(Collection<Long> planningIds) {
        return selectList(new LambdaQueryWrapperX<ProjectOutputSplitDO>()
                .inIfPresent(ProjectOutputSplitDO::getPlanningId, planningIds));
    }

}
