搭建智慧城乡项目,并实现mq消息订阅,websocket推送报警信息等功能

This commit is contained in:
2022-02-10 15:41:52 +08:00
commit bb41afa86c
37 changed files with 3796 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package com.xkrs.dao;
import com.xkrs.model.entity.Equipment;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Author: XinYi Song
* @Date: 2022/2/8 9:26
*/
public interface EquipmentDao extends JpaRepository<Equipment,Long> {
}

View File

@ -0,0 +1,31 @@
package com.xkrs.dao;
import com.xkrs.model.entity.Fire;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;
/**
* @Author: XinYi Song
* @Date: 2022/2/8 17:12
*/
@Component
public interface FireDao extends JpaRepository<Fire,Long> {
/**
* 根据报警编码查询火情信息
* @param code
* @return
*/
Fire findByAlarmCode(String code);
/**
* 根据报警编码修改图片信息
* @param code
* @param picturePath
*/
@Modifying(clearAutomatically=true)
@Query(value = "update fire set picture_path = ?2 where alarm_code = ?1",nativeQuery = true)
void updatePicturePath(String code, String picturePath);
}