package com.casic.missiles.modular.system.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.casic.missiles.core.datascope.DataScope;
import com.casic.missiles.modular.system.dto.*;
import com.casic.missiles.modular.system.model.Device;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备表 Mapper 接口
 * </p>
 *
 * @author lwh123
 * @since 2019-05-23
 */
public interface DeviceMapper extends BaseMapper<Device> {

    List<DeviceDto> selectDataScopePage(@Param("scope") DataScope dataScope, @Param("page") Page<DeviceDto> page, @Param("deviceType") String deviceType, @Param("deptid") String deptid, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("keywords") String keywords);

    DeviceWellDto selectWellIdByCode(@Param("wellCode") String wellCode);

    DeviceConcentratorDto selectDeviceConcentorByCode(@Param("concenCode") String concenCode);

    List<DeviceMonitorDataDto> selectWellDataScopePage(@Param("dataScope") DataScope dataScope, @Param("page") Page<DeviceMonitorDataDto> page, @Param("deptid") String deptid, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("keywords") String keywords);

    List<DeviceMonitorDataDto> selectLiquidDataScopePage(@Param("dataScope") DataScope dataScope, @Param("page") Page<DeviceMonitorDataDto> page, @Param("deptid") String deptid, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("keywords") String keywords);

    List<AlarmDeptStaticsDto> alarmsStaticsByDept(@Param("deviceType") Long deviceType, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("dataScope") DataScope dataScope, @Param("deptId")Long deptId, @Param("searchCurr")Boolean searchCurr);
    List<WellDeptStaticsDto> wellStaticsByDept(@Param("pid") Long pid, @Param("dataScope") DataScope dataScope);
    List<WellParentDeptStaticsDto> wellStaticsByParentDept();


    List<DeviceCodeSelectDto> selectDevicesByConfig(@Param("dataScope") DataScope dataScope, @Param("deviceType") String deviceType, @Param("configStatus") String configStatus);

    AlarmDeptStaticsDto alarmsSubDeptStaticsByDept(@Param("deviceType")Long deviceType, @Param("beginTime")String beginTime, @Param("endTime")String endTime, @Param("deptId")Long deptId);
}
