修改报表排序

duizhaopin
13507605001 2 years ago
parent 8a20c698e2
commit 7873135d6c

@ -222,6 +222,7 @@ class BllMedicamentRecord(Repository):
) a LEFT JOIN( ) a LEFT JOIN(
select avatar_url, user_id from rms_user select avatar_url, user_id from rms_user
) b on a.create_user_id= b.user_id ) b on a.create_user_id= b.user_id
order by count_number desc
""" """
data = self.execute(sql_all).fetchall() data = self.execute(sql_all).fetchall()
@ -311,7 +312,7 @@ class BllMedicamentRecord(Repository):
select medicament_id, `name`, english_name, speci, cas_number, purity, net_weight_unit,put_in_date, `status`,func_type from rms_medicament select medicament_id, `name`, english_name, speci, cas_number, purity, net_weight_unit,put_in_date, `status`,func_type from rms_medicament
)as a LEFT JOIN( )as a LEFT JOIN(
select medicament_id, FORMAT(sum(use_quantity),2) sum_use, count(medicament_id) c_two from rms_medicament_record where record_type=2 GROUP BY medicament_id select medicament_id, FORMAT(sum(use_quantity),2) sum_use, count(medicament_id) c_two from rms_medicament_record where record_type=2 GROUP BY medicament_id
) b on a.medicament_id=b.medicament_id {filter_base} GROUP BY `name`, purity, speci ) b on a.medicament_id=b.medicament_id {filter_base} GROUP BY `name`, purity, speci order by use_level desc
""" """
# 获取数量 # 获取数量
@ -360,6 +361,7 @@ class BllMedicamentRecord(Repository):
LEFT JOIN (select medicament_id, func_type from rms_medicament LEFT JOIN (select medicament_id, func_type from rms_medicament
) as c on c.medicament_id = a.medicament_id ) as c on c.medicament_id = a.medicament_id
{filter_base} {filter_base}
order by use_amount desc
""" """
# 查询条件组合 # 查询条件组合

Loading…
Cancel
Save