|
|
- const sql = `select users.id_ as userId, users.name_ as userName, users.mobile_ as phone, users.positions_ as positionId, (select ifnull(GROUP_CONCAT(DISTINCT roles.role_id_ SEPARATOR ','), '') from ibps_party_user_role as roles where roles.user_id_ = users.id_ ) as roleId, (select ifnull(GROUP_CONCAT(DISTINCT roles.name_ SEPARATOR ','), '') from ibps_party_entity as roles where roles.id_ in (select role_id_ from ibps_party_user_role where user_id_ = users.id_ )) as roles, (select ifnull(GROUP_CONCAT(DISTINCT positions.name_ SEPARATOR ','), '') from ibps_party_entity as positions where find_in_set(positions.id_, users.positions_)) as positions from ibps_party_employee as users where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params}))`
|
|
|
+ const sql = `select users.id_ as userId, users.name_ as userName, users.mobile_ as phone, users.positions_ as positionId, (select ifnull(GROUP_CONCAT(DISTINCT roles.role_id_ SEPARATOR ','), '') from ibps_party_user_role as roles where roles.user_id_ = users.id_ ) as roleId, (select ifnull(GROUP_CONCAT(DISTINCT roles.name_ SEPARATOR ','), '') from ibps_party_entity as roles where roles.id_ in (select role_id_ from ibps_party_user_role where user_id_ = users.id_ )) as roles, (select ifnull(GROUP_CONCAT(DISTINCT positions.name_ SEPARATOR ','), '') from ibps_party_entity as positions where find_in_set(positions.id_, users.positions_)) as positions, (select ifnull(people.qian_zi_tu_wen_, '') from t_ryjbqk as people where people.parent_id_ = users.id_) as signatureId, (select ifnull(files.file_name_, '') from ibps_file_attachment as files where files.id_ = signatureId) as signatureName from ibps_party_employee as users where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params}))`
|