Переглянути джерело

TODO kosztorys dla koszty dodatkowe nie dziala po ID_ZASOB - przemielilem tabele z pola tekstowego i ustawilem tam ID_ZASOBU

a.binder 8 роки тому
батько
коміт
5d5fca4402

+ 4 - 4
SE/se-lib/ProjectKosztorysSchema.php

@@ -28,7 +28,7 @@ class ProjectKosztorysSchema {
 					left join CRM_LISTA_ZASOBOW c  on(c.PARENT_ID = z.ID)
 					left join CRM_LISTA_ZASOBOW a  on(a.ID  = z.ALIAS_ID and z.ALIAS_ID > 0)
 					left join CRM_LISTA_ZASOBOW za on(za.ID = c.ALIAS_ID and c.ALIAS_ID > 0)
-				where z.PARENT_ID = 22444  -- TODO how to find ID, Typespecial with link
+				where z.PARENT_ID = 22444  -- TODO how to find ID, Typespecial with link (maybe Child of table IN7_MK_BAZA_DYSTRYBUCJI )
 			");
 			$sth->execute();
 			$rawConf = $sth->fetchAll();
@@ -37,9 +37,9 @@ class ProjectKosztorysSchema {
 			$conf['layer'] = array();
 			foreach ($rawConf as $z) {
 				if (('INNE' == $z['TYPE']) or ('TYP_KOSZTU' == $z['TYPE']) ) {
-					if (!array_key_exists($z['ID'], $conf['type'])) {
-						$conf['type'][$z['ID']] = $z['DESC'];
-					}
+				//	if (!array_key_exists($z['ID'], $conf['type'])) {
+						$conf['type'][$z['ID']] = $z['DESC']; //? TODO to nie psuje przypadkiem, jak ten sam typ jest uzyty dla paru tabel?
+				//	}
 				}
 			}
 			foreach ($rawConf as $z) {

+ 5 - 0
SE/superedit-DB_PROCEDURES_CREATE.php

@@ -1360,6 +1360,11 @@ update Rozdzielcza_struktura_wewnetrzna_wsg84 as b
 							) as p on   ST_Intersects(p.the_geom,b.the_geom)
 							set b.ID_PROJECT=p.ID where  b.ID_PROJECT<1  ;
 
+update Rozdzielcza_Kabel_Swiatlowodowy_wsg84 as b 
+							inner join (
+							select p.ID , p.the_geom from IN7_MK_BAZA_DYSTRYBUCJI_temp as p    group by p.ID order by ST_Area(p.the_geom) 
+							) as p on   ST_Intersects(p.the_geom,b.the_geom)
+							set b.ID_PROJECT=p.ID where  b.ID_PROJECT<1  ;
 
 END
 ";