linwei
2024-01-12 87c81cb045fb89a74901613405e6c4ccf4bd03bd
住户+居民管理
4 files modified
59 ■■■■ changed files
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml 26 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/vo/HouseVO.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -141,7 +141,7 @@
        left join jczz_grid_range jgr on jgr.house_code = jh.house_code
        left join jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        left join blade_region br on br.code = jg.community_code
        where jh.is_deleted = 0
        <where>
        <if test="house.id != null ">and jh.id = #{house.id}</if>
        <if test="house.streetCode != null and house.streetCode != ''">
            and jda.town_street_code like concat('%',#{house.streetCode},'%')
@@ -174,6 +174,30 @@
        <if test="house.regionCode != null and house.regionCode !='' ">
            and jg.community_code like concat('%',#{house.regionCode},'%')
        </if>
            <if test="house.parentId != null ">
                and jh.house_code in (
                SELECT DISTINCT
                juhl.house_code
                FROM
                jczz_user_house_label juhl
                LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                juhl.lable_type = 2
                <if test="house.labelId != null ">
                    AND jl.id = #{house.labelId}
                </if>
                <if test="house.parentId != null ">
                    AND jl.parent_id = #{house.parentId}
                </if>
                AND juhl.label_id IS NOT NULL
                )
            </if>
            and jh.is_deleted = 0
            ORDER BY
            jh.update_time DESC
        </where>
    </select>
    <!--房屋自定义详情查询-->
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -828,17 +828,20 @@
            <if test="household.aoiCode!=null and household.aoiCode!=''">
                and jhs.district_code = #{household.aoiCode}
            </if>
            AND EXISTS (
            SELECT
            *
            and jh.id in (
            SELECT DISTINCT
            juhl.household_id
            FROM
            jczz_user_house_label juhl
            LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
            WHERE
            juhl.lable_type = 1
            <if test="household.labelId != null ">
            AND jl.id = #{household.labelId}
            </if>
            <if test="household.parentId != null ">
            AND jl.parent_id = #{household.parentId}
            AND juhl.household_id = jh.id
            </if>
            AND juhl.label_id IS NOT NULL
            )
            and jh.is_deleted = 0
@@ -854,7 +857,8 @@
        and juhl.lable_type = 1
        and juhl.color = '#30D17C'
        and jh.id in (
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=30
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
        create_time )=30
        )
        <choose>
            <when test="list!=null and list.size()>0">
@@ -875,7 +879,8 @@
        and juhl.lable_type = 1
        and juhl.color = '#FFB42B'
        and jh.id in (
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=14
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
        create_time )=14
        )
        <choose>
            <when test="list!=null and list.size()>0">
@@ -897,7 +902,8 @@
        and juhl.lable_type = 1
        and juhl.color = '#EA1F1F'
        and jh.id in (
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=7
        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
        create_time )=7
        )
        <choose>
            <when test="list!=null and list.size()>0">
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
@@ -299,8 +299,7 @@
FROM
    `jczz_community` jc
WHERE
    jc.street_code = #{householdLabel.regionCode}
           jc.code like concat(#{householdLabel.regionCode},'%')
    </select>
src/main/java/org/springblade/modules/house/vo/HouseVO.java
@@ -16,9 +16,9 @@
 */
package org.springblade.modules.house.vo;
import org.springblade.modules.house.entity.HouseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.house.entity.HouseEntity;
import java.util.ArrayList;
import java.util.List;
@@ -65,5 +65,13 @@
     */
    private String regionCode;
    /**
     * 标签id
     */
    private Integer labelId;
    //    标签父级id
    private Integer parentId;
    private List<UserHouseLabelVO> userHouseLabelVOList = new ArrayList<>();
}