package org.dromara.safety.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.safety.domain.HseQuestionsCategory;
import org.dromara.safety.domain.dto.questionscategory.HseQuestionsCategoryCreateReq;
import org.dromara.safety.domain.dto.questionscategory.HseQuestionsCategoryQueryReq;
import org.dromara.safety.domain.dto.questionscategory.HseQuestionsCategoryUpdateReq;
import org.dromara.safety.domain.vo.questionscategory.HseQuestionsCategoryVo;

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

/**
 * 题库类别Service接口
 *
 * @author lcj
 * @date 2025-04-15
 */
public interface IHseQuestionsCategoryService extends IService<HseQuestionsCategory> {

    /**
     * 查询题库类别
     *
     * @param id 主键
     * @return 题库类别
     */
    HseQuestionsCategoryVo queryById(Long id);

    /**
     * 分页查询题库类别列表
     *
     * @param req       查询条件
     * @param pageQuery 分页参数
     * @return 题库类别分页列表
     */
    TableDataInfo<HseQuestionsCategoryVo> queryPageList(HseQuestionsCategoryQueryReq req, PageQuery pageQuery);

    /**
     * 查询符合条件的题库类别列表
     *
     * @param req 查询条件
     * @return 题库类别列表
     */
    List<HseQuestionsCategoryVo> queryList(HseQuestionsCategoryQueryReq req);

    /**
     * 新增题库类别
     *
     * @param req 题库类别
     * @return 新增题库类别组件
     */
    Long insertByBo(HseQuestionsCategoryCreateReq req);

    /**
     * 修改题库类别
     *
     * @param req 题库类别
     * @return 是否修改成功
     */
    Boolean updateByBo(HseQuestionsCategoryUpdateReq req);

    /**
     * 校验并批量删除题库类别信息
     *
     * @param ids     待删除的主键集合
     * @param isValid 是否进行有效性校验
     * @return 是否删除成功
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     * 获取题库类别视图对象
     *
     * @param questionsCategory 题库类别对象
     * @return 题库类别视图对象
     */
    HseQuestionsCategoryVo getVo(HseQuestionsCategory questionsCategory);

    /**
     * 获取题库类别查询条件封装
     *
     * @param req 题库类别查询条件
     * @return 题库类别查询条件封装
     */
    LambdaQueryWrapper<HseQuestionsCategory> buildQueryWrapper(HseQuestionsCategoryQueryReq req);

    /**
     * 获取题库类别分页对象视图
     *
     * @param questionsCategoryPage 题库类别分页对象
     * @return 题库类别分页对象视图
     */
    Page<HseQuestionsCategoryVo> getVoPage(Page<HseQuestionsCategory> questionsCategoryPage);

}
