From e905d49cd402c41eafe8df6a136a1fbb8aa47727 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 3 Nov 2022 10:47:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8A=E6=9C=88=E4=B8=8E?= =?UTF-8?q?=E5=89=8D=E6=9C=88=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/jh/price/price_exception.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dags/jh/price/price_exception.py b/dags/jh/price/price_exception.py index 3910a7a..f6634d6 100644 --- a/dags/jh/price/price_exception.py +++ b/dags/jh/price/price_exception.py @@ -80,6 +80,11 @@ month_before = dateutils.format_date(dateutils.add_months(dateutils.datetime.dat type = sys.argv[1] if len(sys.argv) > 1 else '' log.info("输出类型" + type) +# 新增支持上一月与前月对比 +if type == month_last: + month_now = month_last + month_last = month_before + df = oracle.scan_by_sql_to_data_frame("SELECT id, cityname, distname, commid, commname, calc_type, confidence, avg_price, year_month FROM community_base_price_gj WHERE year_month IN('"+month_now+"', '"+month_last+"') " + " ORDER BY cityname, distname, commid, commname, year_month")