<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">from mm_stats.config import POSTGRES_USER, PGPASSWORD


def load_sql() -&gt; str:
    """Load sql template."""
    sql = f"""
        DROP TABLE IF EXISTS data_preparation.project_interests;
        CREATE TABLE data_preparation.project_interests as
        select
          interest_id
         ,project_id 
         ,case 
            -- Disasters &amp; Climate Resilience
            when interest_id in (3, 4, 6, 8, 12, 17) then 100
            -- Sustainable Cities &amp; Communities
            when interest_id in (8, 9, 10, 11, 12, 14) then 200 
            -- Public Health
            when interest_id in (7,8) then 300
            -- Displacement and Migration
            when interest_id in (1, 8) then 400
            -- Gender &amp; Equality
            when interest_id in (13) then 500
         end as impact_area_id
        from public.dblink('
            dbname=hot_tm
            user={POSTGRES_USER}
            password={PGPASSWORD}
            options=-csearch_path=',
            'select * from public.project_interests')
        AS p(
            interest_id int4,
            project_id int8
        );
    """

    return sql
</pre></body></html>