wu
2023-11-27 d9b5a16b878aef6181c8124c97ff298b0d0adbcd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.example.springboot.mapper;
 
import org.apache.ibatis.annotations.*;
 
import com.example.springboot.entity.alarmmg;
 
import java.util.List;
 
@Mapper
public interface AlarmMapper {
  @Select("SELECT * FROM alarmmg where endTime is not null and to_days(timeon)=to_days(now())")
  List<alarmmg> selectAll();// 查询当天所有已结束报警信息
 
  @Select("SELECT count(*) FROM alarmmg where endTime is null and content=#{content}")
  short selectnullti(String content);// 根据报警内容查询结束时间为null的
 
  @Insert("INSERT INTO `canadames`.`alarmmg`( `content`,`timeon`) VALUES ( #{content},now())")
  void Insertalarm(String content);// 添加一条报警数据
 
  @Insert("UPDATE  `canadames`.`alarmmg` set endTime= now() where endTime is null and content=#{content}")
  void updatealarm(String content);// 修改对应报警内容的结束时间
 
  @Select("SELECT * FROM alarmmg where timeon between #{sj1} and #{sj2}")
  List<alarmmg> selecttime(String sj1, String sj2);// 根据日期查询报警信息
}