LIVE_YE 2 years ago
parent
commit
e8149d646b

+ 10 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/AccountingDataController.java

@@ -59,6 +59,16 @@ public class AccountingDataController extends BaseController {
     }
     }
 
 
 
 
+    /***
+     * 根据身份证号去查询详细信息
+     */
+    @GetMapping("/nucleicAcid/detailedInfo")
+    public AccountingDataVo detailedInfo( AccountingDataVo accountingData) {
+        AccountingDataVo accountingDataVo = accountingDataService.detailedInfo(accountingData);
+        return accountingDataVo;
+    }
+
+
     /**
     /**
      *  核酸数据导出(户籍)
      *  核酸数据导出(户籍)
      * @param response
      * @param response

+ 13 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/TaskController.java

@@ -1,6 +1,7 @@
 package com.boman.web.core.controller;
 package com.boman.web.core.controller;
 
 
 import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.DateUtils;
+import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.service.TaskService;
 import com.boman.web.core.service.TaskService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
@@ -93,6 +94,18 @@ public class TaskController {
         taskService.toQianshanData();
         taskService.toQianshanData();
     }
     }
 
 
+    @GetMapping("/cunDate")
+    private AjaxResult cunDate(String startTime,String endTime) {
+        return taskService.cunDate(startTime,endTime);
+    }
+
+    @GetMapping("/zhenDate")
+    private AjaxResult zhenDate(String startTime,String endTime) {
+        return taskService.zhenDate(startTime,endTime);
+    }
+
+
+
 
 
 
 
 }
 }

+ 1 - 0
boman-web-core/src/main/java/com/boman/web/core/domain/vo/AccountingDataVo.java

@@ -55,6 +55,7 @@ public class AccountingDataVo extends BaseEntity {
     /**
     /**
      * 采集地点
      * 采集地点
      */
      */
