cli:franke:shared_data

This is an old revision of the document!


Shared production data

DB Server 10.100.145.20 (fkt20g.fa.franke.world)
SB Server Port 5432
DBMS Postgresql
ODBC Driver 32bit, 64bit
Database nameandon_FWK
Username(readonly)
Password



Entities

Entity
Name Description Attributes
Name Description Type Identifier
prodline Production resources listcodiceProduction resource unique identifiervarchar Yes
descrizioProduction resource namevarchar
codrepDepartment unique identifiervarchar
descrepDepartment descriptionvarchar
codstabPlant identifiervarchar
descstabPlant descriptionvarchar
unitprod Unique unit of production, produced itemscodiceProduced item unique identifiervarchar YES
codartProduct codevarchar
dartProduct descriptionvarchar
procordWork order (from ERP)varchar
qtaprevWork order total quantity to be produceddouble
unitaProduced items for each work cycle (generally 1)double
tmcrTime Epoch of the tracked production unit (seconds since 01/01/1970)long
datacrDate of the tracked production unit (YYYYMMGG)varchar
oracrTime of the tracked production unit (HH:MM:SS)varchar
causanc Non compliant causes listcodiceCause unique identifiervarchar YES
descrizioCause descriptionvarchar
causafm Downtime causes listcodiceDowntime unique identifiervarchar YES
descrizioDowntime description of the monitored resourcevarchar
tipofmDowntime type: F = unplanned downtime, M = microstop, P = planned downtimevarchar
setupDowntime for setup reason (flag): 1 = setup kind, 0 = general downtimeinteger

Relationships

Relationship
Name Description Components Attributes
Name Description Type
regprod Each row refers to a production event prodline, unitprod dataEvent date (YYYYMMGG)varchar
oraEvent time (HH:MM:SS)varchar
tmEvent Time Epochlong
qtaNumber of produced itemsdouble
regnc Each row refers to a non compliant production event prodline, unitprod, causanc dataEvent date (YYYYMMGG)varchar
oraEvent time (HH:MM:SS)varchar
tmEvent Time Epochlong
qtaNumber of non compliant produced itemsdouble
regfm Each row refers to a begin or an end of a downtime prodline, causafm dataEvent date (YYYYMMGG)varchar
oraEvent time (HH:MM:SS)varchar
tmEvent Time Epochlong
tmdiffTime difference from end and begin of the downtime eventslong
tipoeventoDowntime event type: INFM=downtime start, FIFM=donwtime endlong
TableForeign keys
prodline(codice, descrizio, codrep, descrep, codstab, descstab)
unitprod(codice, codart, dart, procord, qtaprev, unita, tmcr, datacr, oracr)
causanc(codice, descrizio)
causafm(codice, descrizio, tipofm, setup)
regprod(codice, data, ora, tm, qta, codlot, codubi)- codlot foreign key on unitprod.codice
- codubi foreign key on prodline.codice
regnc(codice, data, ora, tm, qta, codlot, codubi, caudef)- codlot foreign key on unitprod.codice
- codubi foreign key on prodline.codice
- caudef foreign key on causanc.codice
regfm(codice, data, ora, tm, tmdiff, tipoevento, codubi, caufm)- codubi foreign key on prodline.codice
- caufm foreign key on causafm.codice

Produced items on June 18th 2018 with date, time, unique identifier, production resource description, department description, article code (model) and work order, sorted by event time epoch

SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, unitprod.dart, unitprod.procord FROM regprod 
INNER JOIN prodline ON prodline.codice=regprod.codubi
INNER JOIN unitprod ON unitprod.codice=regprod.codlot
WHERE DATA='20180618'
ORDER BY tm

Conteggio dei pezzi prodotti dopo il 17 Maggio (compreso) raggruppati per giorno, per prodotto e ordini di produzione, nella linea 04

SELECT DATA, unitprod.dart, unitprod.procord, SUM(qta) AS pezzi FROM regprod
INNER JOIN unitprod ON unitprod.codice=regprod.codlot
WHERE regprod.codubi='04' AND regprod.data>='20170517'
GROUP BY DATA, dart, procord

Estrarre la lista delle fermate (inizio, fine) della linea 04 dalle ore 06:00 alle ore 14:00 del giorno 17 Maggio, con data, ora, differenza temporale tra due eventi in minuti, tipo di evento, descrizione della causa di fermo, tipo di fermo, setup (1,0)

SELECT DATA, ora, tmdiff/60 AS dtm, tipoevento, causafm.descrizio AS dfermo, causafm.tipofm, causafm.setup FROM regfm
INNER JOIN causafm ON causafm.codice=regfm.caufm
WHERE codubi='04' AND DATA='20170517' AND ora>='06:00' AND ora<='14:00'
ORDER BY tm

  • cli/franke/shared_data.1535365517.txt.gz
  • Last modified: 2018/08/27 12:25
  • by f.zoppini