package com.yaoai.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yaoai.domain.entity.ProjectConsistencyBible;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ProjectConsistencyBibleMapper extends BaseMapper<ProjectConsistencyBible> {

    default ProjectConsistencyBible findByProject(Long projectId, Long tenantId) {
        return selectOne(Wrappers.<ProjectConsistencyBible>lambdaQuery()
                .eq(ProjectConsistencyBible::getProjectId, projectId)
                .eq(ProjectConsistencyBible::getTenantId, tenantId)
                .last("LIMIT 1"));
    }
}