+    @Excel(name = "采集地点")
     private String cjdd;
     private String cjdd;
     /**
     /**
      * 去哪儿
      * 去哪儿

+ 18 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/AccountingDataMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Set;
 
 
 
 
 /**
 /**
@@ -59,4 +60,21 @@ public interface AccountingDataMapper {
 
 
     List<AccountingDataVo> thirdNucleicAcid(@Param("startTime") String startTime, @Param("endTime") String endTime);
     List<AccountingDataVo> thirdNucleicAcid(@Param("startTime") String startTime, @Param("endTime") String endTime);
 
 
+    int tongjiHjZ(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("areaId")String areaId);
+
+    int tongjiCzZ(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("areaId")String areaId);
+
+    List<AccountingDataVo> selectNoAccountingDataHjList(AccountingDataVo accountingData);
+
+    List<AccountingDataVo> selectNoAccountingDataJzdzList(AccountingDataVo accountingData);
+
+    List<AccountingDataVo> getExportHjNo(AccountingDataVo accountingData);
+
+    List<AccountingDataVo> exportCzjNo(AccountingDataVo accountingData);
+
+    int tongjiHjC(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("areaId")String areaId);
+
+    int tongjiCzC(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("areaId")String areaId);
+
+    List<AccountingDataVo> detailedInfoByIdCard(AccountingDataVo accountingData);
 }
 }

+ 105 - 0
boman-web-core/src/main/java/com/boman/web/core/service/TaskService.java

@@ -95,8 +95,12 @@ public class TaskService {
     @Resource
     @Resource
     private ToQianshanPersonnerService toQianshanPersonnerService;
     private ToQianshanPersonnerService toQianshanPersonnerService;
 
 
+    @Resource
+    private AccountingDataMapper accountingDataMapper;
+
     @Resource
     @Resource
     private SqlSessionFactory sqlSessionFactory;
     private SqlSessionFactory sqlSessionFactory;
+
     private static final String tableName = "attendance_table";
     private static final String tableName = "attendance_table";
 
 
     /**
     /**
@@ -770,6 +774,107 @@ public class TaskService {
     }
     }
 
 
 
 
+    //统计镇数据(暂时用)
+    public AjaxResult zhenDate(String startTime,String endTime) {
+
+        long start2 = System.currentTimeMillis();
+
+        List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
+
+        //所有乡镇集合
+        List<SysDept> townsDepts = new ArrayList<>(16);
+
+        for (SysDept allDept : allDepts) {
+            if (isEmpty(allDept.getParentId())) {
+                continue;
+            }
+            if (allDept.getParentId() == (1L)) {
+                townsDepts.add(allDept);
+            }
+        }
+
+        ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
+        for (SysDept townsDept : townsDepts) {
+            JSONObject townsResult = new JSONObject(16);
+            //查询镇数据
+            //户籍人员数据
+            int hjz = accountingDataService.tongjiHjZ(startTime,endTime,townsDept.getAreaId());
+            //常住人员数据
+            int czz = accountingDataService.tongjiCzZ(startTime,endTime,townsDept.getAreaId());
+            townsResult.put("name",townsDept.getDeptName());
+            townsResult.put("hjz",hjz);
+            townsResult.put("czz",czz);
+            towsDataList.add(townsResult);
+        }
+        long end2 = System.currentTimeMillis();
+        System.out.println("---------------循环数据耗时" + (end2 - start2) + "---------------");
+        return AjaxResult.success(towsDataList);
+    }
+
+    //统计镇,村数据(暂时用)
+    public AjaxResult cunDate(String startTime,String endTime) {
+
+        long start2 = System.currentTimeMillis();
+
+        List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
+
+        //所有乡镇集合
+        List<SysDept> townsDepts = new ArrayList<>(16);
+
+        for (SysDept allDept : allDepts) {
+            if (isEmpty(allDept.getParentId())) {
+                continue;
+            }
+            if (allDept.getParentId() == (1L)) {
+                townsDepts.add(allDept);
+            }
+        }
+
+        ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
+        for (SysDept townsDept : townsDepts) {
+            JSONObject townsResult = new JSONObject(16);
+            //查询镇数据
+            //户籍人员数据
+            int hjz = accountingDataService.tongjiHjZ(startTime,endTime,townsDept.getAreaId());
+            //常住人员数据
+            int czz = accountingDataService.tongjiCzZ(startTime,endTime,townsDept.getAreaId());
+            townsResult.put("name",townsDept.getDeptName());
+            townsResult.put("hjz",hjz);
+            townsResult.put("czz",czz);
+            //获取镇下面的村数据
+            List<SysDept> cunDepts = new ArrayList<>(16);
+
+            for (SysDept allDept : allDepts) {
+                if (isEmpty(allDept.getParentId())) {
+                    continue;
+                }
+                if (allDept.getParentId() == Long.valueOf(townsDept.getId())) {
+                    cunDepts.add(allDept);
+                }
+            }
+
+            ArrayList<JSONObject> cunDataList = new ArrayList<>(20);
+            for (SysDept cunDept : cunDepts) {
+                JSONObject cunResult = new JSONObject(16);
+                //查询村数据
+                //户籍人员数据
+                int hjc = accountingDataMapper.tongjiHjC(startTime,endTime,cunDept.getAreaId());
+                //常住人员数据
+                int czc = accountingDataMapper.tongjiCzC(startTime,endTime,cunDept.getAreaId());
+                cunResult.put("name",cunDept.getDeptName());
+                cunResult.put("hjc",hjc);
+                cunResult.put("czc",czc);
+                cunDataList.add(cunResult);
+            }
+            townsResult.put("cunDataList",cunDataList);
+            towsDataList.add(townsResult);
+        }
+        long end2 = System.currentTimeMillis();
+        System.out.println("---------------循环数据耗时" + (end2 - start2) + "---------------");
+        return AjaxResult.success(towsDataList);
+    }
+
+
     /***
     /***
      * 核酸统计(每一个小时跑一次)
      * 核酸统计(每一个小时跑一次)
      */
      */

+ 81 - 26
boman-web-core/src/main/java/com/boman/web/core/service/accounting/AccountingDataServiceImpl.java

@@ -4,50 +4,34 @@ package com.boman.web.core.service.accounting;
  * @Date: 2022/05/13/11:14
  * @Date: 2022/05/13/11:14
  */
  */
 
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSON;
 import com.boman.common.core.exception.BaseException;
 import com.boman.common.core.exception.BaseException;
+import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
 import com.boman.common.core.web.page.TableSupport;
-import com.boman.common.datasource.annotation.Master;
 import com.boman.common.datasource.annotation.Slave;
 import com.boman.common.datasource.annotation.Slave;
