12345678910111213141516171819202122232425262728293031 |
- package cn.efunbox.audio.repository;
- import cn.efunbox.audio.entity.Device;
- import org.springframework.data.domain.Pageable;
- import org.springframework.data.jpa.repository.JpaRepository;
- import org.springframework.data.jpa.repository.Query;
- import org.springframework.data.repository.query.Param;
- import org.springframework.stereotype.Repository;
- import java.util.List;
- /**
- * Created by yao on 17-9-26.
- */
- @Repository
- public interface DeviceRepo extends JpaRepository<Device, Long> {
- Device findById(Long id);
- List<Device> findByIdDevice(Long idDevice);
- List<Device> findByIdChannel(Long idChannel, Pageable pageable);
- @Query("from Device d where d.idDevice=:idDevice")
- List<Device> findByDevice(@Param("idDevice")String idDevice);
- @Query("from Device d where d.idChannel=:idChannel")
- List<Device> findByChannel(@Param("idChannel")String idChannel);
- @Query("from Device d where d.idChannel=:idChannel and d.idDevice=:idDevice")
- List<Device> findByChannelDevice(@Param("idChannel")Long idChannel, @Param("idDevice")Long idDevice);
- }
|