Für alle weiteren SQL Queries die Bedingung das calendar not null sein darf eingefügt

main
mmaurostoffel 2025-01-17 15:25:22 +01:00
parent 0d3bc7acd3
commit 9fb7fb2f82
1 changed files with 16 additions and 7 deletions

View File

@ -298,7 +298,8 @@ class Database:
FROM FROM
consultancy_d.extractions consultancy_d.extractions
WHERE WHERE
type == 'calendar' type == 'calendar' AND
calendar NOT NULL
ORDER BY ORDER BY
property_id property_id
""") """)
@ -319,6 +320,8 @@ class Database:
consultancy_d.seeds ON seeds.id = properties.seed_id consultancy_d.seeds ON seeds.id = properties.seed_id
LEFT JOIN LEFT JOIN
consultancy_d.regions ON regions.id = seeds.region_id consultancy_d.regions ON regions.id = seeds.region_id
WHERE
calendar NOT NULL
""") """)
def extractions_for(self, property_id): def extractions_for(self, property_id):
@ -463,7 +466,8 @@ class Database:
consultancy_d.properties ON properties.id = extractions.property_id consultancy_d.properties ON properties.id = extractions.property_id
WHERE WHERE
type == 'calendar' AND type == 'calendar' AND
properties.seed_id = {region_id} properties.seed_id = {region_id} AND
calendarBody NOT NULL
""") """)
def singleScrape_of_region(self, region_id: int, scrape_date_min: str, scrape_date_max: str): def singleScrape_of_region(self, region_id: int, scrape_date_min: str, scrape_date_max: str):
@ -478,7 +482,8 @@ class Database:
type == 'calendar' AND type == 'calendar' AND
properties.seed_id = {region_id} AND properties.seed_id = {region_id} AND
extractions.created_at >= '{scrape_date_min}' AND extractions.created_at >= '{scrape_date_min}' AND
extractions.created_at < '{scrape_date_max}' extractions.created_at < '{scrape_date_max}' AND
calendarBody NOT NULL
""") """)
def singleScrape_of_global(self, scrape_date_min: str, scrape_date_max: str): def singleScrape_of_global(self, scrape_date_min: str, scrape_date_max: str):
@ -492,7 +497,8 @@ class Database:
WHERE WHERE
type == 'calendar' AND type == 'calendar' AND
extractions.created_at >= '{scrape_date_min}' AND extractions.created_at >= '{scrape_date_min}' AND
extractions.created_at < '{scrape_date_max}' extractions.created_at < '{scrape_date_max}' AND
calendarBody NOT NULL
""") """)
def singleScrape_of_region_scrapDate(self, region_id: int, scrape_date_min: str, scrape_date_max: str): def singleScrape_of_region_scrapDate(self, region_id: int, scrape_date_min: str, scrape_date_max: str):
@ -508,7 +514,8 @@ class Database:
type == 'calendar' AND type == 'calendar' AND
properties.seed_id = {region_id} AND properties.seed_id = {region_id} AND
extractions.created_at >= '{scrape_date_min}' AND extractions.created_at >= '{scrape_date_min}' AND
extractions.created_at < '{scrape_date_max}' extractions.created_at < '{scrape_date_max}' AND
calendarBody NOT NULL
""") """)
def singleScrape_of_global_scrapDate(self, scrape_date_min: str, scrape_date_max: str): def singleScrape_of_global_scrapDate(self, scrape_date_min: str, scrape_date_max: str):
@ -523,7 +530,8 @@ class Database:
WHERE WHERE
type == 'calendar' AND type == 'calendar' AND
extractions.created_at >= '{scrape_date_min}' AND extractions.created_at >= '{scrape_date_min}' AND
extractions.created_at < '{scrape_date_max}' extractions.created_at < '{scrape_date_max}' AND
calendarBody NOT NULL
""") """)
def capacity_global(self): def capacity_global(self):
@ -556,7 +564,8 @@ class Database:
WHERE WHERE
type == 'calendar' AND type == 'calendar' AND
(properties.seed_id = {region_id_1} OR (properties.seed_id = {region_id_1} OR
properties.seed_id = {region_id_2}) properties.seed_id = {region_id_2}) AND
calendarBody NOT NULL
""") """)
def unique_scrapeDates(self): def unique_scrapeDates(self):