-import com.boman.domain.*;
-import com.alibaba.fastjson.JSON;
-import com.boman.common.core.utils.DateUtils;
-import com.boman.common.core.utils.StringUtils;
 import com.boman.domain.Czrk;
 import com.boman.domain.Czrk;
 import com.boman.domain.SysUser;
 import com.boman.domain.SysUser;
-import com.boman.domain.dto.AjaxResult;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDeptService;
-import com.boman.web.core.domain.AccountingData;
 import com.boman.web.core.domain.TSampling514;
 import com.boman.web.core.domain.TSampling514;
-import com.boman.web.core.domain.ToQianshanPersonner;
 import com.boman.web.core.domain.vo.AccountingDataVo;
 import com.boman.web.core.domain.vo.AccountingDataVo;
 import com.boman.web.core.mapper.AccountingDataMapper;
 import com.boman.web.core.mapper.AccountingDataMapper;
 import com.boman.web.core.mapper.CzrkMapper;
 import com.boman.web.core.mapper.CzrkMapper;
 import com.boman.web.core.mapper.TSampling514Mapper;
 import com.boman.web.core.mapper.TSampling514Mapper;
 import com.boman.web.core.service.TaskService;
 import com.boman.web.core.service.TaskService;
-import com.boman.web.core.utils.*;
 import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.CzrkUtils;
 import com.boman.web.core.utils.CzrkUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.session.ExecutorType;
-import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.io.IOException;
 import java.util.*;
 import java.util.*;
 
 
