package org.dromara.knowledge.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.knowledge.domain.KnowledgeSchemaField;
import org.dromara.knowledge.domain.bo.KnowledgeSchemaFieldBo;
import org.dromara.knowledge.domain.vo.KnowledgeSchemaFieldVo;

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

/**
 * 知识库数据模型字段Service接口
 *
 * @author pengles
 */
public interface KnowledgeSchemaFieldService extends IService<KnowledgeSchemaField> {

    /**
     * 查询知识库模式字段
     */
    KnowledgeSchemaFieldVo queryById(Long id);

    /**
     * 查询知识库模式字段列表
     */
    TableDataInfo<KnowledgeSchemaFieldVo> queryPageList(KnowledgeSchemaFieldBo bo, PageQuery pageQuery);

    /**
     * 查询知识库模式字段列表
     */
    List<KnowledgeSchemaFieldVo> queryList(KnowledgeSchemaFieldBo bo);

    /**
     * 新增知识库模式字段
     */
    Boolean insertByBo(KnowledgeSchemaFieldBo bo);

    /**
     * 修改知识库模式字段
     */
    Boolean updateByBo(KnowledgeSchemaFieldBo bo);

    /**
     * 校验并批量删除知识库模式字段
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     * 根据模式ID查询字段列表
     */
    List<KnowledgeSchemaFieldVo> queryListBySchemaId(Long schemaId);

    /**
     * 根据编码查询字段信息
     */
    KnowledgeSchemaFieldVo queryByCode(String code);

    /**
     * 根据模式ID和字段编码查询字段信息
     */
    KnowledgeSchemaFieldVo queryBySchemaIdAndCode(Long schemaId, String code);
}