package com.skr.mdm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.vo.statistics.CmdTypeStatisticsVO;
import com.skr.mdm.entity.SysSendMsgDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysSendMsgDao extends BaseMapper<SysSendMsgDO> {

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

    /**
     * 获取未下发成功的指令
     * @param equipmentId
     * @param state
     * @return
     */
    List<SysSendMsgDO> getSendMsgInfo(@Param("equipmentId") Integer equipmentId, @Param("state") Integer state);

    /**
     * 指令统计（按天）
     * @param companyId
     * @param cmdDate
     * @return
     */
	List<CmdTypeStatisticsVO> cmdStatisticsGroupByCmdType(@Param("companyId") Integer companyId, @Param("cmdDate") String cmdDate);

}