|
| 1 | +with |
| 2 | + codes2codelocales as |
| 3 | + ( |
| 4 | + select t6.cdl_name as cod_name, t7.cdl_name as cod_cod_name, t14.cod_oid |
| 5 | + from servicedesk.itsm_codes t14 |
| 6 | + left outer join servicedesk.itsm_codes_locale t6 on (t6.cdl_cod_oid=t14.cod_oid) |
| 7 | + left outer join servicedesk.itsm_codes_locale t7 on (t7.cdl_cod_oid=t14.cod_cod_oid) |
| 8 | + ) |
| 9 | + , incident as |
| 10 | + ( |
| 11 | + select t1.*, |
| 12 | + c2cl1.cod_name as "closure code", c2cl1.cod_cod_name as "closure code parent", |
| 13 | + c2cl2.cod_name as "reason caused code", c2cl2.cod_cod_name as "reason caused code parent", |
| 14 | + t11.cdl_name "severity", t13.cdl_name "business impact", t16.cdl_name "priority", |
| 15 | + t2.rct_name "status", t12.rct_name "category", t99.rct_name "folder" |
| 16 | + from servicedesk.itsm_incidents t1 |
| 17 | + join servicedesk.itsm_codes_locale t11 on (t1.inc_sev_oid=t11.cdl_cod_oid) |
| 18 | + join servicedesk.itsm_codes_locale t13 on (t1.inc_imp_oid=t13.cdl_cod_oid) |
| 19 | + join servicedesk.itsm_codes_locale t16 on (t1.inc_pri_oid=t16.cdl_cod_oid) |
| 20 | + join servicedeskrepo.rep_codes_text t2 on (t1.inc_sta_oid=t2.rct_rcd_oid) |
| 21 | + join servicedeskrepo.rep_codes_text t12 on (t1.inc_cat_oid=t12.rct_rcd_oid) |
| 22 | + join servicedeskrepo.rep_codes_text t99 on (t1.inc_poo_oid=t99.rct_rcd_oid) |
| 23 | + left outer join codes2codelocales c2cl1 on (t1.inc_clo_oid=c2cl1.cod_oid) |
| 24 | + left outer join codes2codelocales c2cl2 on (t1.inc_cla_oid=c2cl2.cod_oid) |
| 25 | + where t1."reg_created" between sysdate-1 and sysdate |
| 26 | + ) |
| 27 | + , workgrouphistory as |
| 28 | + ( |
| 29 | + select i.inc_id |
| 30 | + , max(t101.hin_subject) keep (dense_rank first order by (t101.reg_created)) as "first" |
| 31 | + , max(t101.hin_subject) keep (dense_rank last order by (t101.reg_created)) as "last" |
| 32 | + from |
| 33 | + servicedesk.itsm_historylines_incident t101 |
| 34 | + join incident i on (t101.hin_inc_oid = i.inc_oid) |
| 35 | +-- from servicedesk.itsm_incidents i (t101.hin_inc_oid = i.inc_oid) |
| 36 | + where t101.hin_subject like 'to workgroup from%' |
| 37 | +-- and i."reg_created" between sysdate-1 and sysdate |
| 38 | + group by i.inc_id |
| 39 | + ) |
| 40 | +select |
| 41 | + incident.inc_id "id" |
| 42 | + ,incident."status" |
| 43 | + ,incident.inc_description "description" |
| 44 | + ,t4.wog_searchcode "workgroup" |
| 45 | + ,t5.per_searchcode "person" |
| 46 | + ,incident.inc_solution "solution" |
| 47 | + ,incident."closure code" |
| 48 | + ,incident."closure code parent" |
| 49 | + ,incident."reason caused code" |
| 50 | + ,incident."reason caused code parent" |
| 51 | + ,t10.cit_searchcode "ci" |
| 52 | + ,incident."severity" |
| 53 | + ,incident."category" |
| 54 | + ,incident."business impact" |
| 55 | + ,incident."priority" |
| 56 | + ,to_char(incident."reg_created", 'dd-mm-yy hh24:mi:ss') "registered" |
| 57 | + ,to_char(incident."inc_deadline", 'dd-mm-yy hh24:mi:ss') "deadline" |
| 58 | + ,to_char(incident."inc_actualfinish", 'dd-mm-yy hh24:mi:ss') "finish" |
| 59 | + ,t3.icf_incshorttext3 "message group" |
| 60 | + ,t3.icf_incshorttext4 "application" |
| 61 | + ,t3.icf_incshorttext2 "msg id" |
| 62 | + ,incident."folder" |
| 63 | + ,workgrouphistory."first" "first wg" |
| 64 | + ,workgrouphistory."last" "last wg" |
| 65 | + ,t102.hin_subject "frirst pri" |
| 66 | +from incident |
| 67 | +join servicedesk.itsm_inc_custom_fields t3 on (incident.inc_oid=t3.icf_inc_oid) |
| 68 | +join servicedesk.itsm_workgroups t4 on (incident.inc_assign_workgroup=t4.wog_oid) |
| 69 | +join workgrouphistory on (incident.inc_id = workgrouphistory.inc_id) |
| 70 | +left outer join servicedesk.itsm_persons t5 on (incident.inc_assign_person_to=t5.per_oid) |
| 71 | +left outer join servicedesk.itsm_configuration_items t10 on (incident.inc_cit_oid=t10.cit_oid) |
| 72 | +left outer join servicedesk.itsm_historylines_incident t102 on (incident.inc_oid = t102.hin_inc_oid and t102.hin_subject like 'priority set to%') |
0 commit comments