Bläddra i källkod

死亡人员导入

LIVE_YE 3 år sedan
förälder
incheckning
07c4009f05

+ 231 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/ThirdPartInfo.java

@@ -0,0 +1,231 @@
+package com.boman.domain;
+
+import com.boman.domain.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.*;
+import org.apache.commons.lang.StringUtils;
+
+import java.sql.Timestamp;
+import java.util.Date;
+
+/**
+ * 常住人口对象 czrk
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+public class ThirdPartInfo extends BaseEntity{
+
+  private long id;
+
+  /**
+   * 火化证明
+   */
+  @Excel(name = "火化证明")
+  private String cremationCertificate;
+
+  /**
+   * 火化时间
+   */
+  @Excel(name = "火化时间")
+  private String cremationTime;
+
+  /**
+   * 姓 名
+   */
+  @Excel(name = "姓 名")
+  private String userName;
+
+  /**
+   * 身份证号
+   */
+  @Excel(name = "身份证号")
+  private String idCard;
+
+  /**
+   * 年龄
+   */
+  @Excel(name = "年龄")
+  private String age;
+
+  /**
+   * 性别
+   */
+   @Excel(name = "性\n" +
+           "别")
+  private String gender;
+
+  /**
+   * 民族
+   */
+  @Excel(name = "民\n" +
+          "族")
+  private String nation;
+
+  /**
+   * 乡镇
+   */
+  @Excel(name = "乡镇")
+  private String township;
+
+  /**
+   * 村/组
+   */
+  @Excel(name = "村/组")
+  private String villageGroup;
+
+  /**
+   * 家庭电话
+   */
+  @Excel(name = "家庭电话")
+  private String homePhone;
+
+  /**
+   * 是否寄存
+   */
+  @Excel(name = "是否\n" +
+          "寄存")
+  private String isDeposit;
+
+  /**
+   * 是否冷藏
+   */
+  @Excel(name = "是否\n" +
+          "冷藏")
+  private String isColdStorage;
+
+  /**
+   * 死因
+   */
+  @Excel(name = "死因")
+  private String causeOfDeath;
+
+  /**
+   * 是否享受惠民殡葬
+   */
+  @Excel(name = "是否\n" +
+          "享受\n" +
+          "惠民\n" +
+          "殡葬")
+  private String isHmbz;
+
+  /**
+   * 上交棺木
+   */
+  @Excel(name = "上交棺木")
+  private String sjgm;
+
+  /**
+   * 救助对象
+   */
+  @Excel(name = "救助对象")
+  private String jzdx;
+
+  /**
+   * 备注
+   */
+  @Excel(name = "备注")
+  private String remarks;
+
+  /**
+   * 是否本地户口
+   */
+  @Excel(name = "是否本地户口")
+  private String isLocalAccount;
+
+  /**
+   * 状态
+   */
+  private String status;
+
+  /**
+   * 创建人
+   */
+  private String createBy;
+
+  /**
+   * 创建时间
+   */
+  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  private java.sql.Timestamp createTime;
+
+  /**
+   * 修改人
+   */
+  private String updateBy;
+
+  /**
+   * 修改时间
+   */
+  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  private java.sql.Timestamp updateTime;
+
+  /**
+   * 是否删除
+   */
+  private String isDel;
+
+  /**
+   * 户籍地的省份
+   */
+  private String provinceId;
+
+  /**
+   * 户籍地的省份
+   */
+  private String province;
+
+  /**
+   * 户籍地的城市
+   */
+  private String cityId;
+
+  /**
+   * 户籍地的城市
+   */
+  private String city;
+
+  /**
+   * 户籍地的区
+   */
+  private String regionId;
+
+  /**
+   * 户籍地的区
+   */
+  private String region;
+
+  /**
+   * 户籍地的镇
+   */
+  private String villageTownsId;
+
+  /**
+   * 户籍地的镇
+   */
+  private String villageTowns;
+
+  /**
+   * 户籍地的村
+   */
+  private String villageId;
+
+  /**
+   * 户籍地的村
+   */
+  private String village;
+
+  /**
+   * 是否在本地数据库中存在
+   */
+  private String isLocal;
+
+
+
+
+}

