| | |
| | | * @return |
| | | */ |
| | | // @Select("select COALESCE(sum(enters),0) from people where timestamp BETWEEN #{begin} AND #{end}") |
| | | @Select("SELECT COALESCE(p2.enters-p1.enters,0) FROM (SELECT enters from people where timestamp BETWEEN #{begin} AND #{end} ORDER BY id ASC LIMIT 1)p1,(SELECT enters from people where timestamp BETWEEN #{begin} AND #{end} ORDER BY id DESC LIMIT 1)p2") |
| | | Integer countInPeople(@Param("begin") long begin,@Param("end") long end); |
| | | @Select("SELECT COALESCE(p2.enters-p1.enters,0) FROM (SELECT enters from people where dateStr=#{todayStr} and timestamp BETWEEN #{begin} AND #{end} ORDER BY id ASC LIMIT 1)p1,(SELECT enters from people where dateStr=#{todayStr} and timestamp BETWEEN #{begin} AND #{end} ORDER BY id DESC LIMIT 1)p2") |
| | | Integer countInPeople(@Param("begin") long begin,@Param("end") long end,@Param("todayStr") String todayStr); |
| | | |
| | | /** |
| | | * 统计出去人数 |
| | |
| | | * @return |
| | | */ |
| | | // @Select("select COALESCE(sum(exits),0) from people where timestamp BETWEEN #{begin} AND #{end}") |
| | | @Select("SELECT COALESCE(p2.exits-p1.exits,0) FROM (SELECT exits from people where timestamp BETWEEN #{begin} AND #{end} ORDER BY id ASC LIMIT 1)p1,(SELECT exits from people where timestamp BETWEEN #{begin} AND #{end} ORDER BY id DESC LIMIT 1)p2") |
| | | Integer countOutPeople( @Param("begin") long begin,@Param("end") long end); |
| | | @Select("SELECT COALESCE(p2.exits-p1.exits,0) FROM (SELECT exits from people where dateStr=#{todayStr} and timestamp BETWEEN #{begin} AND #{end} ORDER BY id ASC LIMIT 1)p1,(SELECT exits from people where dateStr=#{todayStr} and timestamp BETWEEN #{begin} AND #{end} ORDER BY id DESC LIMIT 1)p2") |
| | | Integer countOutPeople( @Param("begin") long begin,@Param("end") long end,@Param("todayStr") String todayStr); |
| | | |
| | | /** |
| | | * 插入一条People数据 |