/*
 * Copyright (c) 2024 codvision.com All Rights Reserved.
 */

package com.codvision.basic.mapper.inspection;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.codvision.basic.entity.inspection.InspectionTask;
import com.codvision.basic.entity.vo.inspection.InspectionTargetVO;
import com.codvision.basic.entity.vo.inspection.InspectionTaskVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author codvison
 */
public interface InspectionTaskMapper extends BaseMapper<InspectionTask> {

    /**
     * 分页通用查询
     * @param page 分页对象
     * @param paraMap 查询条件
     * @return 列表
     */
    IPage<InspectionTaskVO> getPageResult(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);

    Map<String, Integer> getTargetCount(@Param("query") Map<String, Object> params);

    Map<String, Integer> getTaskCount();

    IPage<InspectionTargetVO> getTargets(IPage<Map<String, Object>> page, @Param("query") Map<String, Object> paraMap);

    /**
     * 通过类型和标签获取任务
     * @param category 类型
     * @param checkTag  标签
     * @return InspectionTask
     */
    List<InspectionTask> getTaskByCheckTag(@Param("category") String category, @Param("checkTag") String checkTag);
}
