2022-02-10 15:41:52 +08:00
|
|
|
package com.xkrs.dao;
|
|
|
|
|
|
|
|
import com.xkrs.model.entity.Equipment;
|
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
2022-02-12 10:22:44 +08:00
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
2022-02-10 15:41:52 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @Author: XinYi Song
|
|
|
|
* @Date: 2022/2/8 9:26
|
|
|
|
*/
|
|
|
|
public interface EquipmentDao extends JpaRepository<Equipment,Long> {
|
2022-02-12 10:22:44 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据设备编码修改实时视频路径
|
|
|
|
* @param code
|
|
|
|
* @param videoPath
|
|
|
|
*/
|
|
|
|
@Modifying(clearAutomatically=true)
|
|
|
|
@Query(value = "update equipment set live_video = ?2 where equipment_code = ?1",nativeQuery = true)
|
|
|
|
void updateVideo(String code,String videoPath);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询全部设备信息
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Query(value = "select * from equipment",nativeQuery = true)
|
|
|
|
List<Equipment> findAllInformation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询实时视频
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Query(value = "select equipment_code equipmentcode,live_video livevideo from equipment",nativeQuery = true)
|
|
|
|
List<Map<String,String>> findVideoPath();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取设备的信息
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Query(value = "select equipment_code equipmentcode,equipment_name equipmentname,equipment_type equipmenttype," +
|
|
|
|
"equipment_status equipmentstatus,equipment_longitude equipmentlongitude," +
|
|
|
|
"equipment_latitude equipmentlatitude,installation_time installationtime from equipment",nativeQuery = true)
|
|
|
|
List<Map<String,String>> findEquipment();
|
2022-02-10 15:41:52 +08:00
|
|
|
}
|