sensoritem paging sorting
This commit is contained in:
parent
55d1b7ec4f
commit
52f553a9b9
|
@ -2,16 +2,15 @@ package com.loafle.overflow.module.sensor.dao;
|
||||||
|
|
||||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by root on 17. 6. 9.
|
* Created by root on 17. 6. 9.
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface SensorItemDAO extends JpaRepository<SensorItem, Long> {
|
public interface SensorItemDAO extends JpaRepository<SensorItem, Long> {
|
||||||
List<SensorItem> findAllBySensor(Sensor sensor, Pageable pageable);
|
Page<SensorItem> findAllBySensor(Sensor sensor, Pageable pageable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.loafle.overflow.module.sensor.dao.SensorItemDAO;
|
||||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -31,7 +32,7 @@ public class SensorItemService {
|
||||||
return this.sensorItemDAO.findOne(Long.valueOf(id));
|
return this.sensorItemDAO.findOne(Long.valueOf(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SensorItem> readAllBySensor(Sensor sensor, PageParams pageParams) {
|
public Page<SensorItem> readAllBySensor(Sensor sensor, PageParams pageParams) {
|
||||||
return this.sensorItemDAO.findAllBySensor(sensor, PageUtil.getPageRequest(pageParams));
|
return this.sensorItemDAO.findAllBySensor(sensor, PageUtil.getPageRequest(pageParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user