Browse Source

fix 人员信息中 查看常驻人口信息和查看户籍信息列表接口

tjf 3 năm trước cách đây
mục cha
commit
de4404984b

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

@@ -25,6 +25,7 @@ public interface CzrkMapper {
      * @return 常住人口
      */
     Czrk selectCzrkById(Long id);
+    List<Czrk> selectCzrkByIds(@Param("ids") List<Long> ids);
     int countIdCard(String idCard);
 
     /**
@@ -61,12 +62,7 @@ public interface CzrkMapper {
 
     int reduction(String id);
 
-    /**
-     * 批量删除常住人口
-     *
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
+
 //    int deleteCzrk(Long[] ids);
     int deleteCzrk(Czrk czrk);
 

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

@@ -33,6 +33,7 @@ import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.tomcat.util.buf.HexUtils;
+import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
@@ -139,9 +140,17 @@ public class CzrkServiceImpl implements ICzrkService {
                 czrkJzdz.setTownId(villageTownsId);
                 czrkJzdz.setVillageId(villageId);
             }
+            //todo 需要单独写个接口
             //先去查询居住地址在潜山的人员身份证
             startPage();
-            List<CzrkJzdz> czrkJzdzs = czrkJzdzService.selectCzrkJzdzList(czrkJzdz);
+            czrks = czrkMapper.selectCzrkList(czrk);
+            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());
+                    crk.setNowInSelect(provinceCz + cityCz + regionCz + villageTownsCz + villageCz + nowInCz);
+                }
+            }
+/*            List<CzrkJzdz> czrkJzdzs = czrkJzdzService.selectCzrkJzdzList(czrkJzdz);
             List<String> idCardList = new ArrayList<>();
             if (czrkJzdzs != null && czrkJzdzs.size() > 0) {
                 for (CzrkJzdz jzdz : czrkJzdzs) {
@@ -153,7 +162,7 @@ public class CzrkServiceImpl implements ICzrkService {
                 czrk.setIdCardList(idCardList);
                 czrks = czrkMapper.listByRlry(czrk);
                 handleList(czrks, Czrk.HJ, czrkJzdzs);
-            }
+            }*/
             return czrks;
         }
         if (null == provinceId && null == cityId && null == regionId && null == villageTownsId && null == villageId) {

+ 76 - 1
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -362,7 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="listByCode" resultMap="CzrkResult">
-        select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
+        select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region,vi.village_towns,vi.village,vi.villager_group, vi.now_in
         , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
         from czrk vi
         <!--把户主放第一位-->
@@ -518,6 +518,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id} limit 1
     </select>
 
+
+    <select id="selectCzrkByIds" parameterType="list" resultMap="CzrkResult">
+        <include refid="selectCzrkVo"/>
+        <if test="ids != null  and ids.size() > 0">
+            where id in
+            <foreach item="id" collection="ids" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+    </select>
+
     <select id="countIdCard" resultType="int">
         select count(vi.id) from czrk vi where vi.is_del = 'N' and id_card = #{idCard}
     </select>
@@ -966,4 +977,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             sysdate()
         </trim>
     </insert>
+
+
+
+    <select id="selectCzrkList"  resultMap="CzrkResult">
+        select c.id,c.user_name,c.id_card,z.province_id, z.province, z.city_id, z.city, z.region_id, z.region, z.town_id as village_towns_id, z.town as village_towns, z.village_id, z.village, z.now_in,c.phone_num,c.house_type,c.rlr,c.confirm_info_user,c.confirm_info_user_time
+        from czrk_jzdz z left join czrk c 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}, '%') 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>
+            <if test="gender != null  and gender != ''"> and c.gender = #{gender}</if>
+            <if test="age != null "> and c.age = #{age}</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="provinceIdXjd != null "> and z.province_id = #{provinceIdXjd}</if>
+            <if test="cityIdXjd != null "> and z.city_id = #{cityIdXjd}</if>
+            <if test="regionIdXjd != null "> and z.region_id = #{regionIdXjd}</if>
+            <if test="villageTownsIdXjd != null "> and z.town_id = #{villageTownsIdXjd}</if>
+            <if test="villageIdXjd != null "> and z.village_id = #{villageIdXjd}</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>
+        </where>
+        order by c.create_time DESC
+    </select>
 </mapper>