adsfcasd
This commit is contained in:
@ -2,10 +2,47 @@ package com.xkrs.dao;
|
||||
|
||||
import com.xkrs.model.entity.Equipment;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: XinYi Song
|
||||
* @Date: 2022/2/8 9:26
|
||||
*/
|
||||
public interface EquipmentDao extends JpaRepository<Equipment,Long> {
|
||||
|
||||
/**
|
||||
* 根据设备编码修改实时视频路径
|
||||
* @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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user