lin
2024-04-01 03fef57e7e061148a5ced5c83f79c61a68f2ffa3
src/main/java/org/springblade/modules/discuss/mapper/UserTopicsMapper.xml
@@ -190,7 +190,10 @@
        jhs.remark,
        jda.address_code houseCode,
        jda.aoi_name,
        jt.option_content
        jt.option_content,
        jhs.building,
        jhs.room,
        jhs.district_name
        FROM
        jczz_user_topics as jut
        LEFT JOIN jczz_household jh ON jh.id = jut.household_id and jh.is_deleted = 0
@@ -199,6 +202,7 @@
        LEFT JOIN blade_user bu ON jh.associated_user_id = bu.id AND bu.is_deleted = 0
        LEFT JOIN jczz_house jhs on jhs.house_code= jda.address_code
        <where>
            and jt.discuss_content = '候选人'
            <if test="id != null ">and jut.id = #{id}</if>
            <if test="name != null and name != ''">
                and bu.name like concat('%',#{name},'%')
@@ -226,29 +230,34 @@
        </where>
    </select>
    <select id="getHouseholdList" resultType="org.springblade.modules.discuss.excel.householdExcel">
    <select id="getHouseholdList" resultType="org.springblade.modules.discuss.excel.holdExcel">
        SELECT
        DISTINCT(jh.id),
        jh.*,
        jh.room,
        jh.building,
        jh.house_name,
        jh.district_name,
        (
        SELECT
        group_concat( jt.option_content ) AS optionContent
        group_concat( jt.id ) AS optionContent
        FROM
        jczz_user_topics jut
        LEFT JOIN jczz_topics jt ON jt.id = jut.topics_id
        WHERE
        jut.house_code = jh.house_code
        AND jut.article_id = #{articleId}
        ) selectd
        ) optionContent,
        (SELECT jhd.name from jczz_household jhd where  jhd.house_code = jh.house_code AND jhd.is_deleted = 0 and jhd.relationship = 1 limit 1 ) name,
        (SELECT jhd.phone_number from jczz_household jhd where  jhd.house_code = jh.house_code AND jhd.is_deleted = 0 and jhd.relationship = 1 limit 1 ) phone
        FROM
        jczz_house jh
        LEFT JOIN jczz_household jhd ON jhd.house_code = jh.house_code
        AND jh.is_deleted = 0
        LEFT JOIN jczz_user_topics jut on jut.household_id = jhd.id
        <where>
            <if test="districtIdList != null and districtIdList.size() > 0">
            <if test="aoiCodeList != null and aoiCodeList.size() > 0">
                and jh.district_code in
                <foreach collection="districtIdList" item="code" open="(" close=")" separator=",">
                <foreach collection="aoiCodeList" item="code" open="(" close=")" separator=",">
                    #{code}
                </foreach>
            </if>