Schichtplan_pro_MA.iqd 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\Zeiten\Split\Schichtplan_pro_MA.imr
  5. TITLE,Schichtplan_pro_MA.imr
  6. BEGIN SQL
  7. select T1."REFERENCE_IDENT" as c1,
  8. T1."REFERENCE_NAME" as c2,
  9. T1."CALENDAR_TYPE_ID" as c3,
  10. T1."TRANSACT_DATE" as c4,
  11. T2."CALENDAR_INFO_ID" as c5,
  12. T2."CALENDAR_TYPE_ID" as c6,
  13. T2."RECURRING_PATTERN_ID" as c7,
  14. T2."RECURRING_PATTERN_PRIORITY" as c8,
  15. T2."TRANSACT_DATE" as c9,
  16. T3."SEL_NAME" as c10,
  17. (od_right(T2."RECURRING_PATTERN_ID",3)) as c11,
  18. T4."CORE_WORKING_HOURS" as c12,
  19. T5."WORK_LEADER_GROUP" as c13,
  20. T5."WORKLEADER_TEXT" as c14,
  21. T5."WORK_LEADER_GROUP" || ' - ' || T5."WORKLEADER_TEXT" as c15,
  22. T6."CALENDAR_EVENT_NAME" as c16,
  23. T6."EVENT_START" as c17,
  24. T6."EVENT_END" as c18,
  25. T6."OCCURRENCE" as c19,
  26. T6."ALL_DAY_EVENT" as c20,
  27. T6."RECURRING_PATTERN_ID" as c21,
  28. T6."ACTIVITY_ID" as c22,
  29. T6."CALENDAR_INFO_ID" as c23,
  30. T6."CALENDAR_TYPE_ID" as c24,
  31. T6."RECURRING_TYPE_ID" as c25,
  32. T6."HOLIDAY_ID" as c26,
  33. (dayofweek(T6."EVENT_START")) as c27,
  34. T3."SEL_NAME" as c28,
  35. T6."EVENT_START" as c29,
  36. T7."PERS_DEPARTMENT" as c30,
  37. '1' as c31,
  38. (od_left(T8."DEPARTMENT_TYPE_ID",2)) as c32,
  39. T9."PROFILE_CODE" as c33,
  40. (substring(T8."DEPARTMENT_TYPE_ID" from 4 for 1)) as c34,
  41. T4."CORE_WORKING_HOURS" as c35,
  42. '' as c36,
  43. T10."WORK_LEADER_GROUP_ID" as c37,
  44. T10."JOB_END_DATE" as c38,
  45. T4."CORE_WORKING_HOURS" as c39,
  46. T4."RECURRING_PATTERN_ID" as c40,
  47. T4."CORE_WORKING_HOURS" as c41,
  48. T4."WORKINGDAY" as c42,
  49. T4."START_DAY_ID" as c43,
  50. (rtrim(T9."PROFILE_CODE")) || ' - ' || T3."SEL_NAME" as c44
  51. from "deop01"."dbo"."WORKING_PERIOD" T4,
  52. "deop01"."dbo"."EMPLOYEE" T10,
  53. "deop01"."dbo"."vPP91" T5,
  54. "deop01"."dbo"."CALENDAR_EVENT" T6,
  55. (("deop01"."dbo"."CALENDAR_INFO" T1 left outer join "deop01"."dbo"."CALENDAR_PATTERN" T2 on T2."CALENDAR_INFO_ID" = T1."REFERENCE_IDENT") left outer join "deop01"."dbo"."PERSON_INFO" T7 on T1."REFERENCE_NAME" = T7."PERSON_NUMBER"),
  56. (("deop01"."dbo"."vPP43" T3 left outer join "deop01"."dbo"."PROFILE" T9 on T3."SELLER_CODE" = T9."PROFILE_CODE") left outer join "deop01"."dbo"."DEPARTMENT_TYPE" T8 on T3."SEL_DEPARTMENT" = T8."DEPARTMENT_TYPE_ID")
  57. where (T9."PROFILE_CODE" = T1."REFERENCE_NAME") and (T2."RECURRING_PATTERN_ID" = T4."RECURRING_PATTERN_ID") and (T10."PERSON_ID" = T9."PERSON_ID") and (T5."WORK_LEADER_GROUP" = T10."WORK_LEADER_GROUP_ID")
  58. and (((((((((T6."HOLIDAY_ID" IS NOT NULL) and (T6."EVENT_START" >= TIMESTAMP '2014-01-02 00:00:00.000')) and (T6."HOLIDAY_ID" IN (79,81,83,84,85,87,90,95,96))) and (((dayofweek(T6."EVENT_START"))) BETWEEN 2 AND 6)) and (T6."EVENT_START" < (now()))) and ((T5."WORK_LEADER_GROUP" || ' - ' || T5."WORKLEADER_TEXT") IN ('1000 - gewerbl. Mitarbeiter Spandau','1010 - gewerbl. Mitarbeiter Dallgow','1020 - gewerb. Mitarbeiter Falkensee','1030 - gewerbl. Mitarbeiter Nauen','2000 - Karosserie/Lack'))) and ((T10."JOB_END_DATE" = TIMESTAMP '1800-01-01 00:00:00.000') or (T6."EVENT_START" < T10."JOB_END_DATE"))) and ((T2."RECURRING_PATTERN_PRIORITY" = 0) or (T2."RECURRING_PATTERN_PRIORITY" IS NULL))) and (((dayofweek(T6."EVENT_START"))) = T4."START_DAY_ID"))
  59. order by c2 asc
  60. END SQL
  61. COLUMN,0,Reference Ident
  62. COLUMN,1,Reference Name
  63. COLUMN,2,Calendar Type Id
  64. COLUMN,3,Transact Date
  65. COLUMN,4,Calendar Info Id
  66. COLUMN,5,Calendar Type Id
  67. COLUMN,6,Recurring Pattern Id
  68. COLUMN,7,Recurring Pattern Priority
  69. COLUMN,8,Transact Date
  70. COLUMN,9,Name
  71. COLUMN,10,Pattern_rechts_3
  72. COLUMN,11,Std_Tag
  73. COLUMN,12,Work Leader Group
  74. COLUMN,13,Workleader Text
  75. COLUMN,14,Monteur_Gruppe
  76. COLUMN,15,Calendar Event Name
  77. COLUMN,16,Event Start
  78. COLUMN,17,Event End
  79. COLUMN,18,Occurrence
  80. COLUMN,19,All Day Event
  81. COLUMN,20,Recurring Pattern Id
  82. COLUMN,21,Activity Id
  83. COLUMN,22,Calendar Info Id
  84. COLUMN,23,Calendar Type Id
  85. COLUMN,24,Recurring Type Id
  86. COLUMN,25,Holiday Id
  87. COLUMN,26,Wochentag
  88. COLUMN,27,Monteur_ori
  89. COLUMN,28,Datum
  90. COLUMN,29,Pers Department
  91. COLUMN,30,Hauptbetrieb
  92. COLUMN,31,Standort
  93. COLUMN,32,Profile Code
  94. COLUMN,33,Kostenstelle
  95. COLUMN,34,Feiertag
  96. COLUMN,35,Order Number
  97. COLUMN,36,Work Leader Group Id
  98. COLUMN,37,Job End Date
  99. COLUMN,38,abwesend
  100. COLUMN,39,Recurring Pattern Id_aus_Workin_Period
  101. COLUMN,40,Core Working Hours
  102. COLUMN,41,Workingday
  103. COLUMN,42,Start Day Id
  104. COLUMN,43,Monteur