Ver Fonte

优化速度

zhengkaixin há 4 anos atrás
pai
commit
378013223c

+ 1 - 1
common/src/main/java/com/jpsoft/shinestar/modules/base/dao/PersonDeviceLogDAO.java

@@ -38,7 +38,7 @@ public interface PersonDeviceLogDAO {
 
 
     List<PersonDeviceLog> findAllPersonLogByDeviceNo(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
-                                                                 @Param("deviceNoList") List<String> deviceNoList);
+                                                                 @Param("deviceNoList") String deviceNoList);
 
     List<PersonDeviceLog> findAllPersonLogByCompanyIdAndDeviceNo(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                                                  @Param("companyList") List<CompanyInfo> companyList,

+ 1 - 1
common/src/main/java/com/jpsoft/shinestar/modules/base/service/PersonDeviceLogService.java

@@ -41,7 +41,7 @@ public interface PersonDeviceLogService {
     Page<PersonDeviceLog> findVisitorLogByDeviceNoList(DateTime beginOfDay, DateTime endOfDay, List<String> deviceNoList, int pageIndex, int pageSize);
     Page<PersonDeviceLog> findVisitorLogByDeviceNoList(DateTime beginOfDay, DateTime endOfDay, List<String> deviceNoList, int pageIndex, int pageSize, String filter, BigDecimal max);
 
-    Page<PersonDeviceLog> findAllPersonLogByDeviceNo(DateTime beginOfDay, DateTime endOfDay, List<String> deviceList, int pageIndex, int pageSize);
+    Page<PersonDeviceLog> findAllPersonLogByDeviceNo(DateTime beginOfDay, DateTime endOfDay, String deviceList, int pageIndex, int pageSize);
 
     Page<PersonDeviceLog> findAllPersonLogByCompanyListAndDeviceNoList(DateTime beginOfDay, DateTime endOfDay, List<CompanyInfo> companyList, List<String> deviceList, int pageIndex, int pageSize);
     Page<PersonDeviceLog> findLastTeacherLogByCompanyList(Date beginOfDay, Date endOfDay, List<CompanyInfo> list, int pageIndex, int pageSize);

+ 1 - 1
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -248,7 +248,7 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
 
 
     @Override
-    public Page<PersonDeviceLog> findAllPersonLogByDeviceNo(DateTime beginOfDay, DateTime endOfDay,List<String> deviceNoList,int pageIndex, int pageSize) {
+    public Page<PersonDeviceLog> findAllPersonLogByDeviceNo(DateTime beginOfDay, DateTime endOfDay,String deviceNoList,int pageIndex, int pageSize) {
         Page<PersonDeviceLog> page = PageHelper.startPage(pageIndex, pageSize).doSelectPage(() -> {
             personDeviceLogDAO.findAllPersonLogByDeviceNo(beginOfDay,endOfDay,deviceNoList);
         });

+ 5 - 5
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -355,14 +355,14 @@
         <![CDATA[
             select person_id,face_Image,max(record_Time) as record_Time from base_person_device_log
             where 1=1
-            and record_time >= #{startTime}
-            and record_time <= #{endTime}
             and person_id!=0
             and del_flag = 0
+            and record_time >= #{startTime}
+            and record_time <= #{endTime}
+
+            and device_no=#{deviceNoList}
         ]]>
-        <foreach collection="deviceNoList" index="index" item="item" open="and device_no in(" separator="," close=")">
-            #{item}
-        </foreach>
+
         group by person_id
         order by record_time desc
 

+ 3 - 17
web/src/main/java/com/jpsoft/shinestar/modules/business/controller/HealthPublicityController.java

@@ -144,25 +144,10 @@ public class HealthPublicityController {
     }
     @GetMapping("/healthPublicityCanteen")
     public String canteen(String id, Model model) {
-        DeviceInfo info = deviceInfoService.get(id);
 
 
-        model.addAttribute("now", DateTime.now().toString("yyyy-MM-dd HH:mm"));
-
-
-        List<String> deviceNoList = new ArrayList<>();
-        List<CompanyInfo> list=new ArrayList<>();
-        CompanyInfo cinfo= new CompanyInfo();
-        cinfo.setId("test");
-        list.add(cinfo);
-        deviceNoList.add(info.getDeviceNo());
-
-        if (deviceNoList.size()==0){
-            deviceNoList.add("-1");
-        }
-
         Page<PersonDeviceLog> personDeviceLogList1 = personDeviceLogService.findAllPersonLogByDeviceNo(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()),
-                 deviceNoList,1, 40);
+                id,1, 6);
 
 
 
@@ -176,13 +161,14 @@ public class HealthPublicityController {
 
             if (item.getPerson() == null) {
                 map.put("name", "访客" );
+                map.put("companyName", "");
 
 
             } else {
                 map.put("name", item.getPerson().getName());
+                map.put("companyName", item.getPerson().getCompanyName());
 
             }
-            map.put("companyName", item.getPerson().getCompanyName());
 
             map.put("faceImage", item.getFaceImage());
 

+ 1 - 1
web/src/main/resources/templates/motemwall_canteen.html

@@ -4,7 +4,7 @@
 	<head>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
-		<meta http-equiv="refresh" content="120">
+		<meta http-equiv="refresh" content="5">
 		<title>企业管理及健康监管平台</title>
 		<link th:href="@{/static/css/mui.min.css}" href="static/css/mui.min.css" rel="stylesheet" />
 		<link th:href="@{/static/fonts/iconfont.css}" href="static/css/iconfont.css" rel="stylesheet" />