+ 26 - 4
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -3,15 +3,13 @@ package com.boman.web.core.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.poi.ExcelUtil;
 import com.boman.common.core.web.controller.BaseController;
 import com.boman.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
 import com.boman.common.security.annotation.PreAuthorize;
-import com.boman.domain.Czrk;
-import com.boman.domain.CzrkJzdz;
-import com.boman.domain.SysRole;
-import com.boman.domain.TableDataInfo;
+import com.boman.domain.*;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.domain.JsonRequest;
 import com.boman.web.core.service.czrk.ICzrkService;
@@ -19,6 +17,7 @@ import com.boman.web.core.utils.AuthUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -240,4 +239,27 @@ public class CzrkController extends BaseController {
         ExcelUtil<Czrk> util = new ExcelUtil<>(Czrk.class);
         util.exportExcel(response, czrkList, "人员数据");
     }
+
+    @Log(title = "人员信息", businessType = BusinessType.IMPORT)
+    @PreAuthorize(hasPermi = "system:czrk:importData")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws Exception
+    {
+        ExcelUtil<ThirdPartInfo> util = new ExcelUtil<ThirdPartInfo>(ThirdPartInfo.class);
+        List<ThirdPartInfo> thirdPartInfoList = util.importExcel(file.getInputStream());
+        //String operName = SecurityUtils.getUsername();
+        String message = czrkService.importUser(thirdPartInfoList);
+        return AjaxResult.success(message);
+    }
+
+    /**
+     * 查询死亡人口导入信息
+     *
+     */
+    @GetMapping("/listDie")
+    public TableDataInfo listDie(ThirdPartInfo thirdPartInfo) {
+        List<ThirdPartInfo> list = czrkService.listDie(thirdPartInfo);
+        return getDataTable(list);
+    }
+
 }

+ 1 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkMapper.java

@@ -228,4 +228,5 @@ public interface CzrkMapper {
     long selectCzrkJzdzCount(Czrk czrk);
 
 
+    Czrk getCzrkByIdCard(String idCard);
 }

+ 17 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/ThirdPartInfoMapper.java

@@ -0,0 +1,17 @@
+package com.boman.web.core.mapper;
+
+import com.boman.domain.ThirdPartInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+public interface ThirdPartInfoMapper {
+
+    void insertThirdPartInfoList(@Param("thirdPartInfoList")List<ThirdPartInfo> thirdPartInfoList);
+
+    List<ThirdPartInfo> queryList(ThirdPartInfo thirdPartInfo);
+}

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

@@ -694,4 +694,11 @@ public class TaskService {
     private String packRedisKey(String deptId) {
         return STS_CZRK_ + deptId + ":" + DateUtils.getDate();
     }
+
+    public static void main(String[] args) {
+        String s = "茶庄村涪陵组";
+        //获取村
+        String cun =  s.substring(0,s.indexOf("村"));
+        System.out.println(cun);
+    }
 }

+ 123 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -3,6 +3,7 @@ package com.boman.web.core.service.czrk;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.exception.BaseException;
+import com.boman.common.core.exception.CustomException;
 import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.constant.HttpStatus;
@@ -15,6 +16,7 @@ import com.boman.common.core.web.page.TableSupport;
 import com.boman.common.redis.service.RedisService;
 import com.boman.common.security.service.TokenService;
 import com.boman.domain.*;
+import com.boman.domain.constant.CacheConstants;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.utils.ThreadPoolService;
 import com.boman.system.api.RemoteDeptService;
@@ -25,10 +27,12 @@ import com.boman.web.core.domain.JsonRequest;
 import com.boman.web.core.mapper.CzrkChangeMapper;
 import com.boman.web.core.mapper.CzrkMapper;
 import com.boman.web.core.mapper.GridInfoMapper;
