package com.alarm.mapper;

import com.alarm.entity.alarm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface alarmMapper {
    @Select("select * from alarm order by time DESC limit 15")
    List<alarm> list();

    @Select("select count(*) from alarm")
    Integer selectAll();

    @Select("select count(*) from alarm where type = #{type}")
    Integer select(Integer type);

    @Select("select count(*) from alarm where time between CONCAT(CURDATE(), ' 00:00:00') and NOW()")
    Integer selectTd();
}
