Advertisement
EvaldoMaciel

SQL Colleague

May 18th, 2022
2,309
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [SELECT UT.TENANT_ID AS "colleaguePK.companyId", UT.USER_CODE AS "colleaguePK.colleagueId", U.FULL_NAME AS "colleagueName", UT.EMAIL AS "mail", UT.LOGIN AS "login", (CASE UT.USER_STATE WHEN 1 THEN 'true' ELSE 'false' END) AS "active", (CASE UR.ROLE_CODE WHEN 'admin' THEN 'true' ELSE 'false' END) AS "adminUser", UD_html.DATA_VALUE AS "emailHtml", UD_lang.DATA_VALUE AS "defaultLanguage", UD_volume.DATA_VALUE AS "volumeId", UD_allotment.DATA_VALUE AS "maxPrivateSize", UD_projects.DATA_VALUE AS "currentProject", UD_ramal.DATA_VALUE AS "extensionNr", UD_specialization.DATA_VALUE AS "especializationArea", UD_group.DATA_VALUE AS "groupId", UT.USER_TENANT_ID AS "userTenantId" FROM FDN_USER U JOIN FDN_USERTENANT UT ON U.USER_ID = UT.USER_ID AND UT.TENANT_ID = 1 LEFT JOIN FDN_USERROLE UR ON UT.LOGIN = UR.LOGIN AND UR.ROLE_CODE='admin' LEFT JOIN FDN_USERDATA UD_lang ON UT.USER_TENANT_ID = UD_lang.USER_TENANT_ID AND UD_lang.DATA_KEY='WCMUserLang' LEFT JOIN FDN_USERDATA UD_html ON UT.USER_TENANT_ID = UD_html.USER_TENANT_ID AND UD_html.DATA_KEY='UserEmailHTML' LEFT JOIN FDN_USERDATA UD_volume ON UT.USER_TENANT_ID = UD_volume.USER_TENANT_ID AND UD_volume.DATA_KEY='UserPhysicalVolume' LEFT JOIN FDN_USERDATA UD_allotment ON UT.USER_TENANT_ID = UD_allotment.USER_TENANT_ID AND UD_allotment.DATA_KEY='UserAllotment' LEFT JOIN FDN_USERDATA UD_projects ON UT.USER_TENANT_ID = UD_projects.USER_TENANT_ID AND UD_projects.DATA_KEY='UserProjects' LEFT JOIN FDN_USERDATA UD_ramal ON UT.USER_TENANT_ID = UD_ramal.USER_TENANT_ID AND UD_ramal.DATA_KEY='UserRamal' LEFT JOIN FDN_USERDATA UD_specialization ON UT.USER_TENANT_ID = UD_specialization.USER_TENANT_ID AND UD_specialization.DATA_KEY='UserSpecialization' LEFT JOIN FDN_USERDATA UD_group ON UT.USER_TENANT_ID = UD_group.USER_TENANT_ID AND UD_group.DATA_KEY='UserWorkflowGroup' WHERE UT.TENANT_ID = 1 AND ( ((U.USER_TYPE <> '2')) ) GROUP BY UT.USER_TENANT_ID, UR.ROLE_CODE, UT.TENANT_ID, UT.USER_CODE, U.FULL_NAME, UT.EMAIL, UT.LOGIN, UT.USER_STATE, (CASE UR.ROLE_CODE WHEN 'admin' THEN 'true' ELSE 'false' END), UD_html.DATA_VALUE, UD_lang.DATA_VALUE, UD_volume.DATA_VALUE, UD_allotment.DATA_VALUE, UD_projects.DATA_VALUE, UD_ramal.DATA_VALUE, UD_specialization.DATA_VALUE, UD_group.DATA_VALUE]
Advertisement
RAW Paste Data Copied
Advertisement