# select medicament_id, FORMAT(sum(use_quantity),2) sum_use, sum(CASE WHEN record_type=2 THEN 1 ELSE 0 END) c_two from rms_medicament_record %s GROUP BY medicament_id
filter_base=""
ifseach_word:
@ -308,6 +312,11 @@ class BllMedicamentRecord(Repository):
iffilter_base:
filter_base+=" and "
filter_base+=f" func_type='{func_type}'"
ifstart_timeandend_time:
iffilter_base:
filter_base+=" and "
filter_base+=f" create_date >= '{start_time}' and create_date <= '{end_time}'"
iffilter_base:
filter_base=f" where {filter_base}"
sql_all=f"""
@ -316,7 +325,7 @@ class BllMedicamentRecord(Repository):