From 2f3e3ec2c0cad87eab8a6d170caffc06a4e11c2d Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 07 十一月 2019 09:55:24 +0800 Subject: [PATCH] set getData 1 sec and add day task --- src/main/java/com/cloud/count/dao/CountDao.java | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/cloud/count/dao/CountDao.java b/src/main/java/com/cloud/count/dao/CountDao.java index 44b6e6d..e34fce7 100644 --- a/src/main/java/com/cloud/count/dao/CountDao.java +++ b/src/main/java/com/cloud/count/dao/CountDao.java @@ -23,8 +23,8 @@ * @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); /** * 缁熻鍑哄幓浜烘暟 @@ -32,8 +32,8 @@ * @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); /** * 鎻掑叆涓�鏉eople鏁版嵁 @@ -58,9 +58,9 @@ // @Select("select * from OldNew where id=1") // OldNew getOldNew(); - @Update("update CountState set baseEnters=#{baseEnters},baseExits=#{baseExits},totalEnters=#{totalEnters},totalExits=#{totalExits},realtimeBaseEnters=#{realtimeBaseEnters},realtimeBaseExits=#{realtimeBaseExits},errorCount=#{errorCount}, baseTime=#{baseTime} where id=1") + @Update("update countstate set baseEnters=#{baseEnters},baseExits=#{baseExits},totalEnters=#{totalEnters},totalExits=#{totalExits},realtimeBaseEnters=#{realtimeBaseEnters},realtimeBaseExits=#{realtimeBaseExits},errorCount=#{errorCount}, baseTime=#{baseTime} where id=1") boolean updateCountState(CountState state); - @Select("select * from CountState where id=1") + @Select("select * from countstate where id=1") CountState getCountState(); } -- Gitblit v1.8.0