package com.mvc.dao;

import com.mvc.entity.TAiread;
import com.mvc.entity.TAireadExample;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface TAireadMapper {
    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    long countByExample(TAireadExample example);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int deleteByExample(TAireadExample example);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int insert(TAiread record);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int insertSelective(TAiread record);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    List<TAiread> selectByExample(TAireadExample example);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    TAiread selectByPrimaryKey(Integer id);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int updateByExampleSelective(@Param("record") TAiread record, @Param("example") TAireadExample example);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int updateByExample(@Param("record") TAiread record, @Param("example") TAireadExample example);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int updateByPrimaryKeySelective(TAiread record);

    /**
     * @Description: 
     * @Author: guozhao
     * @CreateDate: 2025-04-14 16:17:19
     */
    int updateByPrimaryKey(TAiread record);

    TAiread findlastTAireadBydatatime(@Param("stationCode") String stationCode, @Param("sampleTime") Date sampleTime);

    /**
     * @Description: 根据多个站点查询最新数据
     * @param stationCodes
     * @param condition
     * @return
     */
    List<TAiread> findLatestDataByStationCodes(@Param("stationCodes") String[] stationCodes,@Param("condition") String condition);

    List<TAiread> findSameTimeDataByUnitAndDate(@Param("unitCode") String unitCode,@Param("sampleTime") Date sampleTime);

    List<TAiread> findMaintenanceAireadList();//查询维护记录过程的读数列表 2023-08-04 guozhao

    //客户使用的查询最新数据(主要针对太原天然气公司) 2024-03-07 guozhao
    List<TAiread> findLatestDataByStationCodes_Customer(@Param("stationCodes") String[] stationCodes);

    //根据SN串获取其对应最新的数据(微信使用) 2024-03-21 guozhao
    List<TAiread> findLatestDataByDeviceSns_Wx(@Param("deviceSns") String[] deviceSns);

    //根据SN串获取其对应最新的数据 2024-06-13 guozhao
    List<TAiread> findLatestDataByDeviceSns(@Param("deviceSns") String[] deviceSns);
}