You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Date:2022/08/09 17:38:47
'''
import sys
sys.path.append('.')
from db_logic.db_base import Repository
from models.client_models import EntityClientCell
from Common.Utils import Utils
class BllClientCell(Repository):
def __init__(self, entityType=EntityClientCell):
super().__init__(entityType)
# 展示抽屉权限用户
def get_drawer_power_user_list(self, drawer_id, page_param):
sql_all = f"""
select a.real_name, a.user_id,
CASE WHEN b.id is not null THEN 1 ELSE 0 END drawer_type
from rms_user as a LEFT JOIN (
select * from rms_client_cell_user where client_cell_id='{drawer_id}'
) as b on a.user_id=b.user_id
"""
try:
count_number = len(self.execute(sql_all).fetchall())
except Exception:
count_number = 0
page_param.totalRecords = count_number
page_sql = Utils.sql_paging_assemble(sql_all, page_param)
return self.execute(page_sql).fetchall()