wxg 2 роки тому
батько
коміт
0592b5516f

+ 5 - 1
pom.xml

@@ -310,7 +310,11 @@
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>2.2.8</version>
+        </dependency>
     </dependencies>
 
     <!-- project下-->

+ 6 - 1
src/main/java/com/metro/controller/PassreCordsController.java

@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.util.List;
 
@@ -49,7 +50,11 @@ public class PassreCordsController {
     public BaseResponse<IPage<WarningVO>> warningPageList(@Valid @RequestBody WarningSearch warningSearch) {
         return BaseResponse.ok(passreCordsservice.warningPageList(warningSearch));
     }
-
+    @PostMapping("/excelWarningPageList")
+    @ApiOperation("excel导出预警人员列表")
+    public void  excelWarningPageList(@Valid @RequestBody WarningSearch warningSearch,HttpServletResponse response) {
+        passreCordsservice.excelWarningPageList(warningSearch,response);
+    }
     @GetMapping("/warningDeatilList")
     @ApiOperation("预警详情列表")
     public BaseResponse<List<SelectPassreCordsPageListResp>> warningDeatilList(@RequestParam("cardId") String cardId,

+ 51 - 0
src/main/java/com/metro/entity/WarningExcel.java

@@ -0,0 +1,51 @@
+package com.metro.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description:
+ * @ClassName WarningExcel
+ * @Author WXG
+ * @Date 2022/7/8 13:46
+ */
+@ApiModel("预警人员Excel model")
+@Data
+public class WarningExcel {
+
+    @ExcelProperty(value = "姓名",index = 0)
+    private String xm;
+
+    @ExcelProperty(value = "身份证号",index = 1)
+    private String cardId;
+
+    @ExcelProperty(value = "手机号",index = 2)
+    private String phone;
+
+    @ExcelProperty(value = "所属派出所名",index = 3)
+    private String companyName;
+
+    @ExcelProperty(value = "所属派分局名",index = 4)
+    private String branchName;
+
+    @ExcelProperty(value = "通行时间",index = 5)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date passTime;
+
+    @ExcelProperty(value = "处置民警",index = 6)
+    private String staffName;
+
+    @ExcelProperty(value = "处置民警账号",index = 7)
+    private String staffCardId;
+
+    @ExcelProperty(value = "上一次预警时间",index = 8)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date lastTime;
+
+    @ExcelProperty(value = "人员类型",index = 9)
+    private String kind;
+}

+ 5 - 0
src/main/java/com/metro/entity/po/PassreCords.java

@@ -165,4 +165,9 @@ public class PassreCords {
      * */
     private Integer passMode;
 
+    /*
+     * 健康码颜色
+     * */
+    private String healthCode;
+
 }

+ 6 - 0
src/main/java/com/metro/entity/ro/passrecords/SelectPassreCordsPageListReq.java

@@ -36,4 +36,10 @@ public class SelectPassreCordsPageListReq extends BaseEntity implements Serializ
 
     @ApiModelProperty(value = "有效期结束时间")
     private String endTime;
+
+    @ApiModelProperty(value = "派出所")
+    private String companyId;
+
+    @ApiModelProperty(value = "安检口")
+    private String branchId;
 }

+ 2 - 2
src/main/java/com/metro/entity/search/WarningSearch.java

@@ -30,9 +30,9 @@ public class WarningSearch extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "结束时间")
     private String endTime;
 
-    @ApiModelProperty(hidden = true)
+    @ApiModelProperty(value = "派出所")
     private String companyId;
 
-    @ApiModelProperty(hidden = true)
+    @ApiModelProperty(value = "安检口")
     private String branchId;
 }

+ 3 - 0
src/main/java/com/metro/entity/vo/WarningDetailOneVO.java

@@ -61,4 +61,7 @@ public class WarningDetailOneVO implements Serializable {
 
     @ApiModelProperty("预警信息")
     private String warningMsg;
+
+    @ApiModelProperty("健康码颜色")
+    private String healthCode;
 }

