Prechádzať zdrojové kódy

fix 新增了拦截器,计算列表接口时间,新增了处理户籍消失的调用接口,修改了姓名查询

tjf 3 rokov pred
rodič
commit
3242f8464b

+ 27 - 3
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/DateUtils.java

@@ -88,9 +88,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return dateTime(calendar.getTime());
     }
 
-    public static void main(String[] args) {
-        System.out.println(setHmsZero(new Date()));
-    }
 
 
     /**
@@ -471,4 +468,31 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         weeks.add(startTimeDate);
         return weeks;
     }
+
+    /**
+     * 根据日期计算年龄
+     * @param birthDay
+     * @return
+     * @throws Exception
+     */
+    public static  int getAge(Date birthDay) throws Exception {
+        Calendar cal = Calendar.getInstance();
+        if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
+            throw new IllegalArgumentException(
+                    "The birthDay is before Now.It's unbelievable!");
+        }
+        int yearNow = cal.get(Calendar.YEAR);  //当前年份
+        int monthNow = cal.get(Calendar.MONTH);  //当前月份
+        int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
+        cal.setTime(birthDay);
+        int yearBirth = cal.get(Calendar.YEAR);
+        int monthBirth = cal.get(Calendar.MONTH);
+        int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
+        int age = yearNow - yearBirth;   //计算整岁数
+        if (monthNow <= monthBirth) {
+            if (monthNow == monthBirth) {
+                if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
+            }else{
+                age--;//当前月份在生日之前,年龄减一
+            } } return age; }
 }

+ 93 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/TestController.java

