添加了查询一年中每月的火情数量

This commit is contained in:
2022-02-16 10:14:17 +08:00
parent 52ec30f940
commit ca53051967
2 changed files with 27 additions and 1 deletions

View File

@ -67,4 +67,15 @@ public interface EquipmentDao extends JpaRepository<Equipment,Long> {
"from equipment e,fire f where f.alarm_date BETWEEN ?1 AND ?2 " +
"AND e.equipment_code = f.device_code GROUP BY LEFT(f.alarm_date,10),e.street",nativeQuery = true)
List<Map<String,Object>> selectEveryDayCount(String beginTime, String endTime);
/**
* 查询一年中每个月的各个街道的火情数量
* @param beginTime
* @param endTime
* @return
*/
@Query(value = "select LEFT(f.alarm_date,7) AS data,e.street as street,count(f.id) AS firenumber " +
"from equipment e,fire f where f.alarm_date BETWEEN ?1 AND ?2 " +
"AND e.equipment_code = f.device_code GROUP BY LEFT(f.alarm_date,7),e.street",nativeQuery = true)
List<Map<String,Object>> selectEveryMonthCount(String beginTime, String endTime);
}