Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SocialOfficeTransaction.WORK_DATE,
- SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID,
- SocialOfficeTransaction.POI_TIN,
- Wbs.WBS_ID,
- SoTransactionStatus.NAME AS SO_TRANSACTION_STATUS_NAME,
- SoTransactionStatus.SO_TRANSACTION_STATUS_ID,
- SocialOfficeTransaction.CREATION_DATE,
- SocialOfficeTransaction.CREATION_USER_NAME,
- SocialOfficeTransaction.SO_CREATION_NUMBER,
- SocialOfficeTransaction.CANCEL_DATE,
- SocialOfficeTransaction.CANCELLATION_USER_NAME,
- SocialOfficeTransaction.SO_CANCELLATION_NUMBER,
- Person.COMPANY_NR,
- Person.PERSON_ID,
- Person.FIRST_NAME,
- Person.LAST_NAME,
- SocialOfficeTransaction.CREATION_GUI_USER_ID,
- SocialOfficeTransaction.CANCELLATION_GUI_USER_ID,
- SocialOfficeTransaction.PERSON_ID AS PERSON_ID1,
- SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID AS SO_TRANSACTION_STATUS_ID1,
- SocialOfficeTransaction.WBS_ID AS WBS_ID1,
- Wbs.POI_ID,
- Wbs.POI_TIN AS POI_TIN1,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'Dy') AS VIEW_ATTR,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'dd') AS VIEW_ATTR,
- Wbs.REF_NUMBER,
- TOUSERDATE (SocialOfficeTransaction.CREATION_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- TOUSERDATE (SocialOfficeTransaction.CANCEL_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- OperationCenter.TIMEZONE,
- OperationCenter.OPERATION_CENTER_ID,
- VoPersonCategory.NAME AS NAME1,
- VoPersonCategory.VO_PERSON_CATEGORY_ID,
- VoPersonCategory.GRAPHICAL_SYMBOL,
- P_PERSON.list_person_group_name(Person.PERSON_ID) AS VIEW_ATTR,
- DECODE (SocialOfficeTransaction.is_start_time_set, 'N' , '', TO_CHAR (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone), 'HH24:mi')) AS VIEW_ATTR,
- SocialOfficeTransaction.DURATION,
- DECODE (SocialOfficeTransaction.is_start_time_set, 'N', '', DECODE(SIGN(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24 - TRUNC (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone)+ 1)), 1, '00:00', TO_CHAR (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24, 'HH24:mi'))) AS VIEW_ATTR,
- SocialOfficeTransaction.IS_START_TIME_SET,
- TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) AS VIEW_ATTR,
- SocialOfficeTransaction.SO_COMMENT,
- SocialOfficeTransaction.PLAN_MODE,
- p_person.getCompanyName(Person.person_id) AS VIEW_ATTR,
- NVL(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id) AS VIEW_ATTR,
- DECODE (p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), NULL, OcPoi.name, p_checkinatwork.getUserCawPoiName(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID)) AS VIEW_ATTR,
- OcPoi.POI_ID AS POI_ID2,
- DECODE (
- (SELECT v.poi_id FROM v_gui_user_oc_poi v WHERE v.gui_user_id = GuPerson.gui_user_id
- AND v.poi_id = NVL(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id)
- ), NULL, 'true', 'false') AS VIEW_ATTR
- FROM OF_OWNER.SOCIAL_OFFICE_TRANSACTION SocialOfficeTransaction,
- OF_OWNER.SO_TRANSACTION_STATUS SoTransactionStatus,
- WBS Wbs,
- PERSON Person,
- OC_POI OcPoi,
- GUI_USERS GuiUsers,
- OPERATION_CENTER OperationCenter,
- GU_PERSON GuPerson,
- VO_PERSON_CATEGORY VoPersonCategory
- WHERE ((((SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID = SoTransactionStatus.SO_TRANSACTION_STATUS_ID)
- AND (SocialOfficeTransaction.WBS_ID = Wbs.WBS_ID)))
- AND (SocialOfficeTransaction.PERSON_ID = Person.PERSON_ID))
- AND (Wbs.POI_ID = OcPoi.POI_ID(+))
- AND SocialOfficeTransaction.PERSON_ID = GuPerson.person_id
- AND GuPerson.gui_user_id = 101708
- AND SocialOfficeTransaction.PERSON_ID = 110777
- AND GuiUsers.gui_user_id = GuPerson.gui_user_id
- AND GuiUsers.Operation_Center_Id = OperationCenter.operation_center_id
- AND Person.vo_person_category_id = VoPersonCategory.vo_person_category_id
- --AND SocialOfficeTransaction.Wbs_Id = NVL(?, SocialOfficeTransaction.Wbs_Id)
- AND SocialOfficeTransaction.person_id = 110777
- and OcPoi.poi_id = 603334
- and ( ( (( ( (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) <= sysdate ) ) AND ( (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) >= sysdate - 6 ) ) )AND (nvl(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id) = 603334) ) ) )
- ORDER BY work_date DESC;
- SELECT SocialOfficeTransaction.WORK_DATE,
- SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID,
- SocialOfficeTransaction.POI_TIN,
- Wbs.WBS_ID,
- SoTransactionStatus.NAME AS SO_TRANSACTION_STATUS_NAME,
- SoTransactionStatus.SO_TRANSACTION_STATUS_ID,
- SocialOfficeTransaction.CREATION_DATE,
- SocialOfficeTransaction.CREATION_USER_NAME,
- SocialOfficeTransaction.SO_CREATION_NUMBER,
- SocialOfficeTransaction.CANCEL_DATE,
- SocialOfficeTransaction.CANCELLATION_USER_NAME,
- SocialOfficeTransaction.SO_CANCELLATION_NUMBER,
- Person.COMPANY_NR,
- Person.PERSON_ID,
- Person.FIRST_NAME,
- Person.LAST_NAME,
- SocialOfficeTransaction.CREATION_GUI_USER_ID,
- SocialOfficeTransaction.CANCELLATION_GUI_USER_ID,
- SocialOfficeTransaction.PERSON_ID AS PERSON_ID1,
- SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID AS SO_TRANSACTION_STATUS_ID1,
- SocialOfficeTransaction.WBS_ID AS WBS_ID1,
- Wbs.POI_ID,
- Wbs.POI_TIN AS POI_TIN1,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'Dy') AS VIEW_ATTR,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'dd') AS VIEW_ATTR,
- Wbs.REF_NUMBER,
- TOUSERDATE (SocialOfficeTransaction.CREATION_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- TOUSERDATE (SocialOfficeTransaction.CANCEL_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- OperationCenter.TIMEZONE,
- OperationCenter.OPERATION_CENTER_ID,
- VoPersonCategory.NAME AS NAME1,
- VoPersonCategory.VO_PERSON_CATEGORY_ID,
- VoPersonCategory.GRAPHICAL_SYMBOL,
- P_PERSON.list_person_group_name(Person.PERSON_ID) AS VIEW_ATTR,
- decode (SocialOfficeTransaction.is_start_time_set, 'N' , '', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone), 'HH24:mi')) AS VIEW_ATTR,
- SocialOfficeTransaction.DURATION,
- decode (SocialOfficeTransaction.is_start_time_set, 'N', '', DECODE(SIGN(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24 - trunc (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone)+ 1)), 1, '00:00', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24, 'HH24:mi'))) AS VIEW_ATTR,
- SocialOfficeTransaction.IS_START_TIME_SET,
- TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) AS VIEW_ATTR,
- SocialOfficeTransaction.SO_COMMENT,
- SocialOfficeTransaction.PLAN_MODE,
- p_person.getCompanyName(Person.person_id) AS VIEW_ATTR,
- nvl(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id) AS VIEW_ATTR,
- decode (p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), NULL, OcPoi.name, p_checkinatwork.getUserCawPoiName(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID)) AS VIEW_ATTR,
- OcPoi.POI_ID AS POI_ID2,
- decode ((SELECT v.poi_id FROM v_gui_user_oc_poi v
- WHERE v.gui_user_id = GuPerson.gui_user_id AND v.poi_id = nvl(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id)), NULL, 'true', 'false') AS VIEW_ATTR
- FROM OF_OWNER.SOCIAL_OFFICE_TRANSACTION SocialOfficeTransaction, OF_OWNER.SO_TRANSACTION_STATUS SoTransactionStatus, WBS Wbs, PERSON Person, OC_POI OcPoi, GUI_USERS GuiUsers, OPERATION_CENTER OperationCenter, GU_PERSON GuPerson, VO_PERSON_CATEGORY VoPersonCategory
- WHERE (SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID = SoTransactionStatus.SO_TRANSACTION_STATUS_ID)
- AND (SocialOfficeTransaction.WBS_ID = Wbs.WBS_ID)
- AND (SocialOfficeTransaction.PERSON_ID = Person.PERSON_ID)
- AND (Wbs.POI_ID = OcPoi.POI_ID(+))
- AND SocialOfficeTransaction.PERSON_ID = GuPerson.person_id
- AND GuPerson.gui_user_id = 101708
- AND GuiUsers.gui_user_id = GuPerson.gui_user_id
- AND GuiUsers.Operation_Center_Id = OperationCenter.operation_center_id
- AND Person.vo_person_category_id = VoPersonCategory.vo_person_category_id
- AND (Nvl('N', 'N') = 'N' OR SoTransactionStatus.SO_TRANSACTION_STATUS_ID = 6)
- AND (Nvl('N', 'N') = 'N' OR (SoTransactionStatus.SO_TRANSACTION_STATUS_ID = 5 OR SoTransactionStatus.SO_TRANSACTION_STATUS_ID = 2 ))
- and SocialOfficeTransaction.Wbs_Id = Nvl(129631, SocialOfficeTransaction.Wbs_Id)
- AND Person.VO_PERSON_CATEGORY_ID = Nvl(NULL, Person.VO_PERSON_CATEGORY_ID)
- and SocialOfficeTransaction.person_id = 110777
- AND ( ( (( ( (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) <= sysdate ) ) AND ( (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) >= sysdate - 6 ) ) )AND (nvl(p_checkinatwork.getUserCawPoiId(GuPerson.gui_user_id, SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID), Wbs.poi_id) = 603334) ) ) )
- ORDER BY SocialOfficeTransaction.WORK_DATE, Person.COMPANY_NR, Person.LAST_NAME, Person.FIRST_NAME, OcPoi.NAME
- ;
- SELECT DISTINCT SOCIALOFFICETRANSACTION.*
- FROM
- (SELECT SOCIALOFFICETRANSACTION.*,
- OCPOI.NAME NAME,
- WBS.REF_NUMBER,
- WBS.NAME AS WBS_NAME,
- WBS.POI_TIN WBS_POI_TIN,
- WBS.POI_ID,
- SOTRANSACTIONSTATUS.NAME AS SO_TRANSACTION_STATUS_NAME
- FROM SOCIAL_OFFICE_TRANSACTION SOCIALOFFICETRANSACTION,
- GUI_USERS GUIUSERS,
- SO_TRANSACTION_STATUS SOTRANSACTIONSTATUS,
- WBS WBS,
- OC_POI OCPOI,
- PERSON PERSON,
- GU_PERSON GUPERSON
- WHERE GUIUSERS.GUI_USER_ID = 101708
- AND SOCIALOFFICETRANSACTION.PERSON_ID = PERSON.PERSON_ID
- AND PERSON.PERSON_ID = GUPERSON.PERSON_ID
- AND GUPERSON.GUI_USER_ID = GUIUSERS.GUI_USER_ID
- AND SocialOfficeTransaction.person_id = 110777 -- TUKA NQQ FILTER BRAAAT *THUG LIFE'S AWAY* B)
- AND SOCIALOFFICETRANSACTION.SO_TRANSACTION_STATUS_ID = SOTRANSACTIONSTATUS.SO_TRANSACTION_STATUS_ID
- AND SOCIALOFFICETRANSACTION.WBS_ID = WBS.WBS_ID
- AND WBS.POI_ID = OCPOI.POI_ID
- and ((OcPoi.OC_POI_STATUS_ID = 0 and SocialOfficeTransaction.so_transaction_status_id = 7) or (SocialOfficeTransaction.so_transaction_status_id <> 7))
- AND SOCIALOFFICETRANSACTION.WORK_DATE >= sysdate - 6
- AND SOCIALOFFICETRANSACTION.WORK_DATE < sysdate
- and nvl( SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID, 2) = nvl( decode(-1, -1, SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID, -1), 2)
- AND nvl(Wbs.poi_id, -2) = nvl (decode(603334, -1, nvl(Wbs.poi_id, -2), 603334), -2)
- and nvl( SocialOfficeTransaction.POI_TIN, -2) = nvl( decode('-1', '-1', SocialOfficeTransaction.POI_TIN, '-1') , -2)
- ) SOCIALOFFICETRANSACTION
- order by SOCIALOFFICETRANSACTION.creation_date;
Advertisement
Add Comment
Please, Sign In to add comment