Advertisement
psi_mmobile

Untitled

Jun 26th, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 6.00 KB | None | 0 0
  1. SELECT GuPerson.GUI_USER_ID,
  2.   Person.ADMIN_LOGIN,
  3.   Person.ADMIN_PWD,
  4.   Person.ADMIN_RIGHT,
  5.   Person.AGE,
  6.   Person.BIRTH_DATE,
  7.   Person.CAN_DRIVE_WITH_PASSENGERS,
  8.   Person.CAN_DRIVE_WITH_PU,
  9.   Person.COMPANY_NR,
  10.   Person.EMAIL,
  11.   Person.END_WORK_DATE,
  12.   Person.FIRST_NAME,
  13.   Person.GENDER,
  14.   Person.HOME_POI_ID,
  15.   Person.IS_USING_PRIVATE_CAR,
  16.   Person.LANGUAGE,
  17.   Person.LAST_NAME,
  18.   Person.LAST_PERSON_DATA_ID,
  19.   Person.LM_COMMENT,
  20.   Person.LM_DATE,
  21.   Person.LM_NAME,
  22.   Person.MSISDN,
  23.   Person.PERSON_ID,
  24.   Person.PERSON_STATUS_ID,
  25.   Person.PHONE,
  26.   Person.START_WORK_DATE,
  27.   Person.VO_PERSON_CATEGORY_ID,
  28.   Person.WORKING_SCHEDULE_ID,
  29.   PersonData.PERSON_DATA_ID,
  30.   touserdate(NVL(PersonData.EVENT_DATE,TO_DATE('1970','YYYY')),OperationCenter.timezone)              AS EVENT_DATE,
  31.   TO_CHAR(touserdate(PersonData.EVENT_DATE,OperationCenter.timezone),'dd/mm/yyyy HH24:MI')            AS EVENT_DATE,
  32.   DECODE(LENGTH(TRANSLATE(TRIM(COMPANY_NR),' 0123456789',' ')), NULL, TO_NUMBER(TRIM(COMPANY_NR)), 0) AS COMPANY_NR_INT,
  33.   UPPER(p_person.getCompanyName(Person.person_id)
  34.   || ' '
  35.   || VoPersonCategory.NAME
  36.   || ' '
  37.   || P_PERSON.list_person_group_name(Person.PERSON_ID)
  38.   || ' '
  39.   || Person.COMPANY_NR
  40.   || ' '
  41.   || Person.LAST_NAME
  42.   || ' '
  43.   || Person.FIRST_NAME
  44.   || ' '
  45.   || Person.PHONE
  46.   || ' '
  47.   || PersonStatus.NAME
  48.   || ' '
  49.   || Person.BIRTH_DATE
  50.   || ' '
  51.   || Person.EMAIL
  52.   || ' '
  53.   || Person.END_WORK_DATE
  54.   || ' '
  55.   || Person.GENDER
  56.   || ' '
  57.   || Person.MSISDN
  58.   || ' '
  59.   || VehicleData.rg_street_nr
  60.   || DECODE(VehicleData.rg_street_nr,NULL,'',', ')
  61.   || VehicleData.rg_street
  62.   || DECODE(VehicleData.rg_street,NULL,'',' - ')
  63.   || VehicleData.rg_post_code
  64.   || ' '
  65.   || VehicleData.rg_location
  66.   || ' '
  67.   || VehicleData.rg_country
  68.   || ' '
  69.   || P_PERSON.list_person_key_strings(Person.PERSON_ID)
  70.   || ' '
  71.   || Person.NISS
  72.   || ' '
  73.   || Person.LIMOSA
  74.   || ' '
  75.   || p_vd_poi.getPersonDataPoiName(OperationCenter.operation_center_id, PersonData.person_data_id)) AS IDSTRING,
  76.   VoPersonCategory.VEHICLE_OWNER_ID,
  77.   VoPersonCategory.VO_PERSON_CATEGORY_ID AS VO_PERSON_CATEGORY_ID1,
  78.   OcPoi.WGS84_LATITUDE,
  79.   OcPoi.POI_ID,
  80.   OcPoi.WGS84_LONGITUDE,
  81.   VehicleOwner.VEHICLE_OWNER_ID AS VEHICLE_OWNER_ID1,
  82.   VoPersonCategory.NAME,
  83.   P_PERSON.list_person_key_strings(Person.PERSON_ID)                               AS KEY_STRING,
  84.   DECODE(OcPoi.Wgs84_Latitude,NULL,'N',DECODE(OcPoi.Wgs84_Longitude,NULL,'N','Y')) AS IS_GEOCODED,
  85.   (VehicleData.rg_street_nr
  86.   || DECODE(VehicleData.rg_street_nr,NULL,'',', ')
  87.   || VehicleData.rg_street
  88.   || DECODE(VehicleData.rg_street,NULL,'',' - ')
  89.   || VehicleData.rg_post_code
  90.   || ' '
  91.   || VehicleData.rg_location
  92.   || ' '
  93.   || VehicleData.rg_country)                                                                    AS VEHICLE_DATA_RG_ADRESS,
  94.   p_vd_poi.getPersonDataPoiName(OperationCenter.operation_center_id, PersonData.person_data_id) AS POI_NAME,
  95.   p_vd_poi.getPersonDataPoiId(OperationCenter.operation_center_id, PersonData.PERSON_DATA_ID)   AS POI_ID_LIST,
  96.   P_PERSON.list_person_group_name(Person.PERSON_ID)                                             AS PERSON_GROUP,
  97.   (Person.LAST_NAME
  98.   ||' '
  99.   ||Person.FIRST_NAME) AS FULLNAME,
  100.   VoPersonCategory.GRAPHICAL_SYMBOL,
  101.   (OcPoi.street_nr
  102.   || DECODE(OcPoi.street_nr,NULL,'',', ')
  103.   || OcPoi.street
  104.   || DECODE(OcPoi.street,NULL,'',' - ')
  105.   || OcPoi.post_code
  106.   || ' '
  107.   || OcPoi.location
  108.   || ' '
  109.   || OcPoi.country) AS VIEW_ATTR,
  110.   Person.VEHICLE_PRIVATE_USE_ALLOWED,
  111.   GuiUsers.GUI_USER_ID AS GUI_USER_ID1,
  112.   OperationCenter.OPERATION_CENTER_ID,
  113.   PersonStatus.PERSON_STATUS_ID AS PERSON_STATUS_ID1,
  114.   VehicleData.VEHICLE_DATA_ID,
  115.   Person.NISS,
  116.   Person.LIMOSA,
  117.   GuPerson.PERSON_ID                        AS PERSON_ID1,
  118.   p_person.getCompanyName(Person.person_id) AS VIEW_ATTR,
  119.   Person.PERSON_MFRAME_STATUS_ID,
  120.   PersonMframeStatus.GRAPHICAL_SYMBOL        AS GRAPHICAL_SYMBOL1,
  121.   PersonMframeStatus.NAME                    AS NAME1,
  122.   PersonMframeStatus.PERSON_MFRAME_STATUS_ID AS PERSON_MFRAME_STATUS_ID1,
  123.   Str.STR_VALUE,
  124.   Str.STR_ID,
  125.   Str.LANGUAGE                             AS LANGUAGE1,
  126.   P_PERSON.getPlannedWBS(Person.PERSON_ID) AS VIEW_ATTR,
  127.   Person.IS_WORK_TIME_REPORTED,
  128.   GuPerson.CAW_LIMITED
  129. FROM GU_PERSON GuPerson,
  130.   PERSON Person,
  131.   PERSON_DATA PersonData,
  132.   GUI_USERS GuiUsers,
  133.   OPERATION_CENTER OperationCenter,
  134.   VO_PERSON_CATEGORY VoPersonCategory,
  135.   PERSON_STATUS PersonStatus,
  136.   OC_POI OcPoi,
  137.   VEHICLE_OWNER VehicleOwner,
  138.   VEHICLE_DATA VehicleData,
  139.   OF_OWNER.PERSON_MFRAME_STATUS PersonMframeStatus,
  140.   OF_OWNER.STR Str
  141. WHERE GuiUsers.GUI_USER_ID            = 101694
  142. AND GuiUsers.GUI_USER_ID              = GuPerson.GUI_USER_ID
  143. AND GuiUsers.OPERATION_CENTER_ID      = OperationCenter.OPERATION_CENTER_ID
  144. AND GuPerson.PERSON_ID                = Person.PERSON_ID
  145. AND Person.VO_PERSON_CATEGORY_ID      = VoPersonCategory.VO_PERSON_CATEGORY_ID
  146. AND VoPersonCategory.VEHICLE_OWNER_ID = VehicleOwner.VEHICLE_OWNER_ID
  147. AND Person.PERSON_STATUS_ID           = PersonStatus.PERSON_STATUS_ID
  148. AND Person.HOME_POI_ID                = OcPoi.POI_ID(+)
  149. AND PersonData.PERSON_DATA_ID(+)      = Person.LAST_PERSON_DATA_ID
  150. AND VehicleData.VEHICLE_DATA_ID(+)    = PersonData.VEHICLE_DATA_ID
  151. AND
  152. (
  153.     (
  154.       '1'                       = '-1'
  155.       OR '101550,'                         IS NULL
  156.       OR '101550,'                          = ''
  157.       OR Person.VO_PERSON_CATEGORY_ID      IN
  158.         (
  159.           SELECT regexp_substr('101550,','[^,]+', 1, LEVEL)
  160.           FROM dual
  161.           CONNECT BY regexp_substr('101550,', '[^,]+', 1, LEVEL) IS NOT NULL
  162.         )
  163.     )
  164. OR (
  165.     NVL(GuPerson.CAW_LIMITED,'N')   = DECODE('Y','N','NIGGA','Y')
  166.     )
  167. )
  168. AND (Person.PERSON_STATUS_ID       =0
  169. OR 'true'                          ='true')
  170. AND Person.PERSON_MFRAME_STATUS_ID = PersonMframeStatus.PERSON_MFRAME_STATUS_ID(+)
  171. AND PersonMframeStatus.STR_ID      = Str.STR_ID (+)
  172. AND GuiUsers.LANGUAGE              = Str.LANGUAGE (+)
  173. ORDER BY FIRST_NAME, LAST_NAME;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement