|
|
|
|
@ -1,9 +1,13 @@
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
from service.utils import run_sql_command, log_to_telegram
|
|
|
|
|
|
|
|
|
|
CMD_PIVOT_DIST = """CALL public.pivot_dist();"""
|
|
|
|
|
CMD_PIVOT_DIST = """CREATE OR REPLACE VIEW compact_placementpoint AS
|
|
|
|
|
SELECT id, status, category, age_day, fact, area_id, district_id, prediction_first, prediction_current, doors, flat_cnt, rival_post_cnt, rival_pvz_cnt, target_post_cnt, flats_cnt, tc_cnt, culture_cnt, mfc_cnt, public_stop_cnt, supermarket_cnt, target_dist, metro_dist, geometry, d10,d12,d17,d20,d24,d25,d7,d8,d9 FROM service_placementpoint;
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
CMD_PIVOT_DIST_PRE = """CALL public.prepivot_dist();"""
|
|
|
|
|
CMD_PIVOT_DIST_PRE = """CREATE OR REPLACE VIEW compact_preplacementpoint AS
|
|
|
|
|
SELECT id, status, category, age_day, fact, area_id, district_id, prediction_first, prediction_current, doors, flat_cnt, rival_post_cnt, rival_pvz_cnt, target_post_cnt, flats_cnt, tc_cnt, culture_cnt, mfc_cnt, public_stop_cnt, supermarket_cnt, target_dist, metro_dist, geometry, d10,d12,d17,d20,d24,d25,d7,d8,d9 FROM service_preplacementpoint;
|
|
|
|
|
"""
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
|
help = 'Create views'
|
|
|
|
|
|
|
|
|
|
|