package com.skr.mdm.dao;

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

import java.util.List;

/**
 * 应用商店指定部门/用户(MdmAppStoreUser)表数据库访问层
 *
 * @author nfq
 * @since 2022-11-22 10:47:23
 */
@Repository
public interface MdmAppStoreUserDao extends BaseMapper<MdmAppStoreUserDO> {

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


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


    List<AppStoreUserVO> listAppStoreUserVO(@Param("strategyId") Integer strategyId,
                                            @Param("searchType") Integer searchType,
                                            @Param("searchValue") String searchValue);
}

