IDeviceEventDao.java 820 B

123456789101112131415161718192021
  1. package com.wsm.admin.dao;
  2. import com.wsm.admin.model.DeviceEvent;
  3. import com.wsm.common.dao.IBaseDao;
  4. import org.springframework.data.jpa.repository.Query;
  5. import org.springframework.stereotype.Repository;
  6. import java.util.Date;
  7. import java.util.List;
  8. @Repository
  9. public interface IDeviceEventDao extends IBaseDao<DeviceEvent, Long> {
  10. List<DeviceEvent> findByContentAndPostTime(String content, Date postTime);
  11. @Query(value = "SELECT * from tb_device_event where device_id = ?1 and rec_status = 'A' order by update_time desc LIMIT 0,1", nativeQuery = true)
  12. DeviceEvent findByDeviceIdTop(Long id);
  13. @Query(value = "SELECT * from tb_device_event where device_id = ?1 and rec_status = 'A' and status = ?2 ", nativeQuery = true)
  14. DeviceEvent findByStatusAndDeviceId(Long deviceId, Integer status);
  15. }