package com.huimv.video.repo;

import com.huimv.video.domain.CameraInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.video.repo
 * @Description : TODO
 * @Author : yuxuexuan
 * @Create : 2021/1/7 0007 13:57
 **/
public interface CameraInfoRepo extends JpaRepository<CameraInfo,Integer> , JpaSpecificationExecutor<CameraInfo> {
    @Query(nativeQuery = true,value = "select * from camera_info where name like %?1%")
    List<CameraInfo> findByNameLike(String name);


    @Query(nativeQuery = true,value = "select * from camera_info where  area_id=?1")
    List<CameraInfo> findAllByAreaId(Integer areaId);
}
