package com.skr.mdm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.so.client.ClientUpgradeSO;
import com.skr.mdm.bean.vo.statistics.ClientUpgradeStatisticsVO;
import com.skr.mdm.bean.vo.system.ClientUpgradeVO;
import com.skr.mdm.entity.ClientUpgradeDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ClientUpgradeDao extends BaseMapper<ClientUpgradeDO> {

    /**
     * 根据公司ID删除
     *
     * @param companyId 公司ID
     */
    void deleteByCompanyId(@Param("companyId") Integer companyId);

    /**
     * 获取设备最新升级版本
     *
     * @param equipmentId
     * @return
     */
    List<ClientUpgradeSO> listClientUpgradeByEquipmentId(@Param("equipmentId") Integer equipmentId, @Param("state") Integer state);

    /**
     * 客户端升级统计
     *
     * @param companyId
     * @param startTime
     * @param endTime
     * @return
     */
    List<ClientUpgradeStatisticsVO> listClientUpgradeStatistics(@Param("companyId") Integer companyId,
                                                                @Param("startTime") String startTime,
                                                                @Param("endTime") String endTime);

    /**
     * 客户端升级列表
     *
     * @param companyId
     * @param searchType
     * @param searchValue
     * @return
     */
    List<ClientUpgradeVO> listClientUpgradeVO(@Param("companyId") Integer companyId,
                                              @Param("searchType") Integer searchType,
                                              @Param("searchValue") String searchValue);

}