Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

tjf před 3 roky
rodič
revize
4bb6b74c0f

+ 11 - 184
boman-api/boman-domain/src/main/java/com/boman/domain/Fxry.java

@@ -1,8 +1,11 @@
 package com.boman.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.sql.Timestamp;
 import java.util.Date;
 
 /**
@@ -10,10 +13,10 @@ import java.util.Date;
  * @author shiqian
  * @date 2022年01月05日 15:50
  **/
+@Data
 public class Fxry implements Serializable {
 
     private String id;
-
     private String name;
     private String sex;
     private int age;
@@ -31,6 +34,8 @@ public class Fxry implements Serializable {
     private String group;
     /** 详细地址 */
     private String detailAddr;
+    /** 完整户籍地址 ***/
+    private String wzhjdz;
 
 
     /** 身份证隐藏中间几位数字 **/
@@ -38,7 +43,8 @@ public class Fxry implements Serializable {
     /** 省外工作地址 **/
     private String addrOutsideProvince;
     /** 拟返回时间 ***/
-    private Date IntendedReturnTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date intendedReturnTime;
     private String telephone;
     /** 备注 ***/
     private String remark;
@@ -50,190 +56,11 @@ public class Fxry implements Serializable {
     private String updateBy;
 
     /******************* 查询时间 ************************/
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
-    private Date endTime;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getSex() {
-        return sex;
-    }
-
-    public void setSex(String sex) {
-        this.sex = sex;
-    }
-
-    public int getAge() {
-        return age;
-    }
-
-    public void setAge(int age) {
-        this.age = age;
-    }
-
-    public String getIdCard() {
-        return idCard;
-    }
-
-    public void setIdCard(String idCard) {
-        this.idCard = idCard;
-    }
-
-    public Long getVillageTownsId() {
-        return villageTownsId;
-    }
-
-    public void setVillageTownsId(Long villageTownsId) {
-        this.villageTownsId = villageTownsId;
-    }
-
-    public String getVillageTowns() {
-        return villageTowns;
-    }
-
-    public void setVillageTowns(String villageTowns) {
-        this.villageTowns = villageTowns;
-    }
-
-    public Long getVillageId() {
-        return villageId;
-    }
-
-    public void setVillageId(Long villageId) {
-        this.villageId = villageId;
-    }
-
-    public String getVillage() {
-        return village;
-    }
-
-    public void setVillage(String village) {
-        this.village = village;
-    }
-
-    public Long getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(Long groupId) {
-        this.groupId = groupId;
-    }
-
-    public String getGroup() {
-        return group;
-    }
 
-    public void setGroup(String group) {
-        this.group = group;
-    }
-
-    public String getIdCardHide() {
-        return idCardHide;
-    }
-
-    public void setIdCardHide(String idCardHide) {
-        this.idCardHide = idCardHide;
-    }
-
-    public String getAddrOutsideProvince() {
-        return addrOutsideProvince;
-    }
-
-    public void setAddrOutsideProvince(String addrOutsideProvince) {
-        this.addrOutsideProvince = addrOutsideProvince;
-    }
-
-    public Date getIntendedReturnTime() {
-        return IntendedReturnTime;
-    }
-
-    public void setIntendedReturnTime(Date intendedReturnTime) {
-        IntendedReturnTime = intendedReturnTime;
-    }
-
-    public String getTelephone() {
-        return telephone;
-    }
-
-    public void setTelephone(String telephone) {
-        this.telephone = telephone;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getDelete() {
-        return delete;
-    }
-
-    public void setDelete(String delete) {
-        this.delete = delete;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(String createBy) {
-        this.createBy = createBy;
-    }
-
-    public String getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(String updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
 
-    public Date getEndTime() {
-        return endTime;
-    }
 
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
 }

+ 50 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java

@@ -1,5 +1,6 @@
 package com.boman.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.boman.domain.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
@@ -263,6 +264,55 @@ public class VaccineInfoOperation extends BaseEntity {
      */
     private List<Long> deptIdList;
 
+    /** true已认领,false未认领**/
+    private Boolean ryrl;
+
+    private String deleteReason;
+
+
+    /**
+     * 检索开始时间
+     */
+    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private Date startTime;
+
+    /**
+     * 检索结束时间
+     */
+    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private Date endTime;
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getDeleteReason() {
+        return deleteReason;
+    }
+
+    public void setDeleteReason(String deleteReason) {
+        this.deleteReason = deleteReason;
+    }
+
+    public Boolean isRyrl() {
+        return ryrl;
+    }
+
+    public void setRyrl(Boolean ryrl) {
+        this.ryrl = ryrl;
+    }
 
     public List<Long> getDeptIdList() {
         return deptIdList;

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

@@ -1,18 +1,44 @@
 package com.boman.web.core.controller;
 
+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.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
- * @description  常驻人口
  * @author shiqian
+ * @description 常驻人口
  * @date 2022年01月05日 15:39
  **/
 @RestController
 @RequestMapping("/core/czrk")
 public class CzrkController {
 
+    @Autowired
+    private IVaccineInfoService vaccineInfoService;
 
+    /**
+     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/stsByCzrk")
+    public AjaxResult stsByCzrk() {
+        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
+    }
+
+    /**
+     * 功能描述: 删除常住人口
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/deleteCzrk")
+    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
+        return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
+    }
 
 
 }

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/FxryController.java

@@ -33,6 +33,11 @@ public class FxryController extends BaseController {
         return service.add(fxry);
     }
 
+    @GetMapping("/getById/{id}")
+    public AjaxResult getById(@PathVariable String id) {
+        return AjaxResult.success(service.getById(id));
+    }
+
     @PostMapping("/edit")
     public AjaxResult edit(@RequestBody Fxry fxry) {
         return service.edit(fxry);

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

@@ -68,4 +68,15 @@ public class RyrlController extends BaseController {
         return AjaxResult.success("成功", vaccineInfoService.getById(id));
     }
 
+    /**
+     * 功能描述: 小程序   人员认领接口 统计
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/sts")
+    public AjaxResult stsByApplet() {
+        return AjaxResult.success("成功", vaccineInfoService.stsByApplet());
+    }
+
+
 }

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

@@ -16,4 +16,6 @@ public interface FxryMapper{
     int edit(Fxry fxry);
     int delete(@Param("id") String id, @Param("updateBy") String updateBy);
     List<Fxry> list(Fxry fxry);
+
+    Fxry getById(String id);
 }

+ 7 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -1,6 +1,7 @@
 package com.boman.web.core.mapper;
 
 import com.boman.domain.VaccineInfoOperation;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -101,4 +102,10 @@ public interface VaccineInfoMapper
      * @return com.alibaba.fastjson.JSONObject
      */
     VaccineInfoOperation getByIdCard(String idCard);
+
+    int stsByYrl(@Param("deptIdList") List<Long> deptIdList);
+
+    int stsByWrl(@Param("deptIdList") List<Long> deptIdList);
+
+    int deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
 }

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/service/fxry/FxryService.java

@@ -15,4 +15,6 @@ public interface FxryService {
     AjaxResult edit(Fxry fxry);
     AjaxResult delete(String id);
     List<Fxry> list(Fxry fxry);
+
+    Fxry getById(String id);
 }

+ 24 - 0
boman-web-core/src/main/java/com/boman/web/core/service/fxry/FxryServiceImpl.java

@@ -1,6 +1,7 @@
 package com.boman.web.core.service.fxry;
 
 import com.boman.common.core.utils.StringUtils;
+import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
@@ -11,11 +12,14 @@ import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.IdCardUtils;
 import com.boman.web.core.utils.IdUtils;
 import com.github.pagehelper.PageHelper;
+import com.google.common.base.Strings;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.List;
 
+import static com.google.common.base.Strings.nullToEmpty;
+
 /**
  * @author shiqian
  * @date 2022年01月05日 16:18
@@ -23,6 +27,7 @@ import java.util.List;
 @Service
 public class FxryServiceImpl implements FxryService {
 
+    private static final String DEFAULT = "安徽省安庆市潜山市";
     @Resource
     private FxryMapper mapper;
 
@@ -35,6 +40,7 @@ public class FxryServiceImpl implements FxryService {
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setAge(IdCardUtils.getAge(idCard));
         fxry.setId(IdUtils.getMaxId("fxry", "id").toString());
+        packWzhjdz(fxry);
 
         int add = mapper.add(fxry);
         return add > 0 ? AjaxResult.success() : AjaxResult.error();
@@ -45,6 +51,7 @@ public class FxryServiceImpl implements FxryService {
         String hideIdCard = IdCardUtils.hideIdCard(fxry.getIdCard());
         fxry.setIdCardHide(hideIdCard);
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
+        packWzhjdz(fxry);
 
         int edit = mapper.edit(fxry);
         return edit > 0 ? AjaxResult.success() : AjaxResult.error();
@@ -56,6 +63,15 @@ public class FxryServiceImpl implements FxryService {
         return delete > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
+    @Override
+    public Fxry getById(String id) {
+        if (ObjectUtils.isEmpty(id)) {
+            return null;
+        }
+
+        return mapper.getById(id);
+    }
+
     @Override
     public List<Fxry> list(Fxry fxry) {
         PageDomain pageDomain = TableSupport.buildPageRequest();
@@ -70,4 +86,12 @@ public class FxryServiceImpl implements FxryService {
 
         return list;
     }
+
+    private void packWzhjdz(Fxry fxry){
+        if (null == fxry) {
+            return;
+        }
+
+        fxry.setWzhjdz(DEFAULT + nullToEmpty(fxry.getVillageTowns()) + nullToEmpty(fxry.getVillage()) + nullToEmpty(fxry.getGroup()) + nullToEmpty(fxry.getDetailAddr()));
+    }
 }

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

@@ -93,4 +93,10 @@ public interface IVaccineInfoService
     AjaxResult editRlry(VaccineInfoOperation vaccineInfo);
 
     VaccineInfoOperation getById(Long id);
+
+    JSONObject stsByApplet();
+
+    JSONObject stsByCzrk();
+
+    AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
 }

+ 134 - 9
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -10,13 +10,10 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
-import com.boman.domain.SysDept;
-import com.boman.domain.SysRole;
+import com.boman.domain.*;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDictDataService;
-import com.boman.domain.VaccineInfoOperation;
-import com.boman.domain.VaccineInfoUser;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.mapper.VaccineInfoMapper;
 import com.boman.web.core.mapper.VaccineInfoOperationMapper;
@@ -44,6 +41,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import static com.boman.common.core.utils.StringUtils.isNotEmpty;
+import static com.boman.common.core.utils.obj.ObjectUtils.*;
 
 /**
  * 疫苗信息Service业务层处理
@@ -169,7 +167,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 PageHelper.startPage(pageNum, pageSize, orderBy);
             }
 
-            if (deptId != null){
+            if (deptId != null) {
                 List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
                 List<Long> deptIdList = new ArrayList<>();
                 if (sysDepts != null && sysDepts.size() > 0) {
@@ -918,7 +916,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     public AjaxResult statistic() {
         List<SysDept> allTowns = remoteDeptService.getByParentId(1L);
         List<JSONObject> result = new ArrayList<>(allTowns.size());
-        List<String> townNameList = ObjectUtils.map(allTowns, SysDept::getDeptName);
+        List<String> townNameList = map(allTowns, SysDept::getDeptName);
 
         LOGGER.info("开始查询");
         long l = System.currentTimeMillis();
@@ -1051,7 +1049,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             }
         }
 
-        if (deptId != null){
+        if (deptId != null) {
             List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
             List<Long> deptIdList = new ArrayList<>();
             if (sysDepts != null && sysDepts.size() > 0) {
@@ -1066,8 +1064,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         PageDomain pageDomain = TableSupport.buildPageRequest();
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
-        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
-        {
+        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
             String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
             PageHelper.startPage(pageNum, pageSize, orderBy);
         }
@@ -1091,4 +1088,132 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     public VaccineInfoOperation getById(Long id) {
         return vaccineInfoMapper.selectVaccineInfoById(id);
     }
+
+    @Override
+    public JSONObject stsByApplet() {
+        Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
+        //判断是否是管理员
+        List<SysRole> roles = AuthUtils.getLoginUser().getSysUser().getRoles();
+        if (isNotEmpty(roles)) {
+            for (SysRole role : roles) {
+                String roleKey = role.getRoleKey();
+                if ("admin".equals(roleKey) || "city".equals(roleKey)) {
+                    deptId = null;
+                    break;
+                }
+            }
+        }
+
+        List<Long> deptIdList = new ArrayList<>(16);
+        if (deptId != null) {
+            List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
+            if (sysDepts != null && sysDepts.size() > 0) {
+                for (SysDept sysDept : sysDepts) {
+                    Long id = sysDept.getId();
+                    deptIdList.add(id);
+                }
+            }
+        }
+
+        int yrl = vaccineInfoMapper.stsByYrl(deptIdList);
+        int wrl = vaccineInfoMapper.stsByWrl(deptIdList);
+        JSONObject result = new JSONObject(3);
+        result.put("yrl", yrl);
+        result.put("wrl", wrl);
+        result.put("total", wrl + yrl);
+        return result;
+    }
+
+    /**
+     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @Override
+    public JSONObject stsByCzrk() {
+        JSONObject result = new JSONObject(6);
+        // 当前登陆人的deptId
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        String deptName = sysUser.getDept().getDeptName();
+        Long deptId = sysUser.getDeptId();
+        // 当前单位
+        result.put("dqdw", deptName);
+
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        // 市领导
+        if (roleKeySets.contains("city") || roleKeySets.contains("admin")) {
+            List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
+            List<SysDept> townsDepts = filter(allDepts, dept -> 1L == dept.getParentId());
+            result.put("zhen", townsDepts.size()); // 镇
+
+            List<SysDept> cunDepts = new ArrayList<>(16);
+            for (SysDept townsDept : townsDepts) {
+                for (SysDept allDept : allDepts) {
+                    if (townsDept.getId().equals(allDept.getParentId())) {
+                        cunDepts.add(allDept);
+                    }
+                }
+            }
+            result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
+
+            List<SysDept> zuDept = new ArrayList<>(16);
+            for (SysDept cunDept : cunDepts) {
+                for (SysDept allDept : allDepts) {
+                    if (cunDept.getId().equals(allDept.getParentId())) {
+                        zuDept.add(allDept);
+                    }
+                }
+            }
+            result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
+
+            VaccineInfoOperation condition = new VaccineInfoOperation();
+            condition.setStartTime(DateUtils.getTodayStart());
+            condition.setEndTime(DateUtils.getTodayEnd());
+
+//            if (deptId == null) {
+//                deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
+//                //判断是否是管理员
+//                if (isNotEmpty(roles)) {
+//                    for (SysRole role : roles) {
+//                        String roleKey = role.getRoleKey();
+//                        if ("admin".equals(roleKey) || "city".equals(roleKey)) {
+//                            deptId = null;
+//                            break;
+//                        }
+//                    }
+//                }
+//            }
+//
+//            List<Long> deptIdList = new ArrayList<>();
+//            if (deptId != null) {
+//                List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
+//                if (sysDepts != null && sysDepts.size() > 0) {
+//                    for (SysDept sysDept : sysDepts) {
+//                        Long id = sysDept.getId();
+//                        deptIdList.add(id);
+//                    }
+//                }
+//            }
+//            condition.setDeptIdList(deptIdList);
+            List<VaccineInfoOperation> list = vaccineInfoMapper.selectVaccineInfoList(condition);
+
+            result.put("xz", 0);
+            result.put("js", 0);
+        } else if (roleKeySets.contains("sys:town")) {
+            // 镇领导
+
+        }
+//        int village = remoteDeptService.countChildrenByVillage(deptId);
+
+
+        return null;
+    }
+
+    @Override
+    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
+        vaccineInfoOperation.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
+        int delete = vaccineInfoMapper.deleteCzrk(vaccineInfoOperation);
+        return delete > 0 ? AjaxResult.success() : AjaxResult.error();
+    }
 }

+ 33 - 13
boman-web-core/src/main/resources/mapper/FxryMapper.xml

@@ -8,11 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="add">
         INSERT INTO fxry(`id`, `name`, `sex`, `age`, `id_card`, `village_towns_id`, `village_towns`, `village_id`,
                          `village`, `group_id`, `group`, `detail_addr`, `id_card_hide`, `addr_outside_province`,
-                         `intended_return_time`, `telephone`, `remark`, `delete`,
+                         `intended_return_time`, `telephone`, `remark`, `wzhjdz`,
                         `create_time`, `create_by`, `update_time`, `update_by`)
         VALUES (#{id}, #{name}, #{sex}, #{age}, #{idCard}, #{villageTownsId}, #{villageTowns}, #{villageId},
             #{village}, #{groupId}, #{group}, #{detailAddr}, #{idCardHide}, #{addrOutsideProvince},
-            #{IntendedReturnTime}, #{telephone}, #{remark}, #{delete},
+            #{intendedReturnTime}, #{telephone}, #{remark}, #{wzhjdz},
                 SYSDATE(), #{createBy}, SYSDATE(), #{updateBy});
     </insert>
 
@@ -31,10 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
                 <if test="group != null and group != ''">`group` = #{group},</if>
                 <if test="detailAddr != null and detailAddr != ''">detail_addr = #{detailAddr},</if>
+                <if test="wzhjdz != null and wzhjdz != ''">wzhjdz = #{wzhjdz},</if>
                 <if test="idCardHide != null and idCardHide != ''">id_card_hide = #{idCardHide},</if>
                 <if test="addrOutsideProvince != null and addrOutsideProvince != ''">addr_outside_province = #{addrOutsideProvince},</if>
-                <if test="IntendedReturnTime != null and IntendedReturnTime != ''">intended_return_time = #{IntendedReturnTime},</if>
-                <if test="IntendedReturnTime != null and IntendedReturnTime != ''">intended_return_time = #{IntendedReturnTime},</if>
+                <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
+                <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
                 <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
                 <if test="remark != null and remark != ''">remark = #{remark},</if>
                 <if test="delete != null and delete != ''">`delete` = #{delete},</if>
@@ -55,19 +56,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="list" resultType="com.boman.domain.Fxry">
         select id,
                `name`,
-               sex,
-               age,
-               village_towns,
-               village,
-               id_card_hide,
-               addr_outside_province,
-               intended_return_time,
-               telephone
+               telephone,
+               id_card_hide idCard,
+               wzhjdz,
+               addr_outside_province addrOutsideProvince,
+               intended_return_time intendedReturnTime
         from fxry
-        where 1 = 1
+        where `delete` = '否'
         <if test="name != null and name != ''">and `name` like concat('%', #{name}, '%')</if>
         <if test="sex != null and sex != ''">and `sex` like concat('%', #{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>
+        order by create_time desc
+    </select>
+
+    <select id="getById" resultType="com.boman.domain.Fxry">
+        select id,
+               `name`,
+               sex,
+               age,
+               id_card idCard,
+               village_towns_id villageTownsId,
+               village_towns villageTowns,
+               village_id villageId,
+               village,
+               group_id groupId,
+               `group`,
+               detail_addr detailAddr,
+               addr_outside_province addrOutsideProvince,
+               intended_return_time intendedReturnTime,
+               telephone,
+               remark
+        from fxry
+        where id = #{id} limit 1;
     </select>
 </mapper>

+ 52 - 8
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -115,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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
@@ -136,10 +139,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender
         from vaccine_info vi
         <where>
-            vi.is_del = 'N' and
-            (vi.village_towns is null or vi.village_towns = ''
-            <!-- or vi.village is null or vi.village = ''
-            or vi.villager_group is null or vi.villager_group = ''-->)
+            vi.is_del = 'N'
+            <!-- 已认领 -->
+            <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
+            <!-- 未认领 -->
+            <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
 
 
             <if test="houseType != null  and houseType != ''">and vi.house_type = #{houseType}</if>
@@ -154,7 +158,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 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="userName != null  and userName != ''">
+                and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card 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>
@@ -162,9 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="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>
@@ -194,6 +199,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by vi.create_time DESC ,vi.vaccination_time DESC
     </select>
 
+    <select id="stsByYrl" resultType="int">
+        select count(vi.id)
+        from vaccine_info vi
+        where vi.is_del = 'N'
+        <!-- 已认领 -->
+        and (vi.village_towns is not null or vi.village_towns != '')
+        <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="stsByWrl" resultType="int">
+        select count(vi.id)
+        from vaccine_info vi
+        where vi.is_del = 'N'
+        <!-- 未认领 -->
+        and (vi.village_towns is null or vi.village_towns = '')
+        <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>
+
+    <update id="deleteCzrk">
+        update vaccine_info
+        set is_del        = 'Y'
+          , delete_reason = #{deleteReason}
+          , update_by     = #{updateBy}
+          , update_time   = sysdate()
+        where id = #{id}
+    </update>
+
     <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
         select * from vaccine_info limit   #{startNum}, #{endNum}
     </select>
@@ -264,6 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherUrl != null and otherUrl != ''">other_url,</if>
             <if test="age != null and age != ''">age,</if>
             <if test="deptId != null">dept_id,</if>
+            <if test="deleteReason != null">delete_reason,</if>
             create_time
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -308,6 +351,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherUrl != null and otherUrl != ''">#{otherUrl},</if>
             <if test="age != null and age != ''">#{age},</if>
             <if test="deptId != null">#{deptId},</if>
+            <if test="deleteReason != null">#{deleteReason},</if>
             sysdate()
          </trim>
     </insert>