瀏覽代碼

bug修改

shiqian 3 年之前
父節點
當前提交
18c9444049

+ 37 - 9
boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java

@@ -44,7 +44,7 @@ public class VaccineInfoOperation extends BaseEntity {
     private String villagerGroup;
 
     /**
-     * 户别
+     * 户别 是否是户主 是Y, 否N
      */
     @Excel(name = "户别")
     private String houseType;
@@ -269,32 +269,48 @@ public class VaccineInfoOperation extends BaseEntity {
 
     private String deleteReason;
 
+    /** 户籍地的镇 **/
+    private String residenceTown;
+    /** 户籍地的村 **/
+    private String residenceVillage;
+
 
     /**
      * 检索开始时间
      */
-    @JSONField(format = "yyyy-MM-dd HH:mm")
-    private Date startTime;
+//    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private String startTime;
 
     /**
      * 检索结束时间
      */
-    @JSONField(format = "yyyy-MM-dd HH:mm")
-    private Date endTime;
+//    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private String endTime;
+
+    /** 认领人***/
+    private String rlr;
+
+    public String getRlr() {
+        return rlr;
+    }
+
+    public void setRlr(String rlr) {
+        this.rlr = rlr;
+    }
 
-    public Date getStartTime() {
+    public String getStartTime() {
         return startTime;
     }
 
-    public void setStartTime(Date startTime) {
+    public void setStartTime(String startTime) {
         this.startTime = startTime;
     }
 
-    public Date getEndTime() {
+    public String getEndTime() {
         return endTime;
     }
 
-    public void setEndTime(Date endTime) {
+    public void setEndTime(String endTime) {
         this.endTime = endTime;
     }
 
@@ -691,7 +707,19 @@ public class VaccineInfoOperation extends BaseEntity {
         this.nowIn = nowIn;
     }
 
+    public String getResidenceTown() {
+        return residenceTown;
+    }
 
+    public void setResidenceTown(String residenceTown) {
+        this.residenceTown = residenceTown;
+    }
 
+    public String getResidenceVillage() {
+        return residenceVillage;
+    }
 
+    public void setResidenceVillage(String residenceVillage) {
+        this.residenceVillage = residenceVillage;
+    }
 }

+ 1 - 1
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysDeptServiceImpl.java

@@ -549,7 +549,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
 
         List<SysDept> townsDepts = new ArrayList<>(16);
         List<SysDept> allDepts = selectDeptsList();
-        if (roleKeyList.contains("admin") || roleKeyList.contains("city")) {
+        if (roleKeyList.contains("admin") || roleKeyList.contains("city") || roleKeyList.contains("yanshi")) {
             Long deptId1;
             if (null == deptId) deptId1 = 1L; // 查所有乡镇
             else deptId1 = deptId; // 查乡镇下的村

+ 39 - 1
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -1,13 +1,18 @@
 package com.boman.web.core.controller;
 
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.domain.TableDataInfo;
 import com.boman.domain.VaccineInfoOperation;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * @author shiqian
  * @description 常驻人口
@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
  **/
 @RestController
 @RequestMapping("/core/czrk")
-public class CzrkController {
+public class CzrkController extends BaseController {
 
     @Autowired
     private IVaccineInfoService vaccineInfoService;
@@ -30,6 +35,28 @@ public class CzrkController {
         return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
     }
 
+    /**
+     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的新增人员列表
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/listByXz")
+    public TableDataInfo listByXz(VaccineInfoOperation condition) {
+        List<VaccineInfoOperation> list = vaccineInfoService.listByXz(condition);
+        return getDataTable(list);
+    }
+
+    /**
+     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的减少人员列表
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/listByJs")
+    public TableDataInfo listByJs(VaccineInfoOperation condition) {
+        List<VaccineInfoOperation> list = vaccineInfoService.listByJs(condition);
+        return getDataTable(list);
+    }
+
     /**
      * 功能描述: 删除常住人口
      *
@@ -40,5 +67,16 @@ public class CzrkController {
         return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
     }
 
+    /**
+     * 功能描述: 根据户号查找家庭中所有人员
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/family/{code}")
+    public AjaxResult family(@PathVariable("code") String code) {
+        return AjaxResult.success(vaccineInfoService.family(code));
+    }
+
+
 
 }

+ 2 - 2
boman-web-core/src/main/java/com/boman/web/core/controller/RyrlController.java

@@ -24,7 +24,7 @@ public class RyrlController extends BaseController {
     private IVaccineInfoService vaccineInfoService;
 
     /**
-     * 功能描述: 认领人员list
+     * 功能描述: 认领人员list, 如果isDel="Y", 则为回收站的功能,默认是isDel="N"
      *
      * @param vaccineInfo vaccineInfo
      * @return com.boman.domain.TableDataInfo
@@ -47,7 +47,7 @@ public class RyrlController extends BaseController {
     }
 
     /**
-     * 功能描述: 修改
+     * 功能描述: 修改 也即 由未认领到认领
      *
      * @param vaccineInfo vaccineInfo
      * @return com.boman.domain.dto.AjaxResult

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/FxryMapper.java

@@ -18,4 +18,6 @@ public interface FxryMapper{
     List<Fxry> list(Fxry fxry);
 
     Fxry getById(String id);
+
+    int countByIdCard(String idCard);
 }

+ 6 - 1
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -109,7 +109,10 @@ public interface VaccineInfoMapper
 
     int deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
 
-    List<VaccineInfoOperation> listByXzAndJs(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition);
+    int countByJs(VaccineInfoOperation condition);
+    int countByXz(VaccineInfoOperation condition);
     /**
      * 功能描述: 根据deptIdList查找多少已经认领的(常住人口数量)
      *
@@ -117,4 +120,6 @@ public interface VaccineInfoMapper
      * @return int
      */
     int countCzrk(VaccineInfoOperation condition);
+
+    List<VaccineInfoOperation> listByCode(String code);
 }

+ 7 - 5
boman-web-core/src/main/java/com/boman/web/core/service/fxry/FxryServiceImpl.java

@@ -34,8 +34,12 @@ public class FxryServiceImpl implements FxryService {
     @Override
     public AjaxResult add(Fxry fxry) {
         String idCard = fxry.getIdCard();
-        String hideIdCard = IdCardUtils.hideIdCard(idCard);
-        fxry.setIdCardHide(hideIdCard);
+        int count = mapper.countByIdCard(idCard);
+        if (count > 0) {
+            return AjaxResult.error("此人已经存在,请勿重复添加");
+        }
+
+        fxry.setIdCardHide(IdCardUtils.hideIdCard(idCard));
         fxry.setCreateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setAge(IdCardUtils.getAge(idCard));
@@ -48,8 +52,7 @@ public class FxryServiceImpl implements FxryService {
 
     @Override
     public AjaxResult edit(Fxry fxry) {
-        String hideIdCard = IdCardUtils.hideIdCard(fxry.getIdCard());
-        fxry.setIdCardHide(hideIdCard);
+        fxry.setIdCardHide(IdCardUtils.hideIdCard(fxry.getIdCard()));
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         packWzhjdz(fxry);
 
@@ -83,7 +86,6 @@ public class FxryServiceImpl implements FxryService {
         }
 
         List<Fxry> list = mapper.list(fxry);
-
         return list;
     }
 

+ 6 - 0
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java

@@ -97,6 +97,12 @@ public interface IVaccineInfoService
     JSONObject stsByApplet();
 
     JSONObject stsByCzrk();
+    int countByJs(VaccineInfoOperation condition);
+    int countByXz(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition);
 
     AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
+
+    List<VaccineInfoOperation> family(String code);
 }

+ 195 - 25
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -1033,6 +1033,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
     @Override
     public List<VaccineInfoOperation> listByRlry(VaccineInfoOperation vaccineInfoOperation) {
+        vaccineInfoOperation.setIsDel(isEmpty(vaccineInfoOperation.getIsDel()) ? "N" : "Y");
         Long deptId = vaccineInfoOperation.getDeptId();
         if (deptId == null) {
             deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
@@ -1107,12 +1108,20 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
     @Override
     public AjaxResult addRlry(VaccineInfoOperation vaccineInfo) {
+        if (isNotEmpty(vaccineInfo.getVillageTowns())) {
+            vaccineInfo.setRlr(SecurityUtils.getUsername());
+        }
+
         int i = vaccineInfoMapper.insertVaccineInfo(vaccineInfo);
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
     @Override
     public AjaxResult editRlry(VaccineInfoOperation vaccineInfo) {
+        if (isNotEmpty(vaccineInfo.getVillageTowns())) {
+            vaccineInfo.setRlr(SecurityUtils.getUsername());
+        }
+
         int i = vaccineInfoMapper.updateVaccineInfo(vaccineInfo);
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
     }
@@ -1174,14 +1183,13 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
         List<SysRole> roles = sysUser.getRoles();
         List<String> roleKeySets = map(roles, SysRole::getRoleKey);
-        Date todayStart = DateUtils.getTodayStart();
-        Date todayEnd = DateUtils.getTodayEnd();
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
         VaccineInfoOperation condition = new VaccineInfoOperation();
         condition.setStartTime(todayStart);
         condition.setEndTime(todayEnd);
-        List<VaccineInfoOperation> list = null;
         // 市领导
-        if (roleKeySets.contains("city") || roleKeySets.contains("admin")) {
+        if (roleKeySets.contains("city") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
             List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
             List<SysDept> townsDepts = new ArrayList<>(16);
             for (SysDept allDept : allDepts) {
@@ -1212,8 +1220,6 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 }
             }
             result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
-
-            list = vaccineInfoMapper.listByXzAndJs(condition);
         } else if (roleKeySets.contains("sys:town")) {
             // 乡镇以下的所有部门
             List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
@@ -1237,33 +1243,155 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             }
 
             result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+
+        int xz = vaccineInfoMapper.countByXz(condition);
+        int js = vaccineInfoMapper.countByJs(condition);
+        result.put("xz", xz);
+        result.put("js", js);
+        result.put("czrk", vaccineInfoMapper.countCzrk(condition));
+        return result;
+    }
 
+    @Override
+    public int countByJs(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
             condition.setDeptIdList(map(depts, SysDept::getId));
-            list = vaccineInfoMapper.listByXzAndJs(condition);
         }
 
-        // 增加、减少
-        if (isEmpty(list)) {
-            result.put("xz", 0);
-            result.put("js", 0);
-        } else {
-            int xz = 0, js = 0;
-            for (VaccineInfoOperation operation : list) {
-                Date createTime = operation.getCreateTime(), updateTime = operation.getUpdateTime();
-                String isDel = operation.getIsDel();
-                if ("N".equals(isDel) && createTime.after(todayStart) && createTime.before(todayEnd)) {
-                    xz++;
-                } else if ("Y".equals(isDel) && updateTime.after(todayStart) && updateTime.before(todayEnd)) {
-                    js++;
-                }
+        return vaccineInfoMapper.countByJs(condition);
+    }
+
+    @Override
+    public List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByJs(condition);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
+            }
+
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
             }
 
-            result.put("xz", xz);
-            result.put("js", js);
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
         }
+        return infoOperations;
+    }
 
-        result.put("czrk", vaccineInfoMapper.countCzrk(condition));
-        return result;
+    @Override
+    public int countByXz(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+
+        return vaccineInfoMapper.countByXz(condition);
+    }
+
+    @Override
+    public List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByXz(condition);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
+            }
+
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
+            }
+
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
+        }
+
+        return infoOperations;
     }
 
     @Override
@@ -1281,4 +1409,46 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         int delete = vaccineInfoMapper.deleteCzrk(vaccineInfoOperation);
         return delete > 0 ? AjaxResult.success() : AjaxResult.error();
     }
+
+    @Override
+    public List<VaccineInfoOperation> family(String code) {
+        if (isEmpty(code)) {
+            return Collections.emptyList();
+        }
+
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByCode(code);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
+            }
+
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
+            }
+
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
+        }
+
+        return infoOperations;
+    }
 }