+import com.boman.web.core.mapper.ThirdPartInfoMapper;
 import com.boman.web.core.service.ip.IpTimesService;
 import com.boman.web.core.utils.*;
 import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.tomcat.util.buf.HexUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -81,6 +85,9 @@ public class CzrkServiceImpl implements ICzrkService {
     @Autowired
     private TokenService tokenService;
 
+    @Resource
+    private ThirdPartInfoMapper thirdPartInfoMapper;
+
     /**
      * 2022/3/24修复人员认领接口列表,逻辑:所有人都能看到所有没有确认,没有认领的人员
      *
@@ -1080,6 +1087,122 @@ public class CzrkServiceImpl implements ICzrkService {
         return czrkList;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String importUser(List<ThirdPartInfo> thirdPartInfoList) {
+        if (StringUtils.isNull(thirdPartInfoList) || thirdPartInfoList.size() == 0) {
+            throw new CustomException("导入数据不能为空!");
+        }
+        //获取登录人员
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+        try{
+            for (ThirdPartInfo thirdPartInfo : thirdPartInfoList) {
+
+                //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                //String  str = sdf.format(DateUtils.formatDate(thirdPartInfo.getCremationTime()));
+
+                //将ThirdPartInfo对象所有字段赋值
+                //ThirdPartInfoUtils.setValue(thirdPartInfo);
+                // 防止有空行,IdCard是必须要有的
+                if (StringUtils.isEmpty(thirdPartInfo.getIdCard())) {
+                    continue;
+                }
+                //将信息存入ThirdPartInfo表
+                thirdPartInfo.setStatus("4");
+                thirdPartInfo.setCreateBy(sysUser.getUserName());
+                thirdPartInfo.setUpdateBy(sysUser.getUserName());
+                thirdPartInfo.setIsDel("N");
+                thirdPartInfo.setProvinceId("12");
+                thirdPartInfo.setProvince("安徽省");
+                thirdPartInfo.setCityId("340800000000");
+                thirdPartInfo.setCity("安庆市");
+                thirdPartInfo.setRegionId("340882000000");
+                thirdPartInfo.setRegion("潜山市");
+                thirdPartInfo.setVillageTownsId("");
+                thirdPartInfo.setVillageTowns("");
+                thirdPartInfo.setVillageId("");
+                thirdPartInfo.setVillage("");
+                //从redis中取出部门数据
+                List<SysDept> allDepts = redisService.getCacheList(CacheConstants.DEPT_LIST);
+                thirdPartInfo.setIsLocal("否");
+                //去数据库根据人员身份证号查询人员
+                Czrk czrkSjk = czrkMapper.getCzrkByIdCard(thirdPartInfo.getIdCard());
+                if(ObjectUtils.isNotEmpty(czrkSjk)){
+                    //数据库存在该人员
+                    czrkSjk.setStatus("4");
+                    czrkSjk.setChangUser(sysUser.getPhonenumber());
+                    czrkSjk.setChangNikeUser(sysUser.getNickName());
+                    czrkMapper.changeCzrk(czrkSjk);
+                    thirdPartInfo.setIsLocal("是");
+                    if(StringUtils.isNotEmpty(czrkSjk.getVillageTownsId())){
+                        thirdPartInfo.setVillageTownsId(czrkSjk.getVillageTownsId());
+                    }
+                    if(StringUtils.isNotEmpty(czrkSjk.getVillageTowns())){
+                        thirdPartInfo.setVillageTowns(czrkSjk.getVillageTowns());
+                    }
+                    if(StringUtils.isNotEmpty(czrkSjk.getVillageId())){
+                        thirdPartInfo.setVillageId(czrkSjk.getVillageId());
+                    }
+                    if(StringUtils.isNotEmpty(czrkSjk.getVillage())){
+                        thirdPartInfo.setVillage(czrkSjk.getVillage());
+                    }
+                }else {
+                    //获取乡镇
+                    //乡镇deptId
+                    Long deptId = null;
+                    if(isNotEmpty(thirdPartInfo.getTownship())){
+                        for (SysDept allDept : allDepts) {
+                            if(allDept.getDeptName().equals(thirdPartInfo.getTownship()+"乡") || allDept.getDeptName().equals(thirdPartInfo.getTownship()+"镇")){
+                                thirdPartInfo.setVillageTownsId(allDept.getAreaId());
+                                thirdPartInfo.setVillageTowns(allDept.getDeptName());
+                                deptId = allDept.getId();
+                                break;
+                            }
+                        }
+                    }
+                    //获取村
+                    if(isEmpty(deptId) && isNotEmpty(thirdPartInfo.getVillageGroup()) && thirdPartInfo.getVillageGroup().contains("村")){
+                        String cun =  thirdPartInfo.getVillageGroup().substring(0,thirdPartInfo.getVillageGroup().indexOf("村"));
+                        for (SysDept allDept : allDepts) {
+                            if(allDept.getParentId().equals(deptId) && allDept.getDeptName().contains(cun)){
+                                thirdPartInfo.setVillageId(allDept.getAreaId());
+                                thirdPartInfo.setVillage(allDept.getDeptName());
+                                break;
+                            }
+                        }
+                    }
+                }
+
+            }
+            thirdPartInfoMapper.insertThirdPartInfoList(thirdPartInfoList);
+
+            return "导入成功";
+        }catch (Exception e){
+            e.printStackTrace();
+            return "导入失败";
+        }
+
+    }
+
+    @Override
+    public List<ThirdPartInfo> listDie(ThirdPartInfo thirdPartInfo) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        log.info("{}于{}查询非正常人员人员列表,查询条件:{}"
+                , sysUser.getUserName(), DateUtils.dateTimeNow(), JSON.toJSONString(thirdPartInfo));
+        //设置权限
+        setQueryRoleDie(thirdPartInfo, sysUser);
+        long startTimeSql = System.currentTimeMillis();
+        startPage();
+        List<ThirdPartInfo> thirdPartInfoList = thirdPartInfoMapper.queryList(thirdPartInfo);
+        long endTimeSql = System.currentTimeMillis() - startTimeSql;
+        log.info("执行查询死亡人员sql语句时间:" + endTimeSql + "ms");
+        return thirdPartInfoList;
+    }
+
     @Override
     public Czrk getById(Long id) {
         if (isEmpty(id)) {

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkService.java

@@ -2,6 +2,7 @@ package com.boman.web.core.service.czrk;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.Czrk;
+import com.boman.domain.ThirdPartInfo;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.domain.JsonRequest;
 
@@ -141,4 +142,8 @@ public interface ICzrkService {
     List<Czrk> getAllCzrkRegionId(String s);
 
     List<Czrk> getAllCzrk(Czrk czrk);
+
+    String importUser(List<ThirdPartInfo> thirdPartInfoList);
+
+    List<ThirdPartInfo> listDie(ThirdPartInfo thirdPartInfo);
 }

+ 55 - 9
boman-web-core/src/main/java/com/boman/web/core/utils/CzrkUtils.java

@@ -115,6 +115,52 @@ public class CzrkUtils {
     }
 
 
+    /**
+     * 查询使用(死亡导入人员权限)
+     * 根据当前登录人判断该用户是什么角色权限字符,来进行判断该用户能查询到什么层级的数据
+     *
+     * @param thirdPartInfo
+     * @param sysUser
+     */
+    public static void setQueryRoleDie(ThirdPartInfo thirdPartInfo, SysUser sysUser) {
+        SysDept dept = sysUser.getDept();
+        if (dept == null) {
+            throw new BaseException("对不起,未获相关部门信息");
+        }
+        // 从部门中获取行政区域规划id
+        String areaId = dept.getAreaId();
+        if (StringUtils.isBlank(areaId)) {
+            throw new BaseException(dept.getDeptName() + "当前未获取到部门下行政区域id");
+        }
+        //判断该用户是什么角色权限字符
+        List<SysRole> roles = sysUser.getRoles();
+        if (roles != null && roles.size() > 0) {
+            for (SysRole role : roles) {
+                if (role != null) {
+                    String roleKey = role.getRoleKey();
+                    if (StringUtils.isNotBlank(roleKey)) {
+                        if ("province".equals(roleKey)) {
+                            thirdPartInfo.setProvinceId(areaId);
+
+                        } else if ("city".equals(roleKey)) {
+                            thirdPartInfo.setCityId(areaId);
+
+                        } else if ("region".equals(roleKey)) {
+                            thirdPartInfo.setRegionId(areaId);
+
+                        } else if ("villageTowns".equals(roleKey)) {
+                            thirdPartInfo.setVillageTownsId(areaId);
+
+                        } else if ("village".equals(roleKey)) {
+                            thirdPartInfo.setVillageId(areaId);
+
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * 新增用户的时候,判断登录用户是否能新增
      *
@@ -149,7 +195,7 @@ public class CzrkUtils {
                                 List<CzrkJzdz> czrkJzdzList = czrk.getCzrkJzdzList();
                                 for (CzrkJzdz czrkJzdz : czrkJzdzList) {
                                     String provinceIdJzdz = czrkJzdz.getProvinceId();
-                                    if (StringUtils.isNotBlank(provinceIdJzdz) && provinceIdJzdz.equals(areaId)){
+                                    if (StringUtils.isNotBlank(provinceIdJzdz) && provinceIdJzdz.equals(areaId)) {
                                         flag = false;
                                         break;
                                     }
@@ -160,11 +206,11 @@ public class CzrkUtils {
                             if (StringUtils.isNotBlank(cityId) && cityId.equals(areaId)) {
                                 flag = false;
                                 break;
-                            }else {
+                            } else {
                                 List<CzrkJzdz> czrkJzdzList = czrk.getCzrkJzdzList();
                                 for (CzrkJzdz czrkJzdz : czrkJzdzList) {
                                     String cityJzdz = czrkJzdz.getCityId();
-                                    if (StringUtils.isNotBlank(cityJzdz) && cityJzdz.equals(areaId)){
+                                    if (StringUtils.isNotBlank(cityJzdz) && cityJzdz.equals(areaId)) {
                                         flag = false;
                                         break;
                                     }
@@ -175,11 +221,11 @@ public class CzrkUtils {
                             if (StringUtils.isNotBlank(regionId) && regionId.equals(areaId)) {
                                 flag = false;
                                 break;
-                            }else {
+                            } else {
                                 List<CzrkJzdz> czrkJzdzList = czrk.getCzrkJzdzList();
                                 for (CzrkJzdz czrkJzdz : czrkJzdzList) {
                                     String regoinJzdz = czrkJzdz.getRegionId();
-                                    if (StringUtils.isNotBlank(regoinJzdz) && regoinJzdz.equals(areaId)){
+                                    if (StringUtils.isNotBlank(regoinJzdz) && regoinJzdz.equals(areaId)) {
                                         flag = false;
                                         break;
                                     }
@@ -190,11 +236,11 @@ public class CzrkUtils {
                             if (StringUtils.isNotBlank(villageTownsId) && villageTownsId.equals(areaId)) {
                                 flag = false;
                                 break;
-                            }else {
+                            } else {
                                 List<CzrkJzdz> czrkJzdzList = czrk.getCzrkJzdzList();
                                 for (CzrkJzdz czrkJzdz : czrkJzdzList) {
                                     String townIdJzdz = czrkJzdz.getTownId();
-                                    if (StringUtils.isNotBlank(townIdJzdz) && townIdJzdz.equals(areaId)){
+                                    if (StringUtils.isNotBlank(townIdJzdz) && townIdJzdz.equals(areaId)) {
                                         flag = false;
                                         break;
                                     }
@@ -205,11 +251,11 @@ public class CzrkUtils {
                             if (StringUtils.isNotBlank(village) && village.equals(areaId)) {
                                 flag = false;
                                 break;
-                            }else {
+                            } else {
                                 List<CzrkJzdz> czrkJzdzList = czrk.getCzrkJzdzList();
                                 for (CzrkJzdz czrkJzdz : czrkJzdzList) {
                                     String villageIdJzdz = czrkJzdz.getVillageId();
-                                    if (StringUtils.isNotBlank(villageIdJzdz) && villageIdJzdz.equals(areaId)){
+                                    if (StringUtils.isNotBlank(villageIdJzdz) && villageIdJzdz.equals(areaId)) {
                                         flag = false;
                                         break;
                                     }

+ 3 - 0
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -1377,4 +1377,7 @@
         </where>
         order by c.create_time DESC
     </select>
+    <select id="getCzrkByIdCard" resultMap="CzrkResult">
+        select id,id_card,house_type from czrk where is_del = 'N' and id_card = #{idCard}
+    </select>
 </mapper>

+ 157 - 0
boman-web-core/src/main/resources/mapper/ThirdPartInfoMapper.xml

@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.boman.web.core.mapper.ThirdPartInfoMapper">
+
+    <resultMap type="com.boman.domain.ThirdPartInfo" id="ThirdPartInfoResult">
+        <result property="id"    column="id"    />
+        <result property="cremationCertificate"    column="cremation_certificate"    />
+        <result property="cremationTime"    column="cremation_time"    />
+        <result property="userName"    column="user_name"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="age"    column="age"    />
+        <result property="gender"    column="gender"    />
+        <result property="nation"    column="nation"    />
+        <result property="township"    column="township"    />
+        <result property="villageGroup"    column="village_group"    />
+        <result property="homePhone"    column="home_phone"    />
+        <result property="isDeposit"    column="is_deposit"    />
+        <result property="isColdStorage"    column="is_cold_storage"    />
+        <result property="causeOfDeath"    column="cause_of_death"    />
+        <result property="isHmbz"    column="is_hmbz"    />
+        <result property="sjgm"    column="sjgm"    />
+        <result property="jzdx"    column="jzdx"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="isLocalAccount"    column="is_local_account"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isDel"    column="is_del"    />
+        <result property="provinceId" column="province_id"/>
+        <result property="province" column="province"/>
+        <result property="cityId" column="city_id"/>
+        <result property="city" column="city"/>
+        <result property="regionId" column="region_id"/>
+        <result property="region" column="region"/>
+        <result property="villageTownsId" column="village_towns_id"/>
+        <result property="villageTowns" column="village_towns"/>
+        <result property="villageId" column="village_id"/>
+        <result property="village" column="village"/>
+        <result property="isLocal" column="is_local"/>
+
+
+    </resultMap>
+
+
+    <insert id="insertThirdPartInfoList" useGeneratedKeys="true" keyProperty="id">
+        insert into third_part_info(cremation_certificate,
+            cremation_time,
+            user_name,
+            id_card,
+            age,
+            gender,
+            nation,
+            township,
+            village_group,
+            home_phone,
+            is_deposit,
+            is_cold_storage,
+            cause_of_death,
+            is_hmbz,
+            sjgm,
+            jzdx,
+            remarks,
+            is_local_account,
+            status,
+            create_by,
+            update_by,
+            is_del,
+            province_id,
+            province,
+            city_id,
+            city,
+            region_id,
+            region,
+            village_towns_id,
+            village_towns,
+            village_id,
+            village,
+            is_local)
+        values
+        <foreach item="thirdPartInfo" index="index" collection="thirdPartInfoList" separator=",">
+            (#{thirdPartInfo.cremationCertificate},
+            #{thirdPartInfo.cremationTime},
+            #{thirdPartInfo.userName},
+            #{thirdPartInfo.idCard},
+            #{thirdPartInfo.age},
+            #{thirdPartInfo.gender},
+            #{thirdPartInfo.nation},
+            #{thirdPartInfo.township},
+            #{thirdPartInfo.villageGroup},
+            #{thirdPartInfo.homePhone},
+            #{thirdPartInfo.isDeposit},
+            #{thirdPartInfo.isColdStorage},
+            #{thirdPartInfo.causeOfDeath},
+            #{thirdPartInfo.isHmbz},
+            #{thirdPartInfo.sjgm},
+            #{thirdPartInfo.jzdx},
+            #{thirdPartInfo.remarks},
+            #{thirdPartInfo.isLocalAccount},
+            #{thirdPartInfo.status},
+            #{thirdPartInfo.createBy},
+            #{thirdPartInfo.updateBy},
+            #{thirdPartInfo.isDel},
+            #{thirdPartInfo.provinceId},
+            #{thirdPartInfo.province},
+            #{thirdPartInfo.cityId},
+            #{thirdPartInfo.city},
+            #{thirdPartInfo.regionId},
+            #{thirdPartInfo.region},
+            #{thirdPartInfo.villageTownsId},
+            #{thirdPartInfo.villageTowns},
+            #{thirdPartInfo.villageId},
+            #{thirdPartInfo.village},
+            #{thirdPartInfo.isLocal})
+        </foreach>
+    </insert>
+
+    <select id="queryList" resultMap="ThirdPartInfoResult">
+        select id, cremation_certificate, cremation_time, user_name, id_card, age, gender, nation, township, village_group,
+               home_phone, is_deposit, is_cold_storage,cause_of_death,status,
+               is_hmbz,sjgm,jzdx,remarks,is_local_account,is_local,create_time
+        from third_part_info
+        <where>
+            is_del = 'N'
+            and status = '4'
+            <if test="userName != null  and userName != ''">
+                and user_name like concat(#{userName}, '%')
+            </if>
+            <if test="gender != null  and gender != ''">and gender = #{gender}</if>
+            <if test="age != null ">and age = #{age}</if>
+            <if test="cremationCertificate != null  and cremationCertificate != ''">and cremation_certificate = #{cremationCertificate}</if>
+            <if test="nation != null  and nation != ''">and nation = #{nation}</if>
+            <if test="idCard != null  and idCard != ''">and id_card = #{idCard}</if>
+            <if test="township != null  and township != ''">and township = #{township}</if>
+            <if test="homePhone != null  and homePhone != ''">and home_phone = #{homePhone}</if>
+            <if test="isDeposit != null  and isDeposit != ''">and is_deposit = #{isDeposit}</if>
+            <if test="isColdStorage != null  and isColdStorage != ''">and is_cold_storage = #{isColdStorage}</if>
+            <if test="causeOfDeath != null  and causeOfDeath != ''">and cause_of_death = #{causeOfDeath}</if>
+            <if test="isHmbz != null  and isHmbz != ''">and is_hmbz = #{isHmbz}</if>
+            <if test="sjgm != null  and sjgm != ''">and sjgm = #{sjgm}</if>
+            <if test="jzdx != null  and jzdx != ''">and jzdx = #{jzdx}</if>
+            <if test="isLocalAccount != null  and isLocalAccount != ''">and is_local_account = #{isLocalAccount}</if>
+            <if test="provinceId != null  and provinceId != ''">and province_id = #{provinceId}</if>
+            <if test="cityId != null  and cityId != ''">and city_id = #{cityId}</if>
+            <if test="regionId != null  and regionId != ''">and region_id = #{regionId}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''">and village_towns_id = #{villageTownsId}</if>
+            <if test="villageId != null  and villageId != ''">and village_id = #{villageId}</if>
+            <if test="isLocal != null  and isLocal != ''">and is_local = #{isLocal}</if>
+        </where>
+        order by create_time DESC
+    </select>
+
+
+</mapper>