Просмотр исходного кода

fix 修改了查询居住地址导致数据不全的问题

tjf 3 лет назад
Родитель
Сommit
0f2ec36e6e

+ 1 - 10
boman-web-core/src/main/java/com/boman/web/core/controller/TestController.java

@@ -52,7 +52,7 @@ public class TestController {
     /**
      * 对外处理已确认但是丢失了乡镇信息的接口
      */
-    @PostMapping("/lost")
+    //@PostMapping("/lost")
     public AjaxResult lost()
     {
         List<Czrk> czrks = czrkMapper.selectLost();
@@ -657,13 +657,4 @@ 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);
-    }
-
 }

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

@@ -74,6 +74,8 @@ public interface CzrkMapper {
     int deleteCzrk(Czrk czrk);
 
     List<Czrk> listByRlry(Czrk czrk);
+
+    List<Czrk> listByRlryJzdz(Czrk czrk);
     List<Czrk> listByRlryRel(Czrk czrk);
 
     List<Czrk> listByXz(Czrk czrk);

+ 11 - 2
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -181,9 +181,18 @@ public class CzrkServiceImpl implements ICzrkService {
             czrkJzdz.setRegionId(regionId);
             czrkJzdz.setTownId(villageTownsId);
             czrkJzdz.setVillageId(villageId);
+            czrk.setCzrkJzdz(czrkJzdz);
+            //设置查询列表权限
+            setDeptIdList(czrk);
             startPage();
-            List<String> idCardList = czrkJzdzService.listIdCard(czrkJzdz);
-            czrk.setIdCardList(idCardList);
+            long startTimeSql = System.currentTimeMillis();
+            List<Czrk> czrks = czrkMapper.listByRlryJzdz(czrk);
+            long endTimeSql = System.currentTimeMillis() - startTimeSql;
+            log.info("执行查询居住地址的sql语句时间:" + endTimeSql+"ms");
+            packAddr(czrks);
+            return czrks;
+/*            List<String> idCardList = czrkJzdzService.listIdCard(czrkJzdz);
+            czrk.setIdCardList(idCardList);*/
         }
         //设置查询列表权限
         setDeptIdList(czrk);

+ 23 - 0
boman-web-core/src/main/resources/logback.xml

@@ -57,6 +57,29 @@
         </filter>
     </appender>
 
+
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/warn.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>WARN</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
     <!-- 系统模块日志级别控制  -->
 	<logger name="com.boman" level="debug" />
 	<!-- Spring日志级别控制  -->

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

@@ -159,6 +159,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by create_time DESC
     </select>
 
+    <select id="listByRlryJzdz"  resultMap="CzrkResult">
+        select c.id, c.user_name, c.phone_num,c.dept_id, c.id_card, c.gender, c.province, c.city, c.region, c.village_towns, c.village, c.villager_group, c.grid_id
+        , c.house_type, c.update_by, c.code, c.rlr,c.rlr_nike, c.update_time, c.delete_reason, c.now_in,c.is_confirm,c.confirm_info_user,c.confirm_info_nike_user,c.confirm_info_user_time
+        from czrk c left join czrk_jzdz z on c.id =z.czrk_id
+        <where>
+            <!-- 已认领 -->
+            <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}, '%')
+            </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>
+            <if test="gender != null  and gender != ''"> and c.gender = #{gender}</if>
+            <if test="birthday != null "> and c.birthday = #{birthday}</if>
+            <if test="idCard != null  and idCard != ''"> and c.id_card = #{idCard}</if>
+            <if test="phoneNum != null  and phoneNum != ''"> and c.phone_num = #{phoneNum}</if>
+            <if test="code != null  and code != ''"> and c.code = #{code}</if>
+            <if test="houseType != null  and houseType != ''"> and c.house_type = #{houseType}</if>
+            <if test="rlr != null  and rlr != ''"> and c.rlr = #{rlr}</if>
+            <if test="rlTime != null "> and c.rl_time = #{rlTime}</if>
+            <if test="yhzgx != null  and yhzgx != ''"> and c.yhzgx = #{yhzgx}</if>
+            <if test="workUnit != null  and workUnit != ''"> and c.work_unit = #{workUnit}</if>
+            <if test="provinceId != null  and provinceId != ''"> and c.province_id = #{provinceId}</if>
+            <if test="province != null  and province != ''"> and c.province = #{province}</if>
+            <if test="cityId != null  and cityId != ''"> and c.city_id = #{cityId}</if>
+            <if test="city != null  and city != ''"> and c.city = #{city}</if>
+            <if test="regionId != null  and regionId != ''"> and c.region_id = #{regionId}</if>
+            <if test="region != null  and region != ''"> and c.region = #{region}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''"> and c.village_towns_id = #{villageTownsId}</if>
+            <if test="villageTowns != null  and villageTowns != ''"> and c.village_towns = #{villageTowns}</if>
+            <if test="villageId != null  and villageId != ''"> and c.village_id = #{villageId}</if>
+            <if test="village != null  and village != ''"> and c.village = #{village}</if>
+            <!--    <if test="villagerGroupId != null  and villagerGroupId != ''"> and villager_group_id = #{villagerGroupId}</if>
+                <if test="villagerGroup != null  and villagerGroup != ''"> and villager_group = #{villagerGroup}</if>-->
+            <if test="nowIn != null  and nowIn != ''"> and c.now_in = #{nowIn}</if>
+            <if test="status != null  and status != ''"> and c.status = #{status}</if>
+            <if test="isConfirm != null  and isConfirm != ''"> and c.is_confirm = #{isConfirm}</if>
+            <if test="isDel != null  and isDel != ''"> and c.is_del = #{isDel}</if>
+            <if test="deleteReason != null  and deleteReason != ''"> and c.delete_reason = #{deleteReason}</if>
+            <if test="gridId != null  and gridId != ''"> and c.grid_id = #{gridId}</if>
+            <if test="deptIdList != null and deptIdList.size() > 0">
+                and c.dept_id in
+                <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                    #{deptId}
+                </foreach>
+            </if>
+            <if test="idCardList != null and idCardList.size() > 0">
+                and c.id_card in
+                <foreach item="idCard" collection="idCardList" open="(" separator="," close=")">
+                    #{idCard}
+                </foreach>
+            </if>
+            <if test="czrkJzdz.provinceId != null"> and z.province_id = #{czrkJzdz.provinceId}</if>
+            <if test="czrkJzdz.cityId != null"> and z.city_id = #{czrkJzdz.cityId}</if>
+            <if test="czrkJzdz.regionId != null"> and z.region_id = #{czrkJzdz.regionId}</if>
+            <if test="czrkJzdz.townId != null"> and z.town_id = #{czrkJzdz.townId}</if>
+            <if test="czrkJzdz.villageId != null"> and z.village_id = #{czrkJzdz.villageId}</if>
+
+        </where>
+        order by c.create_time DESC
+    </select>
+
     <select id="listByRlryRel"  resultType="com.boman.domain.Czrk">
         SELECT
             czrk.id,