+ 8 - 5
boman-web-core/src/main/java/com/boman/web/core/utils/IdCardUtils.java

@@ -13,7 +13,7 @@ import java.util.Date;
  **/
 public class IdCardUtils {
 
-    private static SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
 
     public static String hideIdCard(String idCard) {
         if (ObjectUtils.isEmpty(idCard)) {
@@ -21,10 +21,13 @@ public class IdCardUtils {
         }
 
         // 340104202201050105
-        String before = idCard.substring(0, 4);
-        String after = idCard.substring(13);
-        return before + "*********" + after;
-
+        try {
+            String before = idCard.substring(0, 4);
+            String after = idCard.substring(13);
+            return before + "*********" + after;
+        } catch (Exception e) {
+            return idCard;
+        }
     }
 
 

+ 11 - 2
boman-web-core/src/main/resources/mapper/FxryMapper.xml

@@ -56,14 +56,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="list" resultType="com.boman.domain.Fxry">
         select id,
                `name`,
+               `sex`,
                telephone,
-               id_card_hide idCard,
+               id_card idCardHide,
                wzhjdz,
                addr_outside_province addrOutsideProvince,
                intended_return_time intendedReturnTime
         from fxry
         where `delete` = '否'
-        <if test="name != null and name != ''">and `name` like concat('%', #{name}, '%')</if>
+        <if test="name != null and name != ''">
+          and (`name` like concat('%', #{name}, '%') or `id_card` like concat('%', #{name}, '%'))
+        </if>
         <if test="sex != null and sex != ''">and `sex` = #{sex}</if>
         <if test="idCard != null and idCard != ''">and `id_card` like concat('%', #{idCard}, '%')</if>
         <if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
@@ -90,4 +93,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from fxry
         where id = #{id} limit 1;
     </select>
+
+    <select id="countByIdCard" resultType="int">
+        select count(id)
+        from fxry
+        where id_card = #{idCard}
+    </select>
 </mapper>

+ 225 - 6
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="city"    column="city"  />
         <result property="region"    column="region"  />
         <result property="vaccineName"    column="vaccine_name"  />
+        <result property="residenceTown"    column="residence_town"  />
+        <result property="residenceVillage"    column="residence_village"  />
         <result property="userName"    column="user_name"  />
         <result property="gender"    column="gender"  />
         <result property="idCard"    column="id_card"  />
@@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="vaccinationTime"    column="vaccination_time"    />
         <result property="progress"    column="progress"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="rlr"    column="rlr"    />
         <collection  property="vaccineInfoUserList"   javaType="java.util.List"        resultMap="VaccineInfoUser" />
     </resultMap>
 
@@ -68,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
         vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
                vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
-
+               vi.residence_town as residenceTown, vi.residence_village as residenceVillage,
                viu.id as id_user,viu.id_card as id_card_user,viu.vaccine_name as vaccine_name_user,viu.jici as jici_user,viu.vaccination_time as vaccination_time_user,
                viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
                from vaccine_info vi left join vaccine_info_user viu
@@ -135,11 +138,218 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by vi.create_time DESC ,vi.vaccination_time DESC
     </select>
 
-    <select id="listByXzAndJs"  resultMap="VaccineInfoResult">
-        select vi.create_time, vi.update_time, vi.is_del
+    <select id="listByXz"  resultMap="VaccineInfoResult">
+        select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
+             , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
+        from vaccine_info vi
+        where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
+        <!--where vi.is_del = 'N' and vi.create_time &gt;= #{startTime, jdbcType=DATE} and vi.create_time &lt;= #{startTime, jdbcType=DATE} -->
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="countByXz" resultType="int">
+        select count(1)
+        from vaccine_info vi
+        where vi.is_del = 'N' and vi.create_time &gt;= date_format(#{startTime}, '%y-%m-%d %H:%i:%s') and vi.create_time &lt;= date_format(#{endTime}, '%y-%m-%d %H:%i:%s')
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="listByJs" resultMap="VaccineInfoResult">
+        select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
+        , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
         from vaccine_info vi
-        where (vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}) or
-        (vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime})
+        where vi.is_del = 'N' and vi.update_time &gt;= date_format(#{startTime}, '%y-%m-%d %H:%i:%s') and vi.update_time &lt;= date_format(#{endTime}, '%y-%m-%d %H:%i:%s')
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="countByJs" resultType="int">
+        select count(1)
+        from vaccine_info vi
+        where vi.is_del = 'N' and vi.update_time &gt;= date_format(#{startTime}, '%y-%m-%d %H:%i:%s') and vi.update_time &lt;= date_format(#{endTime}, '%y-%m-%d %H:%i:%s')
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -163,11 +373,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="listByCode" resultMap="VaccineInfoResult">
+        select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
+        , vi.house_type, vi.update_by, vi.code, vi.rlr
+        from vaccine_info vi
+        where vi.is_del = 'N' and code = #{code}
+    </select>
+
     <select id="listByRlry" resultMap="VaccineInfoResult">
         select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
+               , vi.house_type, vi.update_by, vi.code, vi.rlr
         from vaccine_info vi
         <where>
-            vi.is_del = 'N'
+            vi.is_del = #{isDel}
             <!-- 已认领 -->
             <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
             <!-- 未认领 -->
@@ -429,6 +647,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
             <if test="age != null and age != ''">age = #{age},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="rlr != null and rlr != ''">rlr = #{rlr},</if>
         </trim>
         where id = #{id}
     </update>