-import static com.boman.common.core.utils.obj.ObjectUtils.map;
-import static com.boman.web.core.utils.CzrkUtils.setQueryRole;
-
-import static com.boman.web.core.utils.CzrkUtils.setAgeScope;
 import static com.boman.web.core.utils.CzrkUtils.setQueryRole;
 import static com.boman.web.core.utils.CzrkUtils.setQueryRole;
 
 
 /**
 /**
@@ -101,7 +85,20 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         //设置查询列表权限
         //设置查询列表权限
         setQueryRole(accountingData, sysUser, Czrk.HJ);
         setQueryRole(accountingData, sysUser, Czrk.HJ);
         startPage();
         startPage();
-        List<AccountingDataVo> list = accountingDataMapper.selectAccountingDataHjList(accountingData);
+        List<AccountingDataVo> list = new ArrayList<>();
+        if (StringUtils.isNotEmpty(accountingData.getIsNucleicAcid()) && "N".equals(accountingData.getIsNucleicAcid())) {
+            //查询户籍未做核酸人员
+            list = accountingDataMapper.selectNoAccountingDataHjList(accountingData);
+            for (AccountingDataVo accountingDataVo : list) {
+                accountingDataVo.setIsNucleicAcid("N");
+            }
+        } else {
+            list = accountingDataMapper.selectAccountingDataHjList(accountingData);
+            for (AccountingDataVo accountingDataVo : list) {
+                accountingDataVo.setIsNucleicAcid("Y");
+            }
+        }
+
         CzrkUtils.packAddrNucleicAcid(list);
         CzrkUtils.packAddrNucleicAcid(list);
         return list;
         return list;
     }
     }
@@ -131,7 +128,20 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         //设置查询列表权限
         //设置查询列表权限
         setQueryRole(accountingData, sysUser, Czrk.CZ);
         setQueryRole(accountingData, sysUser, Czrk.CZ);
         startPage();
         startPage();
-        List<AccountingDataVo> list = accountingDataMapper.selectAccountingDataJzdzList(accountingData);
+        List<AccountingDataVo> list = new ArrayList<>();
+        if (StringUtils.isNotEmpty(accountingData.getIsNucleicAcid()) && "N".equals(accountingData.getIsNucleicAcid())) {
+            //查询户籍未做核酸人员
+            list = accountingDataMapper.selectNoAccountingDataJzdzList(accountingData);
+            for (AccountingDataVo accountingDataVo : list) {
+                accountingDataVo.setIsNucleicAcid("N");
+            }
+        } else {
+            list = accountingDataMapper.selectAccountingDataJzdzList(accountingData);
+            for (AccountingDataVo accountingDataVo : list) {
+                accountingDataVo.setIsNucleicAcid("Y");
+            }
+        }
+
         CzrkUtils.packAddrNucleicAcid(list);
         CzrkUtils.packAddrNucleicAcid(list);
         return list;
         return list;
     }
     }
@@ -146,6 +156,15 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         }
         }
     }
     }
 
 
+
+    @Override
+    public AccountingDataVo detailedInfo(AccountingDataVo accountingData) {
+        List<AccountingDataVo> accountingDataVoList = accountingDataMapper.detailedInfoByIdCard(accountingData);
+        CzrkUtils.packAddrNucleicAcid(accountingDataVoList);
+        return accountingDataVoList.get(0);
+    }
+
+
     /**
     /**
      * 核酸数据导出(户籍)
      * 核酸数据导出(户籍)
      *
      *
@@ -157,8 +176,20 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         //设置查询列表权限
         //设置查询列表权限
         setQueryRole(accountingData, sysUser, Czrk.HJ);
         setQueryRole(accountingData, sysUser, Czrk.HJ);
-        List<AccountingDataVo> accountingDataList = accountingDataMapper.getExportHj(accountingData);
 
 
+        List<AccountingDataVo> accountingDataList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(accountingData.getIsNucleicAcid()) && "N".equals(accountingData.getIsNucleicAcid())) {
+            //查询户籍未做核酸人员
+            accountingDataList = accountingDataMapper.getExportHjNo(accountingData);
+            for (AccountingDataVo accountingDataVo : accountingDataList) {
+                accountingDataVo.setIsNucleicAcid("N");
+            }
+        } else {
+            accountingDataList = accountingDataMapper.getExportHj(accountingData);
+            for (AccountingDataVo accountingDataVo : accountingDataList) {
+                accountingDataVo.setIsNucleicAcid("Y");
+            }
+        }
         CzrkUtils.packAddrNucleicAcid(accountingDataList);
         CzrkUtils.packAddrNucleicAcid(accountingDataList);
         if (accountingDataList == null || accountingDataList.size() <= 0) {
         if (accountingDataList == null || accountingDataList.size() <= 0) {
             throw new BaseException("请下载属于本乡镇数据");
             throw new BaseException("请下载属于本乡镇数据");
@@ -176,7 +207,22 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         //设置查询列表权限
         //设置查询列表权限
         setQueryRole(accountingData, sysUser, Czrk.CZ);
         setQueryRole(accountingData, sysUser, Czrk.CZ);
-        List<AccountingDataVo> accountingDataList = accountingDataMapper.exportCz(accountingData);
+
+        List<AccountingDataVo> accountingDataList = new ArrayList<>();
+
+        if (StringUtils.isNotEmpty(accountingData.getIsNucleicAcid()) && "N".equals(accountingData.getIsNucleicAcid())) {
+            //查询户籍未做核酸人员
+            accountingDataList = accountingDataMapper.exportCzjNo(accountingData);
+            for (AccountingDataVo accountingDataVo : accountingDataList) {
+                accountingDataVo.setIsNucleicAcid("N");
+            }
+        } else {
+            accountingDataList = accountingDataMapper.exportCz(accountingData);
+            for (AccountingDataVo accountingDataVo : accountingDataList) {
+                accountingDataVo.setIsNucleicAcid("Y");
+            }
+        }
+
 
 
         CzrkUtils.packAddrNucleicAcid(accountingDataList);
         CzrkUtils.packAddrNucleicAcid(accountingDataList);
         if (accountingDataList == null || accountingDataList.size() <= 0) {
         if (accountingDataList == null || accountingDataList.size() <= 0) {
@@ -185,6 +231,15 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         return accountingDataList;
         return accountingDataList;
     }
     }
 
 
+    @Override
+    public int tongjiHjZ(String startTime, String endTime, String areaId) {
+        return accountingDataMapper.tongjiHjZ(startTime, endTime, areaId);
+    }
+
+    @Override
+    public int tongjiCzZ(String startTime, String endTime, String areaId) {
+        return accountingDataMapper.tongjiCzZ(startTime, endTime, areaId);
+    }
 
 
     @Override
     @Override
     public AccountingDataVo getAccountingDataOne() {
     public AccountingDataVo getAccountingDataOne() {
@@ -211,11 +266,11 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
      */
      */
     @Slave
     @Slave
     @Override
     @Override
