package com.fdkankan.scene.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fdkankan.scene.entity.ScenePro;
import com.fdkankan.scene.entity.SceneProPO;
import com.fdkankan.scene.vo.SceneBySnCodeVo;
import com.fdkankan.scene.vo.SceneParamVO;
import com.fdkankan.scene.vo.SceneProVO;
import com.fdkankan.scene.vo.SceneVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * pro场景表 Mapper 接口
 * </p>
 *
 * @author dengsixing
 * @since 2021-12-23
 */
@Mapper
public interface ISceneProMapper extends BaseMapper<ScenePro> {

    Integer findFolderIdScence(SceneProVO param);

    ScenePro findLikeNum(@Param("sceneCode")String sceneCode);

    ScenePro findByNum(@Param("sceneCode")String sceneCode);

    SceneProPO getSceneStatusByUnicode(@Param("unicode") String unicode, @Param("tbStatus") Integer tbStatus);

    List<SceneProPO> findByUserIdAndCameraType(@Param("userId") Long userId, @Param("cameraType") Integer cameraType);

    List<SceneProPO> findByUserId(@Param("userId") Long userId, @Param("excludeNums") List<String> excludeNums);

    List<SceneProPO> findBySceneNums(@Param("sceneCodeList") List<String> sceneCodeList, @Param("cameraType") Integer cameraType);

    SceneVO findLatestOneByUserId(@Param("userId")Long userId);

    List<SceneProPO> findByCameraIdPro(@Param("cameraId")Long cameraId);

    SceneProPO findByFileId(@Param("fileId") String fileId);

    List<ScenePro> findTempScenes();

    List<SceneVO> getAppAllSceneByPage(Page<SceneVO> page, @Param("cameraId")Long cameraId, @Param("userId")Long userId,
                                       @Param("cameraType")int cameraType, @Param("sceneType")Integer sceneType,
                                       @Param("sceneCodeList")List<String> sceneCodeList, @Param("sceneName") String sceneName, @Param("orderBy") String orderBy);

    SceneProPO findLastSceneByCameraId(Long cameraId);

    SceneProPO findByNumWithOutCheckRecStatus(String sceneNum);

    List<SceneProPO> selectCooperationSceneList(SceneParamVO param);

    List<SceneProPO> selectSceneList(SceneParamVO param);


    List<SceneProPO> findByCameraIds(String cameraIds, String startTime, String endTime);

    List<SceneBySnCodeVo> getNumAndNameByCameraId(@Param("cameraId") Long cameraId, @Param("userId")  Long userId);
}
