zhongrj
2024-01-08 c55696bd670be71757e48c584d978cc6059fd103
场所维护,场所查询修改
4 files modified
61 ■■■■ changed files
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml 29 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml 23 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -364,7 +364,8 @@
        select
            jh.id,jh.house_code,jh.name,jh.phone_number,jh.associated_user_id,
            jh.role_type,jh.associated_user_name,jh.relationship,jh.is_primary_contact,
            jh.residential_status,jh.gender,jh.birthday,jh.id_card,jh.card_type,jh.hkmt_pass,jh.passport,
            jh.residential_status,jh.gender,jh.birthday,jh.id_card,
            jh.card_type,jh.card_no,jh.hkmt_pass,jh.passport,
            jh.ethnicity,jh.education,jh.resident_type,
            jh.hukou_registration,jh.resident_adcode,jh.native_place_adcode,
            jh.religious_belief,jh.health_status,jh.disease_name,
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
@@ -24,11 +24,13 @@
        WHERE
        jpe.is_deleted = 0
        <if test="placeExt.communityCode != null and placeExt.communityCode != ''">
            and jg.community_code=#{placeExt.communityCode}
            and jg.community_code like concat('%',#{placeExt.communityCode},'%')
        </if>
        <if test="placeExt.placeName != null and placeExt.placeName != ''">
            and jp.place_name like concat('%',#{placeExt.placeName},'%')
        </if>
        <if test="placeExt.placeId != null">
            and jp.id = #{placeExt.placeId}
        </if>
        <if test="placeExt.houseCode != null and placeExt.houseCode != ''">
            and jp.house_code = #{placeExt.houseCode}
@@ -39,24 +41,11 @@
        <if test="placeExt.startTime != null and placeExt.startTime != '' and placeExt.endTime != null and placeExt.endTime != '' ">
            AND jpe.create_time BETWEEN #{placeExt.startTime} and #{placeExt.endTime}
        </if>
        <if test="placeExt.roleName!=null and placeExt.roleName!='' and placeExt.createUser!=null">
            <choose>
                <when test="placeExt.roleName=='网格员'">
                    and
                    (
                    jp.create_user = #{placeExt.createUser}
                    <if test="houseCodeList != null and houseCodeList.size()>0">
                        or jp.house_code in
                        <foreach collection="houseCodeList" item="houseCode" separator="," open="(" close=")">
                            #{houseCode}
                        </foreach>
                    </if>
                    )
                </when>
                <otherwise>
                    and jp.principal_user_id = #{placeExt.createUser}
                </otherwise>
            </choose>
        <if test="houseCodeList != null and houseCodeList.size()>0">
            and jp.house_code in
            <foreach collection="houseCodeList" item="houseCode" separator="," open="(" close=")">
                #{houseCode}
            </foreach>
        </if>
        order by jpe.create_time desc,jpe.id desc
    </select>
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -34,24 +34,11 @@
        ) b on a.id = b.id
        ) jppl on jppl.place_id = jp.id
        where jp.is_deleted = 0 and jp.source!=3
        <if test="place.roleName!=null and place.roleName!='' and place.createUser!=null">
            <choose>
                <when test="place.roleName=='网格员'">
                    and
                    (
                    jp.create_user = #{place.createUser}
                    <if test="houseCodeList != null and houseCodeList.size()>0">
                        or jp.house_code in
                        <foreach collection="houseCodeList" item="houseCode" separator ="," open="("  close=")">
                            #{houseCode}
                        </foreach>
                    </if>
                    )
                </when>
                <otherwise>
                    and jp.principal_user_id = #{place.createUser}
                </otherwise>
            </choose>
        <if test="houseCodeList != null and houseCodeList.size()>0">
            and jp.house_code in
            <foreach collection="houseCodeList" item="houseCode" separator ="," open="("  close=")">
                #{houseCode}
            </foreach>
        </if>
        <if test="place.placeName!=null and place.placeName!=''">
            and jp.place_name like concat('%',#{place.placeName},'%')
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -108,10 +108,6 @@
            if (place.getRoleName().equals("网格员")){
                // 查询对应的房屋地址code
                list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
                place.setCreateUser(AuthUtil.getUserId());
            }
            if (!place.getRoleName().equals("系统管理员")){
                place.setCreateUser(AuthUtil.getUserId());
            }
        }
        List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, place, list);
@@ -121,8 +117,6 @@
            GridVO gridVO = gridService.getGridDetailByHouseCode(placeVO.getHouseCode());
            if (null!= gridVO){
                placeVO.setGridName(gridVO.getGridName());
//                placeVO.setNeiName(gridVO.getCommunityName());
//                placeVO.setTownStreetName(gridVO.getTownStreetName());
            }
        }
        // 返回