package com.yeejoin.amos.boot.module.jg.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.dto.SafetyProblemTracingDto;
import org.apache.ibatis.annotations.Param;

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

/**
 * 安全追溯问题 Mapper 接口
 *
 * @author system_generator
 * @date 2024-05-21
 */
public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTracing> {

    Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, @Param("problemModel")SafetyProblemTracingDto problemModel);

    Page<Map<String, Object>> queryEquipListByProblemId(Page<Map<String, Object>> page, String problemId);

    Page<Map<String, Object>> queryPrincipalUnitByProblemId(Page<Map<String, Object>> page, String problemId, String sourceTypeCode);

    List<Map<String, Object>> queryOutOfMaintenanceRecord();

    List<String> getBusinessType(@Param("sourceTypeCode") String sourceTypeCode, @Param("orgCode") String orgCode);

    List<Map<String, Object>> getBusinessCount(@Param("sourceTypeCode") String sourceTypeCode, @Param("orgCode") String orgCode);

    Long countByTypeListAndOrgCode(@Param("typeList") List<String> typeList, @Param("orgCode") String orgCode, @Param("mainBody") String mainBody);

    List<Map<String, Object>> countEquOverdue(@Param("typeList") List<String> typeList,@Param("orgCode") String orgCode);

    List<String> getSourceId(@Param("orgCode") String orgCode, @Param("typeList") List<String> typeList);

    Page<Map<String, Object>> queryUserListProblemById(Page<Map<String, Object>> page, String problemId);
}
