Sollstunden_MA.iqd 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21_deop02
  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. T5."PROFILE_CODE" || ' - ' || T2."SEL_NAME" as c12,
  19. T6."PERS_DEPARTMENT" as c13,
  20. '1' as c14,
  21. (od_left(T4."WORK_LEADER_GROUP",1)) as c15,
  22. 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. (nconvert(T8."wochentage_id")) as c38,
  45. T3."CORE_WORKING_HOURS" as c39,
  46. (@CURRENT_DATE) - INTERVAL '001 00:00:00.000' as c40,
  47. (database()) as c41
  48. from "deop02"."dbo"."WORKING_PERIOD" T3,
  49. "deop02"."dbo"."EMPLOYEE" T7,
  50. "deop02"."dbo"."vPP91" T4,
  51. QSS."C:\GAPS\Portal\System\Catalogs\.\..\IQD\Zeiten\Kalender.ims" T8,
  52. (("deop02"."dbo"."CALENDAR_INFO" T9 left outer join "deop02"."dbo"."CALENDAR_PATTERN" T1 on T1."CALENDAR_INFO_ID" = T9."REFERENCE_IDENT") left outer join "deop02"."dbo"."PERSON_INFO" T6 on T9."REFERENCE_NAME" = T6."PERSON_NUMBER"),
  53. ("deop02"."dbo"."vPP43" T2 left outer join "deop02"."dbo"."PROFILE" T5 on T2."SELLER_CODE" = T5."PROFILE_CODE")
  54. 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")
  55. and (((((((T3."WORKINGDAY" = 1) and ((T4."WORK_LEADER_GROUP" || ' - ' || T4."WORKLEADER_TEXT") IN ('1000 - Kundendienst ','1110 - Kundendienst MK','1120 - Karosserie MK','1190 - Azubi MK','1500 - Auszubildende ','2000 - Karosserie ','2110 - Kundendienst WI','2120 - Karosserie WI','2190 - Azubi WI','3000 - Lack ','3110 - Kundendienst MZ','3190 - Azubi MZ'))) 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" = ((nconvert(T8."wochentage_id"))) + 1)) and (T8."datum" <= ((@CURRENT_DATE) - INTERVAL '001 00:00:00.000')))
  56. order by c6 asc
  57. END SQL
  58. COLUMN,0,Calendar Info Id
  59. COLUMN,1,Calendar Type Id
  60. COLUMN,2,Recurring Pattern Id
  61. COLUMN,3,Recurring Pattern Priority
  62. COLUMN,4,Transact Date
  63. COLUMN,5,Name
  64. COLUMN,6,Pattern_rechts_3
  65. COLUMN,7,Std_Tag
  66. COLUMN,8,Work Leader Group
  67. COLUMN,9,Workleader Text
  68. COLUMN,10,Monteur_Gruppe
  69. COLUMN,11,Monteur
  70. COLUMN,12,Pers Department
  71. COLUMN,13,Hauptbetrieb
  72. COLUMN,14,Standort
  73. COLUMN,15,Profile Code
  74. COLUMN,16,Kostenstelle
  75. COLUMN,17,Order Number
  76. COLUMN,18,Work Leader Group Id
  77. COLUMN,19,Job End Date
  78. COLUMN,20,Recurring Pattern Id_aus_Workin_Period
  79. COLUMN,21,Core Working Hours
  80. COLUMN,22,Workingday
  81. COLUMN,23,Start Day Id
  82. COLUMN,24,Bundeslaender Id
  83. COLUMN,25,Datum
  84. COLUMN,26,Wochentage Id
  85. COLUMN,27,Arbeitstag Mofr
  86. COLUMN,28,Zaehler Mofr
  87. COLUMN,29,Summe Mofr
  88. COLUMN,30,Arbeitstag Mosa
  89. COLUMN,31,Zaehler Mosa
  90. COLUMN,32,Summe Mosa
  91. COLUMN,33,Feiertage Id
  92. COLUMN,34,Jahr_alt
  93. COLUMN,35,Arbeitstag Nr Jahr
  94. COLUMN,36,Gesamt Arbeitstage
  95. COLUMN,37,Wochentag_Kalender_Zahl
  96. COLUMN,38,Soll-Std.
  97. COLUMN,39,Jahr
  98. COLUMN,40,Mandant