Commit 6eff1a03 authored by xianyang's avatar xianyang

优化业务类型汇总查询

parent ee72d935
...@@ -8,6 +8,7 @@ from libs.functions import get_now_datetime ...@@ -8,6 +8,7 @@ from libs.functions import get_now_datetime
from libs.orm import QueryAllData from libs.orm import QueryAllData
from models.export import ExportFile from models.export import ExportFile
import pandas as pd import pandas as pd
from xpinyin import Pinyin
from starlette.responses import StreamingResponse from starlette.responses import StreamingResponse
...@@ -85,6 +86,9 @@ class CalculationMonthlyBill(object): ...@@ -85,6 +86,9 @@ class CalculationMonthlyBill(object):
assert_list.append(f" reference_type in{tuple(k_list)}") assert_list.append(f" reference_type in{tuple(k_list)}")
if len(k_list) == 1: if len(k_list) == 1:
assert_list.append(f" reference_type='{k_list[0]}'") assert_list.append(f" reference_type='{k_list[0]}'")
if not k_list:
py = Pinyin().get_pinyin(name)
assert_list.append(f" reference_type='{py.replace('-', '')}'")
if key_type: if key_type:
assert_list.append(f" reference_type like '%{key_type}%'") assert_list.append(f" reference_type like '%{key_type}%'")
if assert_list: if assert_list:
......
...@@ -44,3 +44,4 @@ uvicorn==0.20.0 ...@@ -44,3 +44,4 @@ uvicorn==0.20.0
xmltodict==0.13.0 xmltodict==0.13.0
openpyxl==3.1.2 openpyxl==3.1.2
redis==4.3.4 redis==4.3.4
xpinyin==0.7.6
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment