package com.skr.mdm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.vo.app.AppPushUserVO;
import com.skr.mdm.entity.MdmAppPushUserDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 应用推送版本信息(MdmAppPushUser)表数据库访问层
 *
 * @author nfq
 * @since 2022-12-02 15:49:01
 */
@Repository
public interface MdmAppPushUserDao extends BaseMapper<MdmAppPushUserDO> {

    /**
     * 根据设备ID删除
     *
     * @param equipmentIdList 设备ID集合
     */
    void deleteByEquipmentIdList(@Param("equipmentIdList") List<Integer> equipmentIdList);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<MdmAppPushUser> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<MdmAppPushUserDO> entities);

    List<AppPushUserVO> listAppPushUserVO(@Param("appPushId") Integer appPushId,
                                          @Param("searchType") Integer searchType,
                                          @Param("searchValue") String searchValue);

    List<Integer> listEquipmentIdByStrategyIds(@Param("list") List<Integer> strategyIdList);

    List<Integer> listUserState(@Param("appPushId") Integer appPushId);
}