+ 16 - 0
src/main/java/com/metro/entity/vo/WarningVO.java

@@ -55,4 +55,20 @@ public class WarningVO implements Serializable {
 
     @ApiModelProperty(value = "现场照片")
     private String scenePhoto;
+
+    @ApiModelProperty(value = "处置民警")
+    private String staffName;
+
+    @ApiModelProperty(value = "处置民警账号")
+    private String staffCardId;
+
+    @ApiModelProperty(value = "上一次预警时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date LastTime;
+
+    @ApiModelProperty(value = "人员类型")
+    private String kind;
+
+
+
 }

+ 2 - 0
src/main/java/com/metro/mapper/PassreCordsMapper.java

@@ -32,4 +32,6 @@ public interface PassreCordsMapper  extends BaseMapper<PassreCords> {
     List<PassreCordsGroupByTimeVO> selectDataShowMiddlerSite(Company company);
     /*查询今日之前民警数据  type=1今日之前的数据 type=2今日数据*/
     List<PassreCordsWarFruitVO> getWarFruit(Integer type);
+
+    List<PassreCords> selectByIdList(List<Integer> idList);
 }

+ 8 - 0
src/main/java/com/metro/service/PassreCordsService.java

@@ -6,6 +6,7 @@ import com.metro.entity.search.WarningSearch;
 import com.metro.entity.vo.WarningDetailOneVO;
 import com.metro.entity.vo.WarningVO;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -51,4 +52,11 @@ public interface PassreCordsService {
      * @时间  2022/5/9 12:40
      **/
     WarningDetailOneVO warningDeatil(Integer id);
+    /*
+     * @创建者  WXG
+     * @描述  预警人员excel导出
+     * @时间  2022/7/8 13:37
+     * @参数
+     **/
+    void excelWarningPageList(WarningSearch warningSearch, HttpServletResponse response);
 }

+ 17 - 3
src/main/java/com/metro/service/impl/CompanyServiceImpl.java

@@ -8,8 +8,10 @@ import com.metro.entity.ro.company.SelectCompanyPageReq;
 import com.metro.entity.ro.company.SelectCompanyPageResp;
 import com.metro.entity.vo.BranchVO;
 import com.metro.entity.vo.CompanyVO;
+import com.metro.entity.vo.JPersonVO;
 import com.metro.mapper.CompanysMapper;
 import com.metro.service.CompanyService;
+import com.metro.service.JPersonsService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -35,7 +37,8 @@ public class CompanyServiceImpl implements CompanyService {
 
     @Resource
     private CompanysMapper companysMapper;
-
+    @Resource
+    private JPersonsService jPersonsService;
     /**
      * 公安查询
      * @param req 查询条件
@@ -57,8 +60,19 @@ public class CompanyServiceImpl implements CompanyService {
 
     @Override
     public List<CompanyVO> getCompanyList() {
-        List<CompanyVO> list = companysMapper.getCompanyList();
-        return list;
+        JPersonVO userInfo = jPersonsService.getUserInfo();
+        if(userInfo.getType() == 1){
+            return companysMapper.getCompanyList();
+        }
+        else {
+            List<CompanyVO> list = new ArrayList<>();
+            CompanyVO companyVO = new CompanyVO();
+            companyVO.setCompanyId(userInfo.getCompanyId());
+            companyVO.setCompanyName(userInfo.getCompanyName());
+            list.add(companyVO);
+            return list;
+        }
+
     }
 
     @Override

+ 1 - 1
src/main/java/com/metro/service/impl/DataShowServiceImpl.java

@@ -247,7 +247,7 @@ public class DataShowServiceImpl implements DataShowService {
         PassreCordsWrapper.eq(StringUtils.isNotEmpty(jPersonVO.getCompanyId()), PassreCords::getCompanyId, jPersonVO.getCompanyId());
         PassreCordsWrapper.eq(StringUtils.isNotEmpty(jPersonVO.getBranchId()), PassreCords::getBranchId, jPersonVO.getBranchId());
         List<Integer> list = new ArrayList<>();
-        Collections.addAll(list,0,1,3);
+        Collections.addAll(list,0,1);//去掉了健康码异常的实时预警
         PassreCordsWrapper.in(PassreCords::getPass,list);
         PassreCordsWrapper.orderByDesc(PassreCords::getPassTime);
         Page<PassreCords> selectPage = passreCordsMapper.selectPage(new Page<>(0, 6), PassreCordsWrapper);

+ 108 - 12
src/main/java/com/metro/service/impl/PassreCordsServiceImpl.java

@@ -1,8 +1,10 @@
 package com.metro.service.impl;
 
+import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.metro.entity.WarningExcel;
 import com.metro.entity.po.Company;
 import com.metro.entity.po.JDevices;
 import com.metro.entity.po.JDevicesMetro;
@@ -30,10 +32,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -68,6 +69,13 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
      */
     @Override
     public IPage<SelectPassreCordsPageListResp> page(SelectPassreCordsPageListReq req) {
+        JPersonVO userInfo = jPersonsService.getUserInfo();
+        if(userInfo.getType() == 3){
+            req.setBranchId(userInfo.getBranchId());
+            req.setCompanyId(userInfo.getCompanyId());
+        } else if (userInfo.getType() == 2) {
+            req.setCompanyId(userInfo.getCompanyId());
+        }
         /*分页查询sql*/
         IPage<SelectPassreCordsPageListResp> respPage = new Page<>(req.getPageNum(), req.getPageSize());
         Page<PassreCords> selectPage = passreCordsMapper.selectPage(new Page<>(req.getPageNum(), req.getPageSize()), pageWrapper(req,1));
@@ -108,26 +116,42 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
 
     @Override
     public IPage<WarningVO> warningPageList(WarningSearch warningSearch) {
+        JPersonVO userInfo = jPersonsService.getUserInfo();
+        if(userInfo.getType() == 3){
+            warningSearch.setBranchId(userInfo.getBranchId());
+            warningSearch.setCompanyId(userInfo.getCompanyId());
+        } else if (userInfo.getType() == 2) {
+            warningSearch.setCompanyId(userInfo.getCompanyId());
+        }
         Page<WarningVO> page = new Page<>(warningSearch.getPageNum(),warningSearch.getPageSize());
         IPage<WarningVO>  pageList =passreCordsMapper.warningPageList(page,warningSearch);
         List<WarningVO> records = pageList.getRecords();
 
         /*获取id列表 并根据idList获取数据列表*/
         List<Integer> idList = records.stream().map(WarningVO::getId).collect(Collectors.toList());
+        if(idList.size() == 0)return page;
         LambdaQueryWrapper<PassreCords> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.in(PassreCords::getId, idList);
         lambdaQueryWrapper.orderByDesc(PassreCords::getId);
         List<PassreCords> passreCords = passreCordsMapper.selectList(lambdaQueryWrapper);
         Map<Integer, PassreCords> map = passreCords.stream().collect(Collectors.toMap(PassreCords::getId, Function.identity()));
-//        /*获取数据中companyMap 和barnchMap*/
-//        Map<String, Company> companyMap = companyService.getCompanyMapByList(passreCords,PassreCords::getCompanyId);
-//        Map<String, Company> barnchMap = companyService.getBranchMapByList(passreCords,PassreCords::getBranchId);
-        /*数据填入*/
+        List<Integer> list = new ArrayList<>();
+        Collections.addAll(list,0,1);//去掉了健康码异常的实时预警
         for (WarningVO record : records) {
-            BeanUtils.copyProperties(map.get(record.getId()),record);
-//            record.setCompanyName(companyMap.get(record.getCompanyId()) == null?"" : companyMap.get(record.getCompanyId()).getCompanyName());
-//            record.setBranchName(barnchMap.get(record.getCompanyId()+record.getBranchId()) == null ?
-//                    "" : barnchMap.get(record.getCompanyId()+record.getBranchId()).getBranchName()).getBranchName();
+            PassreCords passreCords1 = map.get(record.getId());
+            BeanUtils.copyProperties(passreCords1,record);
+            LambdaQueryWrapper<PassreCords> wrapper = new LambdaQueryWrapper<>();
+            if(StringUtils.isEmpty(passreCords1.getCardId()))continue;
+            wrapper.eq(StringUtils.isNotEmpty(warningSearch.getCompanyId()),PassreCords::getCompanyId,warningSearch.getCompanyId());
+            wrapper.eq(StringUtils.isNotEmpty(warningSearch.getBranchId()),PassreCords::getBranchId,warningSearch.getBranchId());
+            wrapper.eq(PassreCords::getCardId,passreCords1.getCardId());
+            wrapper.ne(PassreCords::getId,passreCords1.getId());
+            wrapper.in(PassreCords::getPass,list);
+            wrapper.orderByDesc(PassreCords::getId);
+            wrapper.last("limit 1");
+            PassreCords passreCord = passreCordsMapper.selectOne(wrapper);
+            if(passreCord != null)
+            record.setLastTime(passreCord.getPassTime()!=null?passreCord.getPassTime():null);
         }
 
         return pageList;
@@ -139,6 +163,7 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
 
         Map<String,String> map = new HashMap<>();
         List<String> collect = records.stream().map(p -> p.getMsgId().substring(0, 8)).collect(Collectors.toSet()).stream().collect(Collectors.toList());
+        if(collect.size() == 0)return new ArrayList<>();
         List<Map<String, String>> maps = metroMapper.selectMetroNameByDeviceId(collect);
         if(maps != null) {
             for (Map<String, String> stringStringMap : maps) {
@@ -192,6 +217,74 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
         return warningDetailOneVO;
     }
 
+    @Override
+    public void excelWarningPageList(WarningSearch warningSearch, HttpServletResponse response) {
+        warningSearch.setPageSize(50000);
+        warningSearch.setPageNum(0);
+        JPersonVO userInfo = jPersonsService.getUserInfo();
+        if(userInfo.getType() == 3){
+            warningSearch.setBranchId(userInfo.getBranchId());
+            warningSearch.setCompanyId(userInfo.getCompanyId());
+        } else if (userInfo.getType() == 2) {
+            warningSearch.setCompanyId(userInfo.getCompanyId());
+        }
+        Page<WarningVO> page = new Page<>(warningSearch.getPageNum(),warningSearch.getPageSize());
+        IPage<WarningVO>  pageList =passreCordsMapper.warningPageList(page,warningSearch);
+        List<WarningVO> records = pageList.getRecords();
+
+        /*获取id列表 并根据idList获取数据列表*/
+        List<Integer> idList = records.stream().map(WarningVO::getId).collect(Collectors.toList());
+        List<WarningExcel> list = new ArrayList<>();
+        if(idList.size() != 0){
+            List<PassreCords> passreCords = passreCordsMapper.selectByIdList(idList);
+            Map<Integer, PassreCords> map = passreCords.stream().collect(Collectors.toMap(PassreCords::getId, Function.identity()));
+            List<Integer> passlist = new ArrayList<>();
+            Collections.addAll(passlist,0,1);//去掉了健康码异常的实时预警
+            for (WarningVO record : records) {
+                WarningExcel warningExcel = new WarningExcel();
+                PassreCords passreCords1 = map.get(record.getId());
+                BeanUtils.copyProperties(passreCords1,warningExcel);
+                LambdaQueryWrapper<PassreCords> wrapper = new LambdaQueryWrapper<>();
+                if(StringUtils.isEmpty(passreCords1.getCardId()))continue;
+                wrapper.eq(StringUtils.isNotEmpty(warningSearch.getCompanyId()),PassreCords::getCompanyId,warningSearch.getCompanyId());
+                wrapper.eq(StringUtils.isNotEmpty(warningSearch.getBranchId()),PassreCords::getBranchId,warningSearch.getBranchId());
+                wrapper.eq(PassreCords::getCardId,passreCords1.getCardId());
+                wrapper.ne(PassreCords::getId,passreCords1.getId());
+                wrapper.in(PassreCords::getPass,passlist);
+                wrapper.orderByDesc(PassreCords::getId);
+                wrapper.last("limit 1");
+                PassreCords passreCord = passreCordsMapper.selectOne(wrapper);
+                if(passreCord != null){
+                    warningExcel.setLastTime(passreCord.getPassTime()!=null?passreCord.getPassTime():null);
+                }
+                list.add(warningExcel);
+            }
+        }
+        try {
+            String fileName = "预警人员-" + System.currentTimeMillis() + ".xlsx";
+            response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
+            response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
+            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+//            response.setContentType("application/vnd.ms-excel");
+//            response.setCharacterEncoding("utf-8");
+//            // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
+//            String fileName = "预警人员";
+//            try {
+//                fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
+//            } catch (UnsupportedEncodingException e) {
+//                e.printStackTrace();
+//            }
+//            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+
+            EasyExcel.write(response.getOutputStream(), WarningExcel.class)
+                    // 导出文件名
+                    .autoCloseStream(Boolean.TRUE).sheet("预警人员")
+                    .doWrite(list);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
 
     // page Wrapper
     private LambdaQueryWrapper<PassreCords> pageWrapper(SelectPassreCordsPageListReq req , Integer type) {
@@ -225,12 +318,15 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
             }
         }
         wrapper.like(StringUtils.isNotEmpty(req.getXm()), PassreCords::getXm, req.getXm());
+        wrapper.eq(StringUtils.isNotEmpty(req.getCompanyId()), PassreCords::getCompanyId, req.getCompanyId());
+        wrapper.eq(StringUtils.isNotEmpty(req.getBranchId()), PassreCords::getBranchId, req.getBranchId());
         wrapper.eq(StringUtils.isNotEmpty(req.getCardId()), PassreCords::getCardId, req.getCardId());
         wrapper.eq(StringUtils.isNotEmpty(req.getPhone()), PassreCords::getPhone, req.getPhone());
         wrapper.eq(req.getPass() != null, PassreCords::getPass, req.getPass());
         wrapper.gt(StringUtils.isNotEmpty(req.getStartTime()), PassreCords::getPassTime, req.getStartTime());
         wrapper.lt(StringUtils.isNotEmpty(req.getEndTime()), PassreCords::getPassTime, req.getEndTime());
         wrapper.orderByDesc(PassreCords::getPassTime);
+        if(type == 2)wrapper.last("limit 50");
         return wrapper;
     }
 }

+ 1 - 1
src/main/java/com/metro/service/job/AdminDataShowTask.java

@@ -69,7 +69,7 @@ public class AdminDataShowTask {
             List<PassreCordsLessVO> passreCordsLessVO = passreCordsMapper.selectBeforDataNumber(company);
 
             totalNumber = passreCordsLessVO.stream().mapToInt(PassreCordsLessVO::getNumber).sum();
-            totalDoubtNumber = passreCordsLessVO.stream().filter(p -> p.getPass() == 1 || p.getPass() == 3).mapToInt(PassreCordsLessVO::getNumber).sum();
+            totalDoubtNumber = passreCordsLessVO.stream().filter(p -> p.getPass() == 1 /*|| p.getPass() == 3*/).mapToInt(PassreCordsLessVO::getNumber).sum();
             totalArrestNumber = passreCordsLessVO.stream().filter(p -> p.getPass() == 0).mapToInt(PassreCordsLessVO::getNumber).sum();
             totalWarningNumber = totalDoubtNumber + totalArrestNumber;
 

+ 1 - 1
src/main/java/com/metro/service/job/AdminDataShowTodayTask.java

@@ -62,7 +62,7 @@ public class AdminDataShowTodayTask {
             Integer todayDoubtNumber = 0;//今日存疑人数
             Integer todayArrestNumber = 0;//今日抓捕人数
             todayNumber = passreCordsLessVOS.stream().mapToInt(PassreCordsLessVO::getNumber).sum();
-            todayDoubtNumber = passreCordsLessVOS.stream().filter(p -> p.getPass() == 1 || p.getPass() == 3).mapToInt(PassreCordsLessVO::getNumber).sum();
+            todayDoubtNumber = passreCordsLessVOS.stream().filter(p -> p.getPass() == 1 /*|| p.getPass() == 3*/).mapToInt(PassreCordsLessVO::getNumber).sum();
             todayArrestNumber = passreCordsLessVOS.stream().filter(p -> p.getPass() == 0).mapToInt(PassreCordsLessVO::getNumber).sum();
             todayWarningNumber = todayDoubtNumber + todayArrestNumber;
 

+ 27 - 0
src/main/java/com/metro/utils/FileExportUtils.java

@@ -0,0 +1,27 @@
+package com.metro.utils;
+
+import org.apache.poi.ss.usermodel.Workbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+
+/**
+ * @description:
+ * @ClassName FileExportUtils
+ * @Author WXG
+ * @Date 2022/7/8 12:59
+ */
+public class FileExportUtils {
+    public static HttpServletResponse ExcelExport(HttpServletResponse response, Workbook workBook, String fileName) throws IOException {
+        response.setContentType("application/octet-stream");
+        response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
+        response.setHeader("Content-Disposition", "attachment; filename="
+                + URLEncoder.encode(fileName, "UTF-8"));
+        OutputStream outputStream = response.getOutputStream();
+        workBook.write(outputStream);
+        outputStream.close();
+        return response;
+    }
+}

+ 58 - 6
src/main/resources/mapper/PassreCordsMapper.xml

@@ -9,11 +9,11 @@
         from j_passrecords
         <where>
             pass in(0,1)
-            <if test="warningSearch.companyId !=null">
-                and company_id =# {warningSearch.companyId}
+            <if test="warningSearch.companyId !=null and warningSearch.companyId !=''">
+                and company_id = #{warningSearch.companyId}
             </if>
-            <if test="warningSearch.branchId !=null">
-                and branch_id =# {warningSearch.branchId}
+            <if test="warningSearch.branchId !=null and warningSearch.branchId !=''">
+                and branch_id = #{warningSearch.branchId}
             </if>
             <if test="warningSearch.xm !=null and warningSearch.xm !=''">
                 and xm LIKE CONCAT('%',#{warningSearch.xm},'%')
@@ -25,10 +25,10 @@
                 and phone = #{warningSearch.phone}
             </if>
             <if test="warningSearch.startTime != null and warningSearch.startTime != ''">
-                AND  <![CDATA[ pass_time >= #{startTime}]]>
+                AND  <![CDATA[ pass_time >= #{warningSearch.startTime}]]>
             </if>
             <if test="warningSearch.endTime != null and warningSearch.endTime != '' ">
-                AND  <![CDATA[ pass_time <= #{endTime}]]>
+                AND  <![CDATA[ pass_time <= #{warningSearch.endTime}]]>
             </if>
         </where>
         GROUP BY card_id,company_id,branch_id
@@ -112,4 +112,56 @@
             )t
         group by t.staff_card_id
     </select>
+    <select id="selectByIdList" resultType="com.metro.entity.po.PassreCords">
+        select
+            id,
+            card_id,
+            card_type,
+            xm,
+            eng_xm,
+            xb,
+            phone,
+            mz,
+            csrq,
+            pass_time,
+            pass_addr,
+            pass,
+            kind,
+            warning,
+            warning_msg,
+            card_addr,
+            company_name,
+            branch_name,
+            staff_name,
+            staff_card_id,
+            msg_id,
+            bar_code,
+            issue,
+            valid_range,
+            display_msg,
+            company_id,
+            branch_id,
+            address,
+            is_delete,
+            create_time,
+            update_timestamp,
+            img,
+            people_Name,
+            custom_device_id,
+            device_id,
+            health_code,
+            vaccine,
+            nuclein_result,
+            nuclein_time,
+            nuclein_status,
+            travel_card,
+            face_compare,
+            pass_mode
+        from j_passrecords
+        where id in
+        <foreach collection="idList" index="index" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+
+    </select>
 </mapper>