linwe
2024-07-29 aeb7d068be92312dcdcea75e1240bcf2a78dd0fe
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
@@ -434,4 +434,423 @@
    </select>
    <select id="orgStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
        SELECT
            br.region_level,
            br.`code` regionCode,
            br.NAME regionName,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '24'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number1,(
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '25'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number2,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '26'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number3,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '27'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number4,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '28'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number5
        FROM
            `blade_region` br
        WHERE
            br.region_level = 4
          AND br.city_code = 361100
    </select>
    <select id="unitedFrontStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
        SELECT
            br.region_level,
            br.`code` regionCode,
            br.NAME regionName,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1041'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number1,(
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1042'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number2,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1043'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number3,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1044'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number4,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1045'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number5,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1046'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number6,(
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1047'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number7,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1048'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number8,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1049'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number9,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1050'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number10,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1051'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number11,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1052'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number12
        FROM
            `blade_region` br
        WHERE
            br.region_level = 4
          AND br.city_code = 361100
    </select>
    <select id="followStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
        SELECT
            br.region_level,
            br.`code` regionCode,
            br.NAME regionName,
            (
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '1033'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number1,(
                SELECT
                    count( 1 )
                FROM
                    jczz_user_house_label juhl
                        LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
                WHERE
                    juhl.lable_type = 1
                  AND jl.id = '15'
                  AND juhl.household_id IS NOT NULL
                  AND juhl.house_code IN (
                    SELECT
                        jgr.house_code
                    FROM
                        jczz_grid jg
                            LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
                            LEFT JOIN  jczz_community jc on  jc.`code` = jg.community_code
                    WHERE
                        br.`code` = jc.`street_code`
                )) number2
        FROM
            `blade_region` br
        WHERE
            br.region_level = 4
          AND br.city_code = 361100
    </select>
</mapper>