zhitong.yu
2024-12-27 8abbee975353926e51a426a75c67119337fbdae4
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.hxzk.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hxzk.pojo.TbHeartRecord;
import org.apache.ibatis.annotations.Select;
 
public interface HeartDao extends BaseMapper<TbHeartRecord> {
 
    @Select("select count(*) from tb_heart_record where state = '超高' ")
    Integer findChaoGao();
    @Select("select count(*) from tb_heart_record where state = '超低' ")
    Integer findChaoDi();
    @Select("select count(*) from tb_heart_record where state = '正常' ")
    Integer findZengChang();
 
    //超高人员Top1
    @Select("select count(*) as tagid,name from tb_heart_record where state ='超高'  group by name  order by count(*) desc  limit 0,1")
    TbHeartRecord findChaoGaoYi();
 
 
    //超高人员Top2
    @Select("select count(*) as tagid,name from tb_heart_record where state ='超高'  group by name  order by count(*) desc  limit 1,1")
    TbHeartRecord findChaoGaoEr();
 
 
    @Select("select count(*) from tb_heart_record where state = '超低' and name = #{name} ")
    Integer findChaoGaoYis(String name);
    @Select("select count(*) from tb_heart_record where state ='超低' and name = #{name} ")
    Integer findChaoGaoErs(String name);
 
 
    //超高人员Top1
    @Select("select count(*) as tagid,name from tb_heart_record where state ='超低'  group by name  order by count(*) desc  limit 0,1")
    TbHeartRecord  findChaoDiYi();
    //超高人员Top2
    @Select("select count(*) as tagid,name from tb_heart_record where state ='超低'  group by name  order by count(*) desc  limit 1,1")
    TbHeartRecord  findChaoDiEr();
 
 
    @Select("select count(*) from tb_heart_record where state ='超高' and name = #{name}")
    Integer findChaoDiYis(String name);
 
    @Select("select count(*) from tb_heart_record where state ='超高' and name = #{name}")
    Integer findChaoDiErs(String name);
 
 
    @Select("SELECT COUNT(*) FROM tb_heart_record WHERE TIME >= DATE_SUB(NOW(), INTERVAL 10 DAY) AND state = '超高' AND NAME = '' OR TIME >= DATE_SUB(NOW(), INTERVAL 10 DAY) AND state = '超低'  AND NAME = #{name}")
    String GuoQuDay(String name);
 
    @Select("SELECT COUNT(*) FROM tb_heart_record WHERE TIME >= DATE_SUB(NOW(), INTERVAL 30 DAY) AND state = '超高' AND NAME = #{name} OR TIME >= DATE_SUB(NOW(), INTERVAL 30 DAY) AND state = '超低'  AND NAME = #{name}")
    String GuoQuYue(String name);
 
 
}