"localhost:/firebird/data/ILICHEVSK2.FDB". Процедуры Previous topic Chapter index Next topic

SAMPLER_BARCODE

 

Входные параметры

Параметр

Тип

Описание

INVOICEID

INTEGER

 

 

Выходные параметры

Параметр

Тип

Описание

ABARCODE

VARCHAR(30)

 

TBARCODE

VARCHAR(30)

 

ATRANSPORTNUMBER

VARCHAR(30)

 

TTRANSPORTNUMBER

VARCHAR(30)

 

APLATFORMSHORTNAME

VARCHAR(30)

 

TPLATFORMSHORTNAME

VARCHAR(30)

 

ASILAGEN

VARCHAR(255)

 

TSILAGEN

VARCHAR(255)

 

AINFECTIONNAME

VARCHAR(100)

 

TINFECTIONNAME

VARCHAR(100)

 

ASTATEHUMIDITY

VARCHAR(255)

 

TSTATEHUMIDITY

VARCHAR(255)

 

ACROPCLASSNAME

VARCHAR(255)

 

TCROPCLASSNAME

VARCHAR(255)

 

AHUMIDITY

VARCHAR(20)

 

THUMIDITY

VARCHAR(20)

 

AINVENTORYID

INTEGER

 

TINVENTORYID

INTEGER

 

OPERATIONID

INTEGER

 

 

Описание

(Нет описания для процедуры SAMPLER_BARCODE)

 

Определение

CREATE PROCEDURE SAMPLER_BARCODE(
    INVOICEID INTEGER)
RETURNS (
    ABARCODE VARCHAR(30),
    TBARCODE VARCHAR(30),
    ATRANSPORTNUMBER VARCHAR(30),
    TTRANSPORTNUMBER VARCHAR(30),
    APLATFORMSHORTNAME VARCHAR(30),
    TPLATFORMSHORTNAME VARCHAR(30),
    ASILAGEN VARCHAR(255),
    TSILAGEN VARCHAR(255),
    AINFECTIONNAME VARCHAR(100),
    TINFECTIONNAME VARCHAR(100),
    ASTATEHUMIDITY VARCHAR(255),
    TSTATEHUMIDITY VARCHAR(255),
    ACROPCLASSNAME VARCHAR(255),
    TCROPCLASSNAME VARCHAR(255),
    AHUMIDITY VARCHAR(20),
    THUMIDITY VARCHAR(20),
    AINVENTORYID INTEGER,
    TINVENTORYID INTEGER,
    OPERATIONID INTEGER)
AS
begin
  select ittransport.barcode, ittransport.transportnumber, platforms.platformshortname,
    case it.operationid
      when 1 then silage.name
      when 5 then sampler_silagename.silagestring
    end, 
    Infection.selectvalue, Humidity.selectvalue,
    quality_cropfullname.cropfullname, quality_select.humidity, IT.inventoryid, it.operationid
  from IT
    left join routechema on routechema.routechemaid = IT.routeid
    left join platforms on platforms.platformid = routechema.platformid
    left join sampler_silagename(it.inventoryid) on 0 = 0
    left join silage on it.silageid = silage.silageid
    left join quality_select(it.samplerqualityid) on 0 = 0
    left join quality_cropfullname(quality_select.cropid, quality_select.classid, quality_select.sortid, 0) on 0 = 0
    left join quality_select_values(19, quality_select.infectionid, 0) Infection on 0 = 0
    left join quality_select_values(102, quality_select.statehumidity, 0) Humidity on 0 = 0
    left join quality_select_values(103, quality_select.statedirt, 0) Dirt on 0 = 0
    left join ittransport on it.inventoryid = ittransport.inventoryid
  where it.invoiceid = :invoiceid
    and it.state in (0, -3, -4)
    and ittransport.transporttypeid = 0
  into :abarcode, :atransportnumber, :aplatformshortname, :asilagen, :ainfectionname,
       :astatehumidity, :acropclassname, :ahumidity, :ainventoryid, :operationid;

  select ittransport.barcode, ittransport.transportnumber, platforms.platformshortname,
    case it.operationid
      when 1 then silage.name
      when 5 then sampler_silagename.silagestring
    end, 
    Infection.selectvalue, Humidity.selectvalue,
    quality_cropfullname.cropfullname, quality_select.humidity, IT.inventoryid
  from IT
    left join routechema on routechema.routechemaid = IT.routeid
    left join platforms on platforms.platformid = routechema.platformid
    left join sampler_silagename(it.inventoryid) on 0 = 0
    left join silage on it.silageid = silage.silageid
    left join quality_select(it.samplerqualityid) on 0 = 0
    left join quality_cropfullname(quality_select.cropid, quality_select.classid, quality_select.sortid, 0) on 0 = 0
    left join quality_select_values(19, quality_select.infectionid, 0) Infection on 0 = 0
    left join quality_select_values(102, quality_select.statehumidity, 0) Humidity on 0 = 0
    left join quality_select_values(103, quality_select.statedirt, 0) Dirt on 0 = 0
    left join ittransport on it.inventoryid = ittransport.inventoryid
  where it.invoiceid = :invoiceid
    and it.state in (0, -3, -4)
    and ittransport.transporttypeid = 1
  into :tbarcode, :ttransportnumber, :tplatformshortname, :tsilagen, :tinfectionname,
       :tstatehumidity, :tcropclassname, :thumidity, :tinventoryid;
  suspend;
end

 

     Previous topic Chapter index Next topic