svn path=/Database/trunk/; revision=6324
This commit is contained in:
0
CAD/.gitignore
vendored
0
CAD/.gitignore
vendored
17
CAD/CAD_IND.SRC
Normal file
17
CAD/CAD_IND.SRC
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/*
|
||||
* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
*/
|
||||
|
||||
CREATE INDEX cad_i_cad_tekening1 ON cad_tekening(ins_discipline_key);
|
||||
CREATE INDEX cad_i_cad_tekening2 ON cad_tekening(alg_locatie_key);
|
||||
CREATE INDEX cad_i_cad_tekening3 ON cad_tekening(alg_verdieping_key);
|
||||
|
||||
#endif // CAD
|
||||
14
CAD/CAD_INI.SRC
Normal file
14
CAD/CAD_INI.SRC
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH Aangemaakt
|
||||
*/
|
||||
|
||||
_FAC_MODULE('CAD','AutoCAD Map koppeling')
|
||||
|
||||
#endif // CAD
|
||||
164
CAD/CAD_PAC.SRC
Normal file
164
CAD/CAD_PAC.SRC
Normal file
@@ -0,0 +1,164 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* 22-07-1998 KTH - diverse -- vervangen door slash-sterretje/sterretje-slash
|
||||
* - diverse kleine aanpassingen
|
||||
* 21-07-1998 BIV Procedure cad_p_ruimte_update_opp toegevoegd
|
||||
* 21-07-1998 BIV Functie cad_f_ruimte_get_tekeningnaam() toegevoegd.
|
||||
* 09-07-1998 PF Geen exception meer, en PRAGMA WNPS toegevoegd
|
||||
* 08-07-1998 PF Functies gebruiken TABLE ins_deel ipv VIEW ins_v_aanwezigdeel, vanwege autorisatie.
|
||||
* De functie wordt ook door andere users (FCLTCAD) gebruikt, en die ziet niets
|
||||
* in de autorisatie views
|
||||
* 07-07-1998 BIV Functies cad_f_deel_get_locatie_key, ..._get_verdieping_key, ..._get_discipline_key,
|
||||
* ..._get_tekeningnaam toegevoegd.
|
||||
* --- 01.38 ---
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH Aangemaakt
|
||||
*/
|
||||
|
||||
CREATE OR REPLACE PACKAGE cad AS
|
||||
FUNCTION cad_f_deel_get_locatie(key IN NUMBER) RETURN NUMBER;
|
||||
FUNCTION cad_f_deel_get_verdieping(key IN NUMBER) RETURN NUMBER;
|
||||
FUNCTION cad_f_deel_get_discipline(key IN NUMBER) RETURN NUMBER;
|
||||
FUNCTION cad_f_deel_get_tekeningnaam(key IN NUMBER) RETURN VARCHAR2;
|
||||
FUNCTION cad_f_ruimte_get_tekeningnaam(key IN NUMBER) RETURN VARCHAR2;
|
||||
PROCEDURE cad_p_ruimte_update_opp(key IN NUMBER, VloerOpp IN NUMBER);
|
||||
|
||||
/* garandeer dat de functies de database-state en package-state niet beinvloeden
|
||||
* (anders kunnen ze niet zondermeer in een view worden gebruikt)
|
||||
*/
|
||||
PRAGMA RESTRICT_REFERENCES (cad_f_deel_get_locatie, WNDS, WNPS);
|
||||
PRAGMA RESTRICT_REFERENCES (cad_f_deel_get_verdieping, WNDS, WNPS);
|
||||
PRAGMA RESTRICT_REFERENCES (cad_f_deel_get_discipline, WNDS, WNPS);
|
||||
PRAGMA RESTRICT_REFERENCES (cad_f_deel_get_tekeningnaam, WNDS, WNPS);
|
||||
PRAGMA RESTRICT_REFERENCES (cad_f_ruimte_get_tekeningnaam, WNDS, WNPS);
|
||||
END cad;
|
||||
/
|
||||
|
||||
CREATE OR REPLACE PACKAGE BODY cad AS
|
||||
|
||||
FUNCTION cad_f_deel_get_locatie(Key IN NUMBER) RETURN NUMBER IS
|
||||
locatie_key NUMBER(10);
|
||||
BEGIN
|
||||
SELECT ins_alg_locatie_key
|
||||
INTO locatie_key
|
||||
FROM all_v_aanwezigdeel
|
||||
/* FROM ins_deel -- de tabel i.o.m. PF view gebruiken */
|
||||
WHERE ins_deel_key = Key;
|
||||
RETURN locatie_key;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND THEN
|
||||
RETURN NULL;
|
||||
END cad_f_deel_get_locatie;
|
||||
|
||||
FUNCTION cad_f_deel_get_verdieping(Key IN NUMBER) RETURN NUMBER IS
|
||||
verdieping_key NUMBER(10);
|
||||
BEGIN
|
||||
SELECT ALG_G.alg_verdieping_key
|
||||
INTO verdieping_key
|
||||
FROM alg_ruimte ALG_G, ins_deel INS_D /* de tabel! */
|
||||
WHERE INS_D.ins_deel_key = Key
|
||||
AND INS_D.ins_alg_ruimte_key = ALG_G.alg_ruimte_key;
|
||||
RETURN verdieping_key;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND THEN
|
||||
RETURN NULL;
|
||||
END cad_f_deel_get_verdieping;
|
||||
|
||||
FUNCTION cad_f_deel_get_discipline(Key IN NUMBER) RETURN NUMBER IS
|
||||
discipline_key NUMBER(10);
|
||||
BEGIN
|
||||
SELECT ins_discipline_key
|
||||
INTO discipline_key
|
||||
FROM all_v_aanwezigdeel
|
||||
/* FROM ins_deel -- de tabel! */
|
||||
WHERE ins_deel_key = Key;
|
||||
RETURN discipline_key;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND THEN
|
||||
RETURN NULL;
|
||||
END cad_f_deel_get_discipline;
|
||||
|
||||
FUNCTION cad_f_deel_get_tekeningnaam(Key IN NUMBER) RETURN VARCHAR2 IS
|
||||
tekeningnaam VARCHAR2(256);
|
||||
locatie_key NUMBER(10);
|
||||
verdieping_key NUMBER(10);
|
||||
discipline_key NUMBER(10);
|
||||
BEGIN
|
||||
locatie_key := cad_f_deel_get_locatie(Key);
|
||||
verdieping_key := cad_f_deel_get_verdieping(Key);
|
||||
discipline_key := cad_f_deel_get_discipline(Key);
|
||||
|
||||
IF (locatie_key IS NOT NULL AND
|
||||
verdieping_key IS NOT NULL AND
|
||||
discipline_key IS NOT NULL) THEN
|
||||
BEGIN
|
||||
SELECT cad_tekening_filenaam
|
||||
INTO tekeningnaam
|
||||
FROM cad_v_cad_tekening /* ja deze! */
|
||||
WHERE alg_locatie_key = locatie_key
|
||||
AND alg_verdieping_key = verdieping_key
|
||||
AND ins_discipline_key = discipline_key;
|
||||
RETURN tekeningnaam;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND THEN
|
||||
/* raise_application_error(-20000, 'ins_m166'); */
|
||||
RETURN NULL;
|
||||
END;
|
||||
ELSE
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
END cad_f_deel_get_tekeningnaam;
|
||||
|
||||
FUNCTION cad_f_ruimte_get_tekeningnaam(Key IN NUMBER) RETURN VARCHAR2 IS
|
||||
tekeningnaam VARCHAR2(256);
|
||||
locatie_key NUMBER(10);
|
||||
verdieping_key NUMBER(10);
|
||||
BEGIN
|
||||
SELECT alg_locatie_key, alg_verdieping_key
|
||||
INTO locatie_key, verdieping_key
|
||||
FROM alg_v_ruimte_gegevens
|
||||
WHERE alg_ruimte_key = Key;
|
||||
|
||||
IF (locatie_key IS NOT NULL AND
|
||||
verdieping_key IS NOT NULL) THEN
|
||||
BEGIN
|
||||
SELECT cad_tekening_filenaam
|
||||
INTO tekeningnaam
|
||||
FROM cad_v_cad_tekening /* ja deze! */
|
||||
WHERE alg_locatie_key = locatie_key
|
||||
AND alg_verdieping_key = verdieping_key
|
||||
AND cad_tekening_type = 'C';
|
||||
RETURN tekeningnaam;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND THEN
|
||||
/* raise_application_error(-20000, 'ins_m166'); */
|
||||
RETURN NULL;
|
||||
END;
|
||||
ELSE
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
END cad_f_ruimte_get_tekeningnaam;
|
||||
|
||||
/*
|
||||
* CAD_P_RUIMTE_UPDATE_OPP wordt aangeroepen vanuit AutoCAD
|
||||
* en wijzigt de vloeroppervlakte van een opgegeven ruimte
|
||||
*
|
||||
* Merk op dat een eventuele EXCEPTION hier niet expliciet wordt afgevangen!
|
||||
*/
|
||||
PROCEDURE cad_p_ruimte_update_opp(Key IN NUMBER, VloerOpp IN NUMBER) IS
|
||||
BEGIN
|
||||
/* alleen indien het een logisch aanwezige ruimte betreft passen we de opp aan */
|
||||
UPDATE alg_v_aanwezigruimte
|
||||
SET alg_ruimte_bruto_vloeropp = VloerOpp
|
||||
WHERE alg_ruimte_key = Key;
|
||||
COMMIT;
|
||||
END cad_p_ruimte_update_opp;
|
||||
|
||||
END cad;
|
||||
/
|
||||
|
||||
#endif // CAD
|
||||
14
CAD/CAD_SEQ.SRC
Normal file
14
CAD/CAD_SEQ.SRC
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
*/
|
||||
|
||||
CREATE SEQUENCE cad_s_cad_tekening_key MINVALUE 1;
|
||||
|
||||
#endif // CAD
|
||||
45
CAD/CAD_TAB.SRC
Normal file
45
CAD/CAD_TAB.SRC
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* 30-06-1998 BIV LOG#1902: NOT NULL van CAD_TEKENING.INS_DISCIPLINE_KEY eraf
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
*/
|
||||
|
||||
#include "comsql.h"
|
||||
|
||||
CREATE_TABLE(cad_tekening, NORMAAL_PRIVILEGE)
|
||||
(
|
||||
cad_tekening_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_k_cad_tekening_key PRIMARY KEY,
|
||||
ins_discipline_key /* als deze leeg is geeft betreft het de Contour-tekening */
|
||||
NUMBER(10)
|
||||
--#1902 NOT_NULL(ins_discipline_key, cad_c_ins_discipline_key)
|
||||
CONSTRAINT cad_r_ins_discipline_key REFERENCES ins_tab_discipline(ins_discipline_key),
|
||||
alg_locatie_key
|
||||
NUMBER(10)
|
||||
NOT_NULL(alg_locatie_key, cad_c_alg_locatie_key)
|
||||
CONSTRAINT cad_r_alg_locatie_key REFERENCES alg_locatie(alg_locatie_key),
|
||||
alg_verdieping_key /* is optioneel NULL */
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_r_alg_verdieping_key REFERENCES alg_verdieping(alg_verdieping_key),
|
||||
cad_tekening_filenaam /* excl. leading PATH (komt uit INI-file), incl. extension */
|
||||
VARCHAR2(256)
|
||||
NOT_NULL(cad_tekening_filenaam, cad_c_cad_tekening_filenaam),
|
||||
cad_tekening_type
|
||||
VARCHAR2(3)
|
||||
NOT_NULL (cad_tekening_type, cad_c_cad_tekening_type)
|
||||
CONSTRAINT cad_c_cad_tekening_type2 CHECK(cad_tekening_type = 'P' OR cad_tekening_type = 'C'
|
||||
OR cad_tekening_type = 'D'),
|
||||
cad_tekening_geimporteerd /* geeft aan of de tekening al is geimporteerd: */
|
||||
DATE /* NULL indien niet, anders datum van importeren */
|
||||
DEFAULT NULLDATUM,
|
||||
CONSTRAINT cad_u_cad_tekening UNIQUE(ins_discipline_key,alg_locatie_key,alg_verdieping_key)
|
||||
);
|
||||
|
||||
#endif // CAD
|
||||
22
CAD/CAD_TRI.SRC
Normal file
22
CAD/CAD_TRI.SRC
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
*/
|
||||
|
||||
#include "comsql.h"
|
||||
|
||||
CREATE_TRIGGER(cad_t_cad_tekening_B_IU)
|
||||
BEFORE INSERT OR UPDATE ON cad_tekening
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE_PRIMARY_KEY(cad_tekening_key, cad_s_cad_tekening_key);
|
||||
END;
|
||||
/
|
||||
|
||||
#endif // CAD
|
||||
135
CAD/CAD_VIE.SRC
Normal file
135
CAD/CAD_VIE.SRC
Normal file
@@ -0,0 +1,135 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* 23-07-1998 KTH LOG#1938: cad_vie.src opgesplitst in cad_vie1.src en cad_vie2.src
|
||||
* 21-07-1998 BIV View cad_v_alg_ruimte_tekening toegevoegd.
|
||||
* 21-07-1998 BIV View cad_v_cad_tekening uitgebreidt met CAD_TEKENING_TYPE.
|
||||
* 16-07-1998 BIV View toegevoegd voor Plattegrond-, Contour- en Disciplinetekeningen.
|
||||
* 09-07-1998 KTH Dubbel stukje cad_v_ins_deel_tekening verwijderd
|
||||
* 09-07-1998 PF View cad_v_ins_deel_tekening toegevoegd
|
||||
* 08-07-1998 PF View cad_v_cad_tekening toegevoegd (voor raadplegen vanuit FCLTCAD)
|
||||
* --- 01.38 ---
|
||||
* 01-07-1998 KTH - CAD_V_ALG_GEBOUW toegevoegd (voor PF)
|
||||
* - CAD_V_ALG_RUIMTE.ALG_VERDIEPING_KEY toegevoegd (voor PF)
|
||||
* 29-06-1998 KTH LOG#1905: CAD_V_ALG_RUIMTE en CAD_V_INS_DEEL toegevoegd
|
||||
* --- 01.37 ---
|
||||
* 08-06-1998 BIV LOG#1824: CAD_V_CAD_TEKENING_GEGEVENS toegevoegd t.b.v. overzichtscherm CAD011.
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
*/
|
||||
|
||||
#include "comsql.h"
|
||||
|
||||
CREATE_VIEW(cad_v_cad_aanwezigtekening, NORMAAL_PRIVILEGE) AS
|
||||
SELECT * FROM cad_tekening C_T
|
||||
WHERE C_T.ins_discipline_key IN (SELECT ins_discipline_key
|
||||
FROM ins_discipline)
|
||||
OR C_T.ins_discipline_key IS NULL;
|
||||
|
||||
CREATE_VIEW(cad_v_cad_tekening_gegevens, NORMAAL_PRIVILEGE)
|
||||
(cad_tekening_key,
|
||||
alg_locatie_key,
|
||||
alg_locatie_code,
|
||||
alg_gebouw_key,
|
||||
alg_gebouw_code,
|
||||
alg_verdieping_key,
|
||||
alg_verdieping_omschrijving,
|
||||
ins_discipline_key,
|
||||
ins_discipline_omschrijving) AS
|
||||
SELECT C_T.cad_tekening_key,
|
||||
C_T.alg_locatie_key,
|
||||
ALG_L.alg_locatie_code,
|
||||
ALG_G.alg_gebouw_key,
|
||||
ALG_G.alg_gebouw_code,
|
||||
C_T.alg_verdieping_key,
|
||||
ALG_V.alg_verdieping_omschrijving,
|
||||
C_T.ins_discipline_key,
|
||||
INS_D.ins_discipline_omschrijving
|
||||
FROM alg_locatie ALG_L,
|
||||
alg_verdieping ALG_V,
|
||||
alg_gebouw ALG_G,
|
||||
ins_discipline INS_D,
|
||||
cad_v_cad_aanwezigtekening C_T
|
||||
WHERE C_T.alg_locatie_key = ALG_L.alg_locatie_key
|
||||
AND C_T.alg_verdieping_key = ALG_V.alg_verdieping_key (+)
|
||||
AND ALG_V.alg_gebouw_key = ALG_G.alg_gebouw_key (+)
|
||||
AND C_T.ins_discipline_key = INS_D.ins_discipline_key (+);
|
||||
|
||||
CREATE_VIEW(cad_v_plattegrond, CAD_PRIVILEGE) AS
|
||||
SELECT * FROM cad_tekening
|
||||
WHERE UPPER(cad_tekening_type) = 'P';
|
||||
|
||||
CREATE_VIEW(cad_v_contour, CAD_PRIVILEGE) AS
|
||||
SELECT * FROM cad_tekening
|
||||
WHERE UPPER(cad_tekening_type) = 'C';
|
||||
|
||||
CREATE_VIEW(cad_v_discipline, CAD_PRIVILEGE) AS
|
||||
SELECT * FROM cad_tekening
|
||||
WHERE UPPER(cad_tekening_type) = 'D';
|
||||
|
||||
/* 29-06-1998 KTH LOG#1905
|
||||
* Views die door de AutoCAD Map-user FCLTCAD worden geraadpleegd.
|
||||
* Bij die user heet de SYNONYM ernaar toe wellicht anders.
|
||||
*/
|
||||
|
||||
CREATE_VIEW(cad_v_alg_gebouw, CAD_PRIVILEGE)
|
||||
(alg_gebouw_key,
|
||||
alg_gebouw_cadlabel,
|
||||
alg_gebouw_code) AS
|
||||
SELECT alg_gebouw_key,
|
||||
alg_gebouw_code,
|
||||
alg_gebouw_code
|
||||
FROM alg_v_aanweziggebouw;
|
||||
|
||||
CREATE_VIEW(cad_v_alg_ruimte, CAD_PRIVILEGE)
|
||||
(alg_ruimte_key,
|
||||
alg_ruimte_cadlabel,
|
||||
alg_ruimte_nr,
|
||||
alg_verdieping_key) AS
|
||||
SELECT alg_ruimte_key,
|
||||
alg_ruimte_nr,
|
||||
alg_ruimte_nr,
|
||||
alg_verdieping_key
|
||||
FROM alg_v_aanwezigruimte;
|
||||
|
||||
/* View met ALLE tekeningen, ongeacht de autorisatie; minimale kolommen, gebruikt in CAD_PAC.SRC */
|
||||
CREATE_VIEW(cad_v_cad_tekening, CAD_PRIVILEGE) AS
|
||||
SELECT ins_discipline_key,
|
||||
alg_locatie_key,
|
||||
alg_verdieping_key,
|
||||
cad_tekening_type,
|
||||
cad_tekening_filenaam
|
||||
FROM cad_tekening C_T;
|
||||
|
||||
#ifdef INS
|
||||
/* 29-06-1998 KTH LOG#1905
|
||||
* View CAD_V_INS_DEEL wordt door de AutoCAD Map-user FCLTCAD geraadpleegd.
|
||||
* Bij die user heet de SYNONYM ernaar toe wellicht anders.
|
||||
*/
|
||||
#ifdef AKZ
|
||||
/* voor AKZ wordt alleen het laatste stuk van de omschrijving gebruikt */
|
||||
CREATE_VIEW(cad_v_ins_deel, CAD_PRIVILEGE)
|
||||
(ins_deel_key,
|
||||
ins_deel_cadlabel,
|
||||
ins_deel_upper) AS
|
||||
SELECT ins_deel_key,
|
||||
SUBSTR(ins_deel_upper, LENGTH(ins_deel_upper)-5), /* laatste 5 karakters */
|
||||
ins_deel_upper
|
||||
FROM ins_deel
|
||||
WHERE ins_deel_verwijder IS NULL; /* alleen de logisch aanwezige delen */
|
||||
#else
|
||||
CREATE_VIEW(cad_v_ins_deel, CAD_PRIVILEGE)
|
||||
(ins_deel_key,
|
||||
ins_deel_cadlabel,
|
||||
ins_deel_upper) AS
|
||||
SELECT ins_deel_key,
|
||||
ins_deel_upper,
|
||||
ins_deel_upper
|
||||
FROM ins_deel
|
||||
WHERE D.ins_deel_verwijder IS NULL; /* alleen de logisch aanwezige delen */
|
||||
#endif // AKZ
|
||||
#endif // INS
|
||||
|
||||
#endif // CAD
|
||||
Reference in New Issue
Block a user