Sollstunden_MA.iqd 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\Zeiten\Sollstunden_MA.imr
  5. TITLE,Sollstunden_MA.imr
  6. BEGIN SQL
  7. select T1."CALENDAR_INFO_ID" as c1,
  8. T1."CALENDAR_TYPE_ID" as c2,
  9. T1."RECURRING_PATTERN_ID" as c3,
  10. T1."RECURRING_PATTERN_PRIORITY" as c4,
  11. T1."TRANSACT_DATE" as c5,
  12. T2."SEL_NAME" as c6,
  13. (od_right(T1."RECURRING_PATTERN_ID",3)) as c7,
  14. T3."CORE_WORKING_HOURS" as c8,
  15. T4."WORK_LEADER_GROUP" as c9,
  16. T4."WORKLEADER_TEXT" as c10,
  17. T4."WORK_LEADER_GROUP" || ' - ' || T4."WORKLEADER_TEXT" as c11,
  18. ((rtrim(T5."PROFILE_CODE"))) || ' - ' || T2."SEL_NAME" as c12,
  19. T6."PERS_DEPARTMENT" as c13,
  20. '1' as c14,
  21. (od_left(T2."SEL_DEPARTMENT",2)) as c15,
  22. (rtrim(T5."PROFILE_CODE")) as c16,
  23. CASE WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '20') THEN ('2') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) IN ('30','80')) THEN ('6') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '40') THEN ('3') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '41') THEN ('4') WHEN (T2."SEL_DEPARTMENT" IN ('1F ')) THEN ('3') ELSE null END as c17,
  24. '' as c18,
  25. T7."WORK_LEADER_GROUP_ID" as c19,
  26. T7."JOB_END_DATE" as c20,
  27. T3."RECURRING_PATTERN_ID" as c21,
  28. T3."CORE_WORKING_HOURS" as c22,
  29. T3."WORKINGDAY" as c23,
  30. T3."START_DAY_ID" as c24,
  31. T8."bundeslaender_id" as c25,
  32. T8."datum" as c26,
  33. T8."wochentage_id" as c27,
  34. T8."arbeitstag_mofr" as c28,
  35. T8."zaehler_mofr" as c29,
  36. T8."summe_mofr" as c30,
  37. T8."arbeitstag_mosa" as c31,
  38. T8."zaehler_mosa" as c32,
  39. T8."summe_mosa" as c33,
  40. T8."feiertage_id" as c34,
  41. T8."Jahr" as c35,
  42. T8."Arbeitstag Nr Jahr" as c36,
  43. T8."Gesamt Arbeitstage" as c37,
  44. T3."CORE_WORKING_HOURS" as c38,
  45. (@CURRENT_DATE) - INTERVAL '001 00:00:00.000' as c39,
  46. T8."wochentage_id" as c40
  47. from "deop01"."dbo"."WORKING_PERIOD" T3,
  48. "deop01"."dbo"."EMPLOYEE" T7,
  49. "deop01"."dbo"."vPP91" T4,
  50. QSS."C:\GAPS\Portal\System\IQD\Zeiten\Kalender.ims" T8,
  51. (("deop01"."dbo"."CALENDAR_INFO" T9 left outer join "deop01"."dbo"."CALENDAR_PATTERN" T1 on T1."CALENDAR_INFO_ID" = T9."REFERENCE_IDENT") left outer join "deop01"."dbo"."PERSON_INFO" T6 on T9."REFERENCE_NAME" = T6."PERSON_NUMBER"),
  52. ("deop01"."dbo"."vPP43" T2 left outer join "deop01"."dbo"."PROFILE" T5 on T2."SELLER_CODE" = T5."PROFILE_CODE")
  53. where (T5."PROFILE_CODE" = T9."REFERENCE_NAME") and (T1."RECURRING_PATTERN_ID" = T3."RECURRING_PATTERN_ID") and (T7."PERSON_ID" = T5."PERSON_ID") and (T4."WORK_LEADER_GROUP" = T7."WORK_LEADER_GROUP_ID")
  54. and (((((((T3."WORKINGDAY" = 1) and ((T4."WORK_LEADER_GROUP" || ' - ' || T4."WORKLEADER_TEXT") IN ('1000 - gewerbl. Mitarbeiter Spandau','1010 - gewerbl. Mitarbeiter Dallgow','1020 - gewerb. Mitarbeiter Falkensee','1030 - gewerbl. Mitarbeiter Nauen','2000 - Karosserie/Lack'))) and (T7."JOB_END_DATE" = TIMESTAMP '1800-01-01 00:00:00.000')) and ((T1."RECURRING_PATTERN_PRIORITY" = 0) or (T1."RECURRING_PATTERN_PRIORITY" IS NULL))) and (T8."wochentage_id" IN (4,5,1,2,3))) and (T3."START_DAY_ID" = T8."wochentage_id" + 1)) and (T8."datum" <= ((@CURRENT_DATE) - INTERVAL '001 00:00:00.000')))
  55. order by c6 asc
  56. END SQL
  57. COLUMN,0,Calendar Info Id
  58. COLUMN,1,Calendar Type Id
  59. COLUMN,2,Recurring Pattern Id
  60. COLUMN,3,Recurring Pattern Priority
  61. COLUMN,4,Transact Date
  62. COLUMN,5,Name
  63. COLUMN,6,Pattern_rechts_3
  64. COLUMN,7,Std_Tag
  65. COLUMN,8,Work Leader Group
  66. COLUMN,9,Workleader Text
  67. COLUMN,10,Monteur_Gruppe
  68. COLUMN,11,Monteur
  69. COLUMN,12,Pers Department
  70. COLUMN,13,Hauptbetrieb
  71. COLUMN,14,Standort
  72. COLUMN,15,Profile Code
  73. COLUMN,16,Kostenstelle
  74. COLUMN,17,Order Number
  75. COLUMN,18,Work Leader Group Id
  76. COLUMN,19,Job End Date
  77. COLUMN,20,Recurring Pattern Id_aus_Workin_Period
  78. COLUMN,21,Core Working Hours
  79. COLUMN,22,Workingday
  80. COLUMN,23,Start Day Id
  81. COLUMN,24,Bundeslaender Id
  82. COLUMN,25,Datum
  83. COLUMN,26,Wochentage Id
  84. COLUMN,27,Arbeitstag Mofr
  85. COLUMN,28,Zaehler Mofr
  86. COLUMN,29,Summe Mofr
  87. COLUMN,30,Arbeitstag Mosa
  88. COLUMN,31,Zaehler Mosa
  89. COLUMN,32,Summe Mosa
  90. COLUMN,33,Feiertage Id
  91. COLUMN,34,Jahr_alt
  92. COLUMN,35,Arbeitstag Nr Jahr
  93. COLUMN,36,Gesamt Arbeitstage
  94. COLUMN,37,Soll-Std.
  95. COLUMN,38,Jahr
  96. COLUMN,39,Wochentag_Kalender_Zahl