Bladeren bron

修改手机端接口。

zhengqiang 5 jaren geleden
bovenliggende
commit
8cc474bf67

+ 3 - 0
common/src/main/resources/mapper/base/PersonDeviceFilterLog.xml

@@ -152,6 +152,9 @@
                   and a.record_time <= #{searchParams.endTime}
                 ]]>
             </if>
+            <if test="searchParams.abnormalFilter!=null">
+                and a.temperature_>37
+            </if>
         </where>
         <foreach item="sort" collection="sortList"  open="order by" separator=",">
             ${sort.name} ${sort.order}

+ 12 - 0
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -206,6 +206,18 @@
             <if test="searchParams.faceBound != null">
                 and a.face_bound = #{searchParams.faceBound}
             </if>
+            <if test="searchParams.abnormalDate != null">
+                <![CDATA[
+                and a.id_ in (
+                    select b.person_id from base_person_device_filter_log b,base_person_info c
+                    where b.person_id = c.id_
+                    and c.company_id = a.company_id
+                    and DATEDIFF(b.record_time,#{searchParams.abnormalDate})=0
+                    and b.del_flag=0
+                    and b.temperature_>37
+                )
+                ]]>
+            </if>
 
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">

+ 10 - 0
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceLogApiController.java

@@ -195,6 +195,7 @@ public class PersonDeviceLogApiController {
     @ApiImplicitParams({
             @ApiImplicitParam(name="queryDate",value = "查询日期",required = true,paramType = "form"),
             @ApiImplicitParam(name="companyId",value = "单位编号",paramType = "form"),
+            @ApiImplicitParam(name="filter",value = "是否过滤(1-显示异常数据,0-显示全部)",paramType = "form"),
             @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
             @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
     })
@@ -202,6 +203,7 @@ public class PersonDeviceLogApiController {
             @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
             String companyId,
             String token,
+            String filter,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -221,6 +223,10 @@ public class PersonDeviceLogApiController {
                 personSearchParam.put("companyId", admin.getCompanyId());
             }
 
+            if (StringUtils.isNotEmpty(filter) && "1".equals(filter)){
+                personSearchParam.put("abnormalDate",queryDate);
+            }
+
             List<Sort> sortList1 = new ArrayList<>();
             sortList1.add(new Sort("id_","asc"));
 
@@ -240,6 +246,10 @@ public class PersonDeviceLogApiController {
                 searchParams.put("beginTime", startTime.toDate());
                 searchParams.put("endTime", startTime.plusDays(1).toDate());
 
+                if (StringUtils.isNotEmpty(filter) && "1".equals(filter)){
+                    searchParams.put("abnormalFilter","1");
+                }
+
                 List<Sort> sortList = new ArrayList<>();
                 sortList.add(new Sort("record_time", "asc"));