@@ -48,6 +48,90 @@ public class TestController {
     @Autowired
     private CzrkJzdzMapper czrkJzdzMapper;
 
+
+    /**
+     * 对外处理已确认但是丢失了乡镇信息的接口
+     */
+    @PostMapping("/lost")
+    public AjaxResult lost()
+    {
+        List<Czrk> czrks = czrkMapper.selectLost();
+        if (czrks != null && czrks.size() > 0){
+            for (Czrk czrk : czrks) {
+                if (czrk != null){
+                    String nowIn = czrk.getNowIn();
+                    if (com.boman.common.core.utils.StringUtils.isNotBlank(nowIn)){
+                        czrk.setProvince("安徽省");
+                        czrk.setProvinceId(12L);
+                        czrk.setCity("安庆市");
+                        czrk.setCityId(340800000000L);
+                        czrk.setRegionId(340882000000L);
+                        czrk.setRegion("潜山市");
+                        //判断有没有详细地址
+                        if (nowIn.contains("梅城镇")){
+                            czrk.setVillageTowns("梅城镇");
+                            czrk.setVillageTownsId(340882100000L);
+                        }else {
+                            Map<String, String> addressResolutionMap = addressResolutionMap(nowIn);
+                            System.out.println(addressResolutionMap);
+                            if (addressResolutionMap != null){
+                                String town = addressResolutionMap.get("town");
+                                //去china_area表中查询对应数据
+                                List<SysRegion> sysRegions = sysRegionMapper.selectSysRegionByNameLike(town);
+                                if (sysRegions.size() == 1) {
+                                    SysRegion sysRegion = sysRegions.get(0);
+                                    if (sysRegion != null) {
+                                        czrk.setVillageTowns(sysRegion.getName());
+                                        czrk.setVillageTownsId(sysRegion.getAreaId());
+                                    }
+                                } else if (sysRegions.size() > 1) {
+                                    for (SysRegion sysRegion : sysRegions) {
+                                        if (sysRegion != null) {
+                                            Long pid = sysRegion.getPid();
+                                            Long regionId = czrk.getRegionId();
+                                            if (regionId != null && regionId.equals(pid)) {
+                                                //说明是这个镇
+                                                czrk.setVillageTowns(sysRegion.getName());
+                                                czrk.setVillageTownsId(sysRegion.getAreaId());
+                                            }
+                                        }
+                                    }
+                                }
+                                String village = addressResolutionMap.get("village");
+                                if (StringUtils.isNotBlank(village)){
+                                    //去china_area表中查询对应数据
+                                    List<SysRegion> sysRegionsVillage = sysRegionMapper.selectSysRegionByNameLike(village);
+                                    if (sysRegionsVillage.size() == 1) {
+                                        SysRegion sysRegion = sysRegionsVillage.get(0);
+                                        if (sysRegion != null) {
+                                            czrk.setVillage(sysRegion.getName());
+                                            czrk.setVillageId(sysRegion.getAreaId());
+                                        }
+                                    } else if (sysRegionsVillage.size() > 1) {
+                                        for (SysRegion sysRegion : sysRegionsVillage) {
+                                            if (sysRegion != null) {
+                                                Long pid = sysRegion.getPid();
+                                                Long villageTownsId = czrk.getVillageTownsId();
+                                                if (villageTownsId != null && villageTownsId.equals(pid)) {
+                                                    //说明是这个镇下面的村
+                                                    czrk.setVillage(sysRegion.getName());
+                                                    czrk.setVillageId(sysRegion.getAreaId());
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        czrkMapper.updateCzrk(czrk);
+                        System.out.println("更新了:"+czrk.getIdCard());
+                    }
+                }
+            }
+        }
+        return AjaxResult.success();
+    }
+
     @GetMapping("/handleData")
     public AjaxResult handleData() {
         List<VaccineInfoOperation> list = mapper.handleData();
@@ -573,4 +657,13 @@ public class TestController {
         return row;
     }
 
+    public static void main(String[] args) {
+        Map<String, String> addressResolutionMap = addressResolutionMap("梅城镇潜阳路288号全力阳光城4幢3单元601室");
+        String a = "梅城镇潜阳路288号全力阳光城4幢3单元601室";
+        if (a.contains("梅城镇")){
+            System.out.println(a);
+        }
+        System.out.println(addressResolutionMap);
+    }
+
 }

+ 62 - 0
boman-web-core/src/main/java/com/boman/web/core/interceptor/ControllerTimeInterceptor.java

@@ -0,0 +1,62 @@
+package com.boman.web.core.interceptor;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**拦截器计算接口用时
+ * @author tjf
+ * @Date: 2022/03/20/16:42
+ */
+@Component
+public class ControllerTimeInterceptor implements HandlerInterceptor {
+
+    private static final Logger LOGGER  = LoggerFactory.getLogger(ControllerTimeInterceptor.class);
+
+    @Override
+    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
+        String url = httpServletRequest.getRequestURL().toString();
+        long start = System.currentTimeMillis();
+        httpServletRequest.setAttribute("start", start);
+        StringBuilder sb = new StringBuilder();
+        sb .append("【开始请求】:\n-------------------------------------------------------------\n");
+        HandlerMethod h = (HandlerMethod) o;
+        sb.append("Controller: ").append(h.getBean().getClass().getName()).append("\n");
+        sb.append("URL       : ").append(url).append("\n");
+        sb .append("-------------------------------------------------------------\n");
+        LOGGER.info(sb.toString());
+        // 填入当前接口的调用开始时间
+        httpServletRequest.setAttribute("startTime",System.currentTimeMillis());
+        return true;
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
+        String url = httpServletRequest.getRequestURL().toString();
+        Long startTime=(Long)httpServletRequest.getAttribute("startTime");
+        Long expireTime=System.currentTimeMillis()-startTime;
+        StringBuilder sb = new StringBuilder();
+        sb .append("【结束请求】:\n-------------------------------------------------------------\n");
+        HandlerMethod h = (HandlerMethod) o;
+        sb.append("Controller: ").append(h.getBean().getClass().getName()).append("\n");
+        sb.append("URL       : ").append(url).append("\n");
+        sb.append("EXPIRETIME耗时: ").append(expireTime).append("(ms)\n");
+        sb .append("-------------------------------------------------------------\n");
+        //判断接口时间
+        if (expireTime > 2000L){
+            LOGGER.warn(sb.toString(),"接口时间大于2秒");
+        }else {
+            LOGGER.info(sb.toString());
+        }
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
+    }
+}

+ 22 - 0
boman-web-core/src/main/java/com/boman/web/core/interceptor/InterceptorConfig.java

@@ -0,0 +1,22 @@
+package com.boman.web.core.interceptor;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**拦截器的注册
+ * @author tjf
+ * @Date: 2022/03/20/17:14
+ */
+@Configuration
+public class InterceptorConfig implements WebMvcConfigurer {
+
+    @Override
+    public void addInterceptors(InterceptorRegistry interceptorRegistry) {
+        InterceptorRegistration registration=interceptorRegistry.addInterceptor(new ControllerTimeInterceptor());
+        // 此处添加拦截策略 /**表示全部拦截
+        registration.addPathPatterns("/core/ryrl/**");
+    }
+
+}

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

@@ -166,4 +166,6 @@ public interface CzrkMapper {
      * @return
      */
     Czrk selectCzrkByIdCard(String code);
+
+    List<Czrk> selectLost();
 }

+ 25 - 6
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -47,11 +47,11 @@ import javax.annotation.Resource;
 import javax.validation.constraints.Size;
 import java.sql.Date;
 import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
+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.fieldTranslator.IdCardUtils.getSex;
@@ -100,10 +100,9 @@ public class CzrkServiceImpl implements ICzrkService {
      */
     @Override
     public List<Czrk> listByRlry(Czrk czrk) {
+        long startTime = System.currentTimeMillis();
         log.info("{}于{}查询常住人员列表,查询条件:{}"
                 , AuthUtils.getLoginUser().getSysUser().getUserName(), DateUtils.dateTimeNow(), JSON.toJSONString(czrk));
-        //设置查询列表权限
-        setDeptIdList(czrk);
         setAgeScope(czrk);
         //获取到居住地的查询条件
         Long provinceId = czrk.getProvinceIdXjd();
@@ -148,7 +147,10 @@ public class CzrkServiceImpl implements ICzrkService {
             //todo 需要单独写个接口
             //先去查询居住地址在潜山的人员身份证
             startPage();
+            long startTimeSql = System.currentTimeMillis();
             czrks = czrkMapper.selectCzrkList(czrk);
+            long endTimeSql = System.currentTimeMillis() - startTimeSql;
+            log.info("执行常驻查询sql语句时间:" + endTimeSql+"ms");
             if (czrks != null && czrks.size() > 0) {
                 for (Czrk crk : czrks) {
                     String provinceCz = nullToEmpty(crk.getProvince()), cityCz = nullToEmpty(crk.getCity()), regionCz = nullToEmpty(crk.getRegion()), villageTownsCz = nullToEmpty(crk.getVillageTowns()), villageCz = nullToEmpty(crk.getVillage()), nowInCz = nullToEmpty(crk.getNowIn());
@@ -183,8 +185,13 @@ public class CzrkServiceImpl implements ICzrkService {
             List<String> idCardList = czrkJzdzService.listIdCard(czrkJzdz);
             czrk.setIdCardList(idCardList);
         }
+        //设置查询列表权限
+        setDeptIdList(czrk);
         startPage();
+        long startTimeSql = System.currentTimeMillis();
         List<Czrk> czrks = czrkMapper.listByRlry(czrk);
+        long endTimeSql = System.currentTimeMillis() - startTimeSql;
+        log.info("执行查询sql语句时间:" + endTimeSql+"ms");
         packAddr(czrks);
         return czrks;
     }
@@ -579,6 +586,18 @@ public class CzrkServiceImpl implements ICzrkService {
 
         List<CzrkJzdz> czrkJzdzList = czrkJzdzService.listByIdCard(Collections.singletonList(czrk.getIdCard()));
         czrk.setCzrkJzdzList(czrkJzdzList);
+        //todo 重新计算年龄
+        String birthday = czrk.getBirthday();
+        if (StringUtils.isNotBlank(birthday)){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            int age = czrk.getAge();
+            try {
+                age = DateUtils.getAge(sdf.parse(birthday));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            czrk.setAge(age);
+        }
         return czrk;
     }
 

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

@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="czrkId != null "> and czrk_id = #{czrkId}</if>
             <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat( #{userName}, '%')</if>
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="provinceId != null  and provinceId != ''"> and province_id = #{provinceId}</if>
@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="czrkId != null "> and czrk_id = #{czrkId}</if>
             <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat( #{userName}, '%')</if>
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="provinceId != null  and provinceId != ''"> and province_id = #{provinceId}</if>
@@ -273,7 +273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN czrk_jzdz jzdz ON czrk.id = jzdz.czrk_id
         where czrk.is_del = 'N'
         <if test="userName != null  and userName != ''">
-            and jzdz.user_name like concat('%', #{userName}, '%')
+            and jzdz.user_name like concat( #{userName}, '%')
         </if>
         <choose>
             <when test="type == 1">and jzdz.province_id = #{areaId}</when>

+ 18 - 13
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, user_name, gender, age, birthday,dept_id, id_card, phone_num, code, house_type, rlr,rlr_nike, rl_time, yhzgx
              , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns
              , village_id, village, villager_group_id, villager_group, now_in, remark,grid_id, status,is_confirm,confirm_info_user,confirm_info_nike_user,confirm_info_user_time, create_by, create_time
-             , update_by, update_time, is_del, delete_reason, dept_id, is_rl, key_industries from czrk
+             , update_by, update_time, is_del, delete_reason,  is_rl, key_industries from czrk
     </sql>
 
     <select id="listByRlry"  resultMap="CzrkResult">
@@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRl != null and isRl != ''">and is_rl = #{isRl}</if>
 
             <if test="userName != null  and userName != ''">
-                and user_name like concat('%', #{userName}, '%')
+                and user_name like concat(#{userName}, '%')
             </if>
             <if test="params.startAge != null  and params.startAge != ''">and age &gt;= #{params.startAge}</if>
             <if test="params.endAge != null  and params.endAge != ''">and age &lt;= #{params.endAge}</if>
@@ -191,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRl != null and isRl != ''">and czrk.is_rl = #{isRl}</if>
 
             <if test="userName != null  and userName != ''">
-                and (czrk.user_name like concat('%', #{userName}, '%') or czrk.id_card like concat('%', #{userName}, '%'))
+                and (czrk.user_name like concat(#{userName}, '%') or czrk.id_card like concat( #{userName}, '%'))
             </if>
             <if test="params.startAge != null  and params.startAge != ''">and czrk.age &gt;= #{params.startAge}</if>
             <if test="params.endAge != null  and params.endAge != ''">and czrk.age &lt;= #{params.endAge}</if>
@@ -247,7 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from czrk vi
         where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+            and (vi.user_name like concat( #{userName}, '%') or vi.id_card like concat( #{userName}, '%'))
         </if>
         <if test="villageTowns != null  and villageTowns != ''">
             and vi.village_towns = #{villageTowns}
@@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="city != null  and city != ''"> and vi.city = #{city}</if>
         <if test="region != null  and region != ''"> and vi.region = #{region}</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="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="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>-->
@@ -310,7 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from czrk vi
         where vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+            and (vi.user_name like concat(#{userName}, '%') or vi.id_card like concat(#{userName}, '%'))
         </if>
         <if test="villageTowns != null  and villageTowns != ''">
             and vi.village_towns = #{villageTowns}
@@ -321,9 +321,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="province != null  and province != ''"> and vi.province = #{province}</if>
         <if test="city != null  and city != ''"> and vi.city = #{city}</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}, '%')</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="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="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>-->
@@ -547,7 +547,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 已认领 -->
         and vi.is_rl = '是'
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+            and (vi.user_name like concat(#{userName}, '%') or vi.id_card like concat(#{userName}, '%'))
         </if>
         <if test="houseType != null  and houseType != ''">
             and vi.house_type = #{houseType}
@@ -569,7 +569,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from czrk
         where is_del = 'N'
         <if test="userName != null  and userName != ''">
-            and user_name like concat('%', #{userName}, '%')
+            and user_name like concat(#{userName}, '%')
         </if>
         <choose>
             <when test="type == 1">and province_id = #{areaId}</when>
@@ -599,7 +599,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 未认领 -->
         and vi.is_rl = '否'
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+            and (vi.user_name like concat(#{userName}, '%') or vi.id_card like concat(#{userName}, '%'))
         </if>
         <if test="houseType != null  and houseType != ''">
             and vi.house_type = #{houseType}
@@ -819,7 +819,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             czrk.is_del = 'N' and jzdz.status = 'Y'
             <if test="userName != null  and userName != ''">
-                and (czrk.user_name like concat('%', #{userName}, '%') or czrk.id_card like concat('%', #{userName}, '%'))
+                and (czrk.user_name like concat(#{userName}, '%') or czrk.id_card like concat(#{userName}, '%'))
             </if>
             <if test="houseType != null  and houseType != ''">
                 and czrk.house_type = #{houseType}
@@ -1000,7 +1000,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
 
             <if test="userName != null  and userName != ''">
-                and (c.user_name like concat('%', #{userName}, '%') or c.id_card like concat('%', #{userName}, '%'))
+                and (c.user_name like concat(#{userName}, '%') or c.id_card like concat(#{userName}, '%'))
             </if>
             <if test="params.startAge != null  and params.startAge != ''">and c.age &gt;= #{params.startAge}</if>
             <if test="params.endAge != null  and params.endAge != ''">and c.age &lt;= #{params.endAge}</if>
@@ -1075,4 +1075,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCzrkVo"/>
         where is_del = 'N' and id_card = #{idCard} limit 1;
     </select>
+
+    <select id="selectLost"  resultMap="CzrkResult">
+        <include refid="selectCzrkVo"/>
+        where is_confirm = 'Y' and (village_towns is null or village_towns = '') and is_del ='N'
+    </select>
 </mapper>