-    public void thirdNucleicAcid(String startTime,String endTime) {
+    public void thirdNucleicAcid(String startTime, String endTime) {
         System.out.println("batchInsert 查询数据开始========");
         System.out.println("batchInsert 查询数据开始========");
         long start1 = System.currentTimeMillis();
         long start1 = System.currentTimeMillis();
-        List<AccountingDataVo> accountingDataVos = accountingDataMapper.thirdNucleicAcid(startTime,endTime);
-        if(accountingDataVos!=null){
+        List<AccountingDataVo> accountingDataVos = accountingDataMapper.thirdNucleicAcid(startTime, endTime);
+        if (accountingDataVos != null) {
             taskService.insertAccountingData(accountingDataVos);
             taskService.insertAccountingData(accountingDataVos);
         }
         }
         long end1 = System.currentTimeMillis();
         long end1 = System.currentTimeMillis();

+ 6 - 0
boman-web-core/src/main/java/com/boman/web/core/service/accounting/IAccountingDataService.java

@@ -57,4 +57,10 @@ public interface IAccountingDataService {
     void thirdNucleicAcid(String startTime,String endTime);
     void thirdNucleicAcid(String startTime,String endTime);
 
 
     List<AccountingDataVo> exportCz(AccountingDataVo accountingData);
     List<AccountingDataVo> exportCz(AccountingDataVo accountingData);
+
+    int tongjiHjZ(String startTime, String endTime, String areaId);
+
+    int tongjiCzZ(String startTime, String endTime, String areaId);
+
+    AccountingDataVo detailedInfo(AccountingDataVo accountingData);
 }
 }

+ 255 - 6
boman-web-core/src/main/resources/mapper/AccountingDateMapper.xml

@@ -101,7 +101,6 @@
             <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
             <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
             </if>
             </if>
-            <if test="isNucleicAcid != null  and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
             <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
             <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
             <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
             <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
             <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
             <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
@@ -111,6 +110,45 @@
         order by d.cjsj DESC,r.create_time DESC
         order by d.cjsj DESC,r.create_time DESC
     </select>
     </select>
 
 
+    <select id="selectNoAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
+            resultMap="AccountingDataResult">
+        select cz.id,cz.user_name as xm,cz.id_card as
+        zjhm,cz.province,cz.city,cz.region,cz.village_towns,cz.village,cz.now_in,cz.phone_num from czrk cz
+        where id_card not in (
+        SELECT
+        r.id_card
+        FROM czrk r left join `accounting_data` d on r.id_card = d.zjhm
+        <where>
+            r.is_del = 'N'
+            and r.status = '1'
+            <if test="zjhm != null  and zjhm != ''">and r.id_card = #{zjhm}</if>
+            <if test="xm != null  and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
+            <if test="params.startTime != null  and params.startTime != '' and params.startTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
+            <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
+            <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
+            <if test="villageId != null  and villageId != ''">and r.village_id = #{villageId}</if>
+        </where>
+        )
+        and cz.is_del = 'N'
+        and cz.status = '1'
+        <if test="zjhm != null  and zjhm != ''">and cz.id_card = #{zjhm}</if>
+        <if test="xm != null  and xm != ''">and cz.user_name like concat(#{xm}, '%')</if>
+        <if test="provinceId != null  and provinceId != ''">and cz.province_id = #{provinceId}</if>
+        <if test="cityId != null  and cityId != ''">and cz.city_id = #{cityId}</if>
+        <if test="regionId != null  and regionId != ''">and cz.region_id = #{regionId}</if>
+        <if test="villageTownsId != null  and villageTownsId != ''">and cz.village_towns_id = #{villageTownsId}</if>
+        <if test="villageId != null  and villageId != ''">and cz.village_id = #{villageId}</if>
+        order by cz.create_time DESC
+    </select>
+
+
     <select id="selectAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
     <select id="selectAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
             resultMap="AccountingDataResult">
             resultMap="AccountingDataResult">
         select r.user_name as xm, r.phone_num, r.id_card as zjhm,
         select r.user_name as xm, r.phone_num, r.id_card as zjhm,
@@ -129,7 +167,6 @@
             <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
             <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
             </if>
             </if>
-            <if test="isNucleicAcid != null  and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
             <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
             <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
             <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
             <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
             <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
             <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
@@ -140,6 +177,68 @@
     </select>
     </select>
 
 
 
 
+    <select id="selectNoAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
+            resultMap="AccountingDataResult">
+        select rz.user_name as xm, rz.phone_num, rz.id_card as zjhm,
+        zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
+        as
+        villageXjd,zj.now_in
+        from czrk rz left join czrk_jzdz zj on rz.id =zj.czrk_id
+        where rz.id_card not in (
+        select r.id_card
+        from czrk r left join czrk_jzdz z on r.id =z.czrk_id
+        left join `accounting_data` d on r.id_card = d.zjhm
+        <where>
+            r.is_del = 'N'
+            and r.status = '1'
+            <if test="zjhm != null  and zjhm != ''">and r.id_card = #{zjhm}</if>
+            <if test="xm != null  and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
+            <if test="params.startTime != null  and params.startTime != '' and params.startTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
+            <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
+            <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
+            <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
+            <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
+        </where>
+        )
+        and rz.is_del = 'N'
+        and rz.status = '1'
+        <if test="zjhm != null  and zjhm != ''">and rz.id_card = #{zjhm}</if>
+        <if test="xm != null  and xm != ''">and rz.user_name like concat(#{xm}, '%')</if>
+        <if test="provinceIdXjd != null and provinceIdXjd != ''">and zj.province_id = #{provinceIdXjd}</if>
+        <if test="cityIdXjd != null and cityIdXjd != ''">and zj.city_id = #{cityIdXjd}</if>
+        <if test="regionIdXjd != null and regionIdXjd != ''">and zj.region_id = #{regionIdXjd}</if>
+        <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and zj.town_id = #{villageTownsIdXjd}</if>
+        <if test="villageIdXjd != null and villageIdXjd != ''">and zj.village_id = #{villageIdXjd}</if>
+        order by rz.create_time DESC
+
+    </select>
+
+
+    <select id="detailedInfoByIdCard" resultMap="AccountingDataResult">
+        select r.user_name as xm, r.phone_num, r.id_card as zjhm,
+        z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
+        villageXjd,z.now_in as nowXjd,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
+        r.province,r.city,r.region,r.village_towns,r.village,r.now_in
+        from czrk r left join czrk_jzdz z on r.id =z.czrk_id
+        left join `accounting_data` d on r.id_card = d.zjhm
+        <where>
+            r.is_del = 'N'
+            and r.status = '1'
+            <if test="zjhm != null  and zjhm != ''">and r.id_card = #{zjhm}</if>
+            <if test="cjsj != null  and cjsj != ''">and
+                and r.cjsj = #{cjsj}
+            </if>
+        </where>
+        limit 1
+    </select>
+
+
     <insert id="insertAccountingData" useGeneratedKeys="true" keyProperty="id">
     <insert id="insertAccountingData" useGeneratedKeys="true" keyProperty="id">
         insert into accounting_data
         insert into accounting_data
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -202,8 +301,8 @@
         z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
         z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
         villageXjd,z.now_in
         villageXjd,z.now_in
         FROM czrk r
         FROM czrk r
-        left join czrk_jzdz z on r.id =z.czrk_id
         left join `accounting_data` d on r.id_card = d.zjhm
         left join `accounting_data` d on r.id_card = d.zjhm
+        left join czrk_jzdz z on r.id =z.czrk_id
         <where>
         <where>
             r.is_del = 'N'
             r.is_del = 'N'
             and r.status = '1'
             and r.status = '1'
@@ -215,7 +314,6 @@
             <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
             <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
             </if>
             </if>
-            <if test="isNucleicAcid != null  and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
             <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
             <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
             <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
             <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
             <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
             <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
@@ -226,6 +324,54 @@
     </select>
     </select>
 
 
 
 
+    <select id="getExportHjNo" resultMap="AccountingDataResult">
+
+        SELECT
+        zr.id,zr.user_name as xm,zr.id_card as zjhm,zr.code as hjh,zr.is_nucleicAcid as isNucleicAcid,
+        zr.province,zr.city,zr.region,zr.village_towns,zr.village,zr.now_in,zr.phone_num,
+        zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
+        as
+        villageXjd,zj.now_in
+        FROM czrk zr
+        left join czrk_jzdz zj on zr.id =zj.czrk_id
+        where zr.id_card not in (
+        SELECT
+        r.id_card
+        FROM czrk r
+        left join `accounting_data` d on r.id_card = d.zjhm
+        <where>
+            r.is_del = 'N'
+            and r.status = '1'
+            <if test="zjhm != null  and zjhm != ''">and r.id_card = #{zjhm}</if>
+            <if test="xm != null  and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
+            <if test="params.startTime != null  and params.startTime != '' and params.startTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="provinceId != null  and provinceId != ''">and r.province_id = #{provinceId}</if>
+            <if test="cityId != null  and cityId != ''">and r.city_id = #{cityId}</if>
+            <if test="regionId != null  and regionId != ''">and r.region_id = #{regionId}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
+            <if test="villageId != null  and villageId != ''">and r.village_id = #{villageId}</if>
+        </where>
+        )
+
+        and zr.is_del = 'N'
+        and zr.status = '1'
+        <if test="zjhm != null  and zjhm != ''">and zr.id_card = #{zjhm}</if>
+        <if test="xm != null  and xm != ''">and zr.user_name like concat(#{xm}, '%')</if>
+        <if test="provinceId != null  and provinceId != ''">and zr.province_id = #{provinceId}</if>
+        <if test="cityId != null  and cityId != ''">and zr.city_id = #{cityId}</if>
+        <if test="regionId != null  and regionId != ''">and zr.region_id = #{regionId}</if>
+        <if test="villageTownsId != null  and villageTownsId != ''">and zr.village_towns_id = #{villageTownsId}</if>
+        <if test="villageId != null  and villageId != ''">and zr.village_id = #{villageId}</if>
+
+        order by zr.create_time DESC
+    </select>
+
+
     <select id="exportCz" resultMap="AccountingDataResult">
     <select id="exportCz" resultMap="AccountingDataResult">
         select
         select
         r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
         r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
@@ -247,7 +393,6 @@
             <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
             <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
                 DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
             </if>
             </if>
-            <if test="isNucleicAcid != null  and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
             <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
             <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
             <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
             <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
             <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
             <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
@@ -257,6 +402,54 @@
         order by d.cjsj DESC,r.create_time DESC
         order by d.cjsj DESC,r.create_time DESC
     </select>
     </select>
 
 
+
+    <select id="exportCzjNo" resultMap="AccountingDataResult">
+        select
+        zr.id,zr.user_name as xm,zr.id_card as zjhm,zr.code as hjh,zr.is_nucleicAcid as isNucleicAcid,
+        zr.province,zr.city,zr.region,zr.village_towns,zr.village,zr.now_in,zr.phone_num,
+        zj.province as provinceXjd , zj.city as cityXjd,zj.region as regionXjd , zj.town as villageTownsXjd, zj.village
+        as
+        villageXjd,zj.now_in
+        from czrk zr
+        left join czrk_jzdz zj on zr.id =zj.czrk_id
+        where zr.id_card not in (
+        select
+        r.id_card
+        from czrk r
+        left join czrk_jzdz z on r.id =z.czrk_id
+        left join `accounting_data` d on r.id_card = d.zjhm
+        <where>
+            r.is_del = 'N'
+            and r.status = '1'
+            <if test="zjhm != null  and zjhm != ''">and r.id_card = #{zjhm}</if>
+            <if test="xm != null  and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
+            <if test="params.startTime != null  and params.startTime != '' and params.startTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="params.endTime != null  and params.endTime != '' and params.endTime != 'null'">and
+                DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
+            <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
+            <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
+            <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
+            <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
+        </where>
+        )
+
+        and zr.is_del = 'N'
+        and zr.status = '1'
+        <if test="zjhm != null  and zjhm != ''">and zr.id_card = #{zjhm}</if>
+        <if test="xm != null  and xm != ''">and zr.user_name like concat(#{xm}, '%')</if>
+        <if test="provinceIdXjd != null and provinceIdXjd != ''">and zj.province_id = #{provinceIdXjd}</if>
+        <if test="cityIdXjd != null and cityIdXjd != ''">and zj.city_id = #{cityIdXjd}</if>
+        <if test="regionIdXjd != null and regionIdXjd != ''">and zj.region_id = #{regionIdXjd}</if>
+        <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and zj.town_id = #{villageTownsIdXjd}</if>
+        <if test="villageIdXjd != null and villageIdXjd != ''">and zj.village_id = #{villageIdXjd}</if>
+        order by zr.create_time DESC
+    </select>
+
+
     <select id="getAccountingDataOne" resultMap="AccountingDataResult">
     <select id="getAccountingDataOne" resultMap="AccountingDataResult">
         select id, cjsj, lxdh, create_date, modify_date
         select id, cjsj, lxdh, create_date, modify_date
         FROM accounting_data
         FROM accounting_data
@@ -288,7 +481,7 @@
                a.to_city             as to_city,
                a.to_city             as to_city,
                a.address             as address,
                a.address             as address,
                a.transit             as transit
                a.transit             as transit
-        from t_sampling_514 a
+        from t_sampling_822 a
                  left join t_collect_verify_point b on a.collect_oid = b.oid
                  left join t_collect_verify_point b on a.collect_oid = b.oid
                  left join t_sys_district c on b.district_oid = c.oid
                  left join t_sys_district c on b.district_oid = c.oid
         where use_flag = 'Y'
         where use_flag = 'Y'
@@ -298,4 +491,60 @@
           and (`a`.`collect_time` > #{startTime}
           and (`a`.`collect_time` > #{startTime}
             AND #{endTime} >= `a`.`collect_time`);
             AND #{endTime} >= `a`.`collect_time`);
     </select>
     </select>
+
+    <select id="tongjiHjZ" resultType="java.lang.Integer">
+        SELECT count(1)
+        from (
+                 SELECT ANY_VALUE(concat(r.id_card, '\t'))
+                 FROM czrk r
+                          left join `accounting_data` d on r.id_card = d.zjhm
+                 where r.is_del = 'N'
+                   and r.status = '1'
+                   and d.cjsj > #{startTime}
+                   and #{endTime} >= d.cjsj
+                   and r.village_towns_id = #{areaId}
+                 GROUP BY zjhm) a;
+    </select>
+    <select id="tongjiCzZ" resultType="java.lang.Integer">
+        SELECT count(1)
+        from (select ANY_VALUE(r.id_card)
+              from czrk_jzdz z
+                       left join czrk r on r.id = z.czrk_id
+                       left join `accounting_data` d on r.id_card = d.zjhm
+              where r.is_del = 'N'
+                and r.status = '1'
+                and d.cjsj > #{startTime}
+                and #{endTime} >= d.cjsj
+                and z.town_id = #{areaId}
+              GROUP BY zjhm) a;
+    </select>
+    <select id="tongjiHjC" resultType="java.lang.Integer">
+        SELECT count(1)
+        from (
+                 SELECT ANY_VALUE(concat(r.id_card, '\t'))
+                 FROM czrk r
+                          left join `accounting_data` d on r.id_card = d.zjhm
+                 where r.is_del = 'N'
+                   and r.status = '1'
+                   and d.cjsj > #{startTime}
+                   and #{endTime} >= d.cjsj
+                   and r.village_id = #{areaId}
+                 GROUP BY zjhm) a;
+    </select>
+    <select id="tongjiCzC" resultType="java.lang.Integer">
+        SELECT count(1)
+        from (select ANY_VALUE(r.id_card)
+              from czrk_jzdz z
+                       left join czrk r on r.id = z.czrk_id
+                       left join `accounting_data` d on r.id_card = d.zjhm
+              where r.is_del = 'N'
+                and r.status = '1'
+                and d.cjsj > #{startTime}
+                and #{endTime} >= d.cjsj
+                and z.village_id = #{areaId}
+              GROUP BY zjhm) a;
+    </select>
+
+
+
 </mapper>
 </mapper>

+ 2 - 1
boman-wechat/src/main/resources/bootstrap-test.yml

@@ -1,6 +1,7 @@
 server:
 server:
   port: 7000
   port: 7000
-
+#是否限制登录
+upkeep: false
 spring: 
 spring: 
   application:
   application:
     name: boman-wechat
     name: boman-wechat

+ 2 - 1
boman-wechat/src/main/resources/bootstrap.yml

@@ -1,6 +1,7 @@
 server:
 server:
   port: 8093
   port: 8093
-
+#是否限制登录
+upkeep: false
 spring: 
 spring: 
   application:
   application:
     name: boman-wechat
     name: boman-wechat