linwe
2024-08-09 37be14fc1e419396af3441da0701e2bf99f47112
src/main/java/org/springblade/modules/smsTask/mapper/SmsTaskMapper.xml
@@ -46,7 +46,8 @@
            district_id,
            building_code,
            building_name,
            district_name
            district_name,
            status
        from
            jczz_sms_task
    </sql>
@@ -73,4 +74,23 @@
    </select>
    <select id="selectSmsTaskListByPhone" resultType="org.springblade.modules.system.entity.User">
        SELECT DISTINCT
        bu.phone,
        bu.name
        FROM
        blade_user bu
        LEFT JOIN jczz_household jhd ON bu.id = jhd.associated_user_id
        LEFT JOIN jczz_house jh ON jhd.house_code = jh.house_code
        LEFT JOIN jczz_district jd ON jd.aoi_code = jh.district_code
        LEFT JOIN jczz_sms_task jst ON jst.district_id = jd.id
        <where>
            <if test="id != null">jst.id = #{id}</if>
            <if test="buildingCode != null  and buildingCode != ''">and building_code = #{buildingCode}</if>
            and jhd.relationship = 1
            and bu.phone is not null
        </where>
    </select>
</mapper>