package com.skr.mdm.dao;

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

import java.util.List;

@Repository
public interface SysSendMsgUserDao extends BaseMapper<SysSendMsgUserDO> {

	/**
	 * 获取表数据量
	 * @return 总数
	 */
	Integer countAll();

	/**
	 * 获取超出限制的数据ID
	 * @param delCount 超出限制的数量
	 * @return 超出限制的数据ID
	 */
	List<Integer> listDelId(Integer delCount);

	/**
	 * 获取过期已下发ID
	 * @param expireDate 过期日期
	 * @return list
	 */
	List<Integer> listExpireDelId(@Param("expireDate") String expireDate);

	void insertBatch(@Param("sendMsgId") Long sendMsgId, @Param("state") Integer state, @Param("list") List<Integer> equipmentIdList);

	/**
	 * 获取设备未下发成功指令
	 * @param equipmentId
	 * @param state 1:下发中
	 * @return
	 */
	List<SysSendMsgDO> listIssuedSendMsg(@Param("equipmentId") Integer equipmentId, @Param("state") Integer state);

}