package com.skr.mdm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.vo.app.AppStrategyVO;
import com.skr.mdm.bean.vo.equipment.DeviceAppStrategyVO;
import com.skr.mdm.entity.AppStrategyDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppStrategyDao extends BaseMapper<AppStrategyDO> {

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

    /**
     * 应用策略列表
     *
     * @param companyId
     * @param strategyIdList
     * @param searchType
     * @param searchValue
     * @return
     */
    List<AppStrategyVO> listAppStrategyVO(@Param("companyId") Integer companyId,
                                          @Param("strategyIdList") List<Integer> strategyIdList,
                                          @Param("searchType") Integer searchType,
                                          @Param("searchValue") String searchValue);

    /**
     * 应用策略内容检索
     *
     * @param searchValue
     * @return
     */
    List<Integer> listStrategyIdByStrategyContent(String searchValue);

    List<DeviceAppStrategyVO> listDeviceAppStrategyVO(@Param("equipmentId") Integer equipmentId);
}