diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index dfb390e..e32df70 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; @@ -81,4 +82,21 @@ return pgLineHoleList; } + public List getLineLengthStatic(String roadName){ + List pgPipeLineLengthStaticList=new ArrayList<>(); + String sql="select t.linename,sum(p.length) from PG_LINEHOLE t,pg_pileacu p,pg_road r where t.pileacuid=p.id and " + + "p.id in (select id from pg_road where roadname = '"+roadName+"') group by linename"; + List objects=this.getSession().createSQLQuery(sql).list(); + + for(Object[] objects1:objects){ + PgPipeLineLengthStatic pgPipeLineLengthStatic=new PgPipeLineLengthStatic(); + pgPipeLineLengthStatic.setLineType(objects1[0].toString()); + pgPipeLineLengthStatic.setLength(objects1[1].toString()); + + pgPipeLineLengthStaticList.add(pgPipeLineLengthStatic); + } + + return pgPipeLineLengthStaticList; + } + } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index dfb390e..e32df70 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; @@ -81,4 +82,21 @@ return pgLineHoleList; } + public List getLineLengthStatic(String roadName){ + List pgPipeLineLengthStaticList=new ArrayList<>(); + String sql="select t.linename,sum(p.length) from PG_LINEHOLE t,pg_pileacu p,pg_road r where t.pileacuid=p.id and " + + "p.id in (select id from pg_road where roadname = '"+roadName+"') group by linename"; + List objects=this.getSession().createSQLQuery(sql).list(); + + for(Object[] objects1:objects){ + PgPipeLineLengthStatic pgPipeLineLengthStatic=new PgPipeLineLengthStatic(); + pgPipeLineLengthStatic.setLineType(objects1[0].toString()); + pgPipeLineLengthStatic.setLength(objects1[1].toString()); + + pgPipeLineLengthStaticList.add(pgPipeLineLengthStatic); + } + + return pgPipeLineLengthStaticList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java index 3c48a8d..92ec2f2 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.dto.PgPartitionDto; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import com.casic.PgInterface.devTable.manager.PgRoadManager; @@ -223,4 +224,31 @@ return resultMap; } + /** + * 根据道路获取分区信息 + */ + @POST + @Path("getRoadLineStatic") + @Produces(MediaType.APPLICATION_JSON) + public Map getRoadLineStatic()throws Exception{ + Map resultMap=new HashMap(); + String msg=""; + String code="0"; + List pgPipeLineRoadStaticList=new ArrayList<>(); + try{ + pgPipeLineRoadStaticList=pgRoadManager.getLineRoadStatic(); + code="200"; + msg="统计成功"; + } + catch (Exception e) + { + e.printStackTrace(); + msg="统计失败"; + } + resultMap.put("code",code); + resultMap.put("msg",msg); + resultMap.put("result",pgPipeLineRoadStaticList); + + return resultMap; + } } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index dfb390e..e32df70 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; @@ -81,4 +82,21 @@ return pgLineHoleList; } + public List getLineLengthStatic(String roadName){ + List pgPipeLineLengthStaticList=new ArrayList<>(); + String sql="select t.linename,sum(p.length) from PG_LINEHOLE t,pg_pileacu p,pg_road r where t.pileacuid=p.id and " + + "p.id in (select id from pg_road where roadname = '"+roadName+"') group by linename"; + List objects=this.getSession().createSQLQuery(sql).list(); + + for(Object[] objects1:objects){ + PgPipeLineLengthStatic pgPipeLineLengthStatic=new PgPipeLineLengthStatic(); + pgPipeLineLengthStatic.setLineType(objects1[0].toString()); + pgPipeLineLengthStatic.setLength(objects1[1].toString()); + + pgPipeLineLengthStaticList.add(pgPipeLineLengthStatic); + } + + return pgPipeLineLengthStaticList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java index 3c48a8d..92ec2f2 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.dto.PgPartitionDto; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import com.casic.PgInterface.devTable.manager.PgRoadManager; @@ -223,4 +224,31 @@ return resultMap; } + /** + * 根据道路获取分区信息 + */ + @POST + @Path("getRoadLineStatic") + @Produces(MediaType.APPLICATION_JSON) + public Map getRoadLineStatic()throws Exception{ + Map resultMap=new HashMap(); + String msg=""; + String code="0"; + List pgPipeLineRoadStaticList=new ArrayList<>(); + try{ + pgPipeLineRoadStaticList=pgRoadManager.getLineRoadStatic(); + code="200"; + msg="统计成功"; + } + catch (Exception e) + { + e.printStackTrace(); + msg="统计失败"; + } + resultMap.put("code",code); + resultMap.put("msg",msg); + resultMap.put("result",pgPipeLineRoadStaticList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL2559.tmp b/~WRL2559.tmp deleted file mode 100644 index 533e2cd..0000000 --- a/~WRL2559.tmp +++ /dev/null Binary files differ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index dfb390e..e32df70 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; @@ -81,4 +82,21 @@ return pgLineHoleList; } + public List getLineLengthStatic(String roadName){ + List pgPipeLineLengthStaticList=new ArrayList<>(); + String sql="select t.linename,sum(p.length) from PG_LINEHOLE t,pg_pileacu p,pg_road r where t.pileacuid=p.id and " + + "p.id in (select id from pg_road where roadname = '"+roadName+"') group by linename"; + List objects=this.getSession().createSQLQuery(sql).list(); + + for(Object[] objects1:objects){ + PgPipeLineLengthStatic pgPipeLineLengthStatic=new PgPipeLineLengthStatic(); + pgPipeLineLengthStatic.setLineType(objects1[0].toString()); + pgPipeLineLengthStatic.setLength(objects1[1].toString()); + + pgPipeLineLengthStaticList.add(pgPipeLineLengthStatic); + } + + return pgPipeLineLengthStaticList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java index 3c48a8d..92ec2f2 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.dto.PgPartitionDto; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import com.casic.PgInterface.devTable.manager.PgRoadManager; @@ -223,4 +224,31 @@ return resultMap; } + /** + * 根据道路获取分区信息 + */ + @POST + @Path("getRoadLineStatic") + @Produces(MediaType.APPLICATION_JSON) + public Map getRoadLineStatic()throws Exception{ + Map resultMap=new HashMap(); + String msg=""; + String code="0"; + List pgPipeLineRoadStaticList=new ArrayList<>(); + try{ + pgPipeLineRoadStaticList=pgRoadManager.getLineRoadStatic(); + code="200"; + msg="统计成功"; + } + catch (Exception e) + { + e.printStackTrace(); + msg="统计失败"; + } + resultMap.put("code",code); + resultMap.put("msg",msg); + resultMap.put("result",pgPipeLineRoadStaticList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL2559.tmp b/~WRL2559.tmp deleted file mode 100644 index 533e2cd..0000000 --- a/~WRL2559.tmp +++ /dev/null Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" index e4f252e..46790eb 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" Binary files differ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 15289c8..23cc2cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,29 +7,14 @@ - + - - - - - - - - - + - - - - - - - - + + - @@ -59,7 +44,7 @@ - + @@ -68,7 +53,7 @@ - + @@ -76,23 +61,23 @@ - + - + - - + + - + @@ -126,7 +111,7 @@ - + @@ -142,7 +127,7 @@ - + @@ -150,50 +135,52 @@ - + - - + + + + + + + + + + + - - - - + + - + - - - - - - - - - - - + + - - - - - + + - + - - + + + + + + + + + @@ -201,18 +188,46 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,9 +277,6 @@ @@ -347,10 +362,9 @@ - + @@ -655,7 +704,8 @@ - + + 1564361618083 @@ -776,11 +826,18 @@ - - @@ -792,10 +849,9 @@ - - + - + @@ -806,7 +862,7 @@ - + @@ -900,7 +956,8 @@ - @@ -925,34 +982,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -967,13 +996,6 @@ - - - - - - - @@ -1101,13 +1123,6 @@ - - - - - - - @@ -1164,13 +1179,6 @@ - - - - - - - @@ -1199,13 +1207,6 @@ - - - - - - - @@ -1227,13 +1228,6 @@ - - - - - - - @@ -1241,39 +1235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1288,10 +1249,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java new file mode 100644 index 0000000..1aadc98 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineRoadStatic.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.util.ArrayList; +import java.util.List; + +public class PgPipeLineRoadStatic { + + private String road; + private List pgPipeLineLengthStaticList; + + public String getRoad() { + return road; + } + + public void setRoad(String road) { + this.road = road; + } + + public List getPgPipeLineLengthStaticList() { + return pgPipeLineLengthStaticList; + } + + public void setPgPipeLineLengthStaticList(List pgPipeLineLengthStaticList) { + this.pgPipeLineLengthStaticList = pgPipeLineLengthStaticList; + } + + public static List getPgPipeLineRoadStaticList(List pgRoadList){ + + List pgPipeLineRoadStaticList=new ArrayList<>(); + + for(PgRoad pgRoad:pgRoadList){ + PgPipeLineRoadStatic pgPipeLineRoadStatic=new PgPipeLineRoadStatic(); + + pgPipeLineRoadStatic.setRoad(pgRoad.getRoadName()); + pgPipeLineRoadStatic.pgPipeLineLengthStaticList=new ArrayList<>(); + + pgPipeLineRoadStaticList.add(pgPipeLineRoadStatic); + } + + return pgPipeLineRoadStaticList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java index a9de66a..53c718c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -2,17 +2,24 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @Service public class PgRoadManager extends HibernateEntityDao { + @Resource + private PgLineHoleManager pgLineHoleManager; + public List getAllRoad(){ Criteria criteria = createCriteria(PgRoad.class); criteria.add(Restrictions.eq("active", 1)); @@ -39,6 +46,16 @@ return null; } + public List getLineRoadStatic(){ + List pgRoadList=this.findBy("active",1); + List pgPipeLineRoadStaticList=PgPipeLineRoadStatic.getPgPipeLineRoadStaticList(pgRoadList); + + for(PgPipeLineRoadStatic pgPipeLineRoadStatic:pgPipeLineRoadStaticList){ + pgPipeLineRoadStatic.setPgPipeLineLengthStaticList(pgLineHoleManager.getLineLengthStatic(pgPipeLineRoadStatic.getRoad())); + } + + return pgPipeLineRoadStaticList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index dfb390e..e32df70 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; @@ -81,4 +82,21 @@ return pgLineHoleList; } + public List getLineLengthStatic(String roadName){ + List pgPipeLineLengthStaticList=new ArrayList<>(); + String sql="select t.linename,sum(p.length) from PG_LINEHOLE t,pg_pileacu p,pg_road r where t.pileacuid=p.id and " + + "p.id in (select id from pg_road where roadname = '"+roadName+"') group by linename"; + List objects=this.getSession().createSQLQuery(sql).list(); + + for(Object[] objects1:objects){ + PgPipeLineLengthStatic pgPipeLineLengthStatic=new PgPipeLineLengthStatic(); + pgPipeLineLengthStatic.setLineType(objects1[0].toString()); + pgPipeLineLengthStatic.setLength(objects1[1].toString()); + + pgPipeLineLengthStaticList.add(pgPipeLineLengthStatic); + } + + return pgPipeLineLengthStaticList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java index 3c48a8d..92ec2f2 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java @@ -2,6 +2,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.dto.PgPartitionDto; +import com.casic.PgInterface.devTable.dto.PgPipeLineRoadStatic; import com.casic.PgInterface.devTable.dto.PgRoadDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import com.casic.PgInterface.devTable.manager.PgRoadManager; @@ -223,4 +224,31 @@ return resultMap; } + /** + * 根据道路获取分区信息 + */ + @POST + @Path("getRoadLineStatic") + @Produces(MediaType.APPLICATION_JSON) + public Map getRoadLineStatic()throws Exception{ + Map resultMap=new HashMap(); + String msg=""; + String code="0"; + List pgPipeLineRoadStaticList=new ArrayList<>(); + try{ + pgPipeLineRoadStaticList=pgRoadManager.getLineRoadStatic(); + code="200"; + msg="统计成功"; + } + catch (Exception e) + { + e.printStackTrace(); + msg="统计失败"; + } + resultMap.put("code",code); + resultMap.put("msg",msg); + resultMap.put("result",pgPipeLineRoadStaticList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL2559.tmp b/~WRL2559.tmp deleted file mode 100644 index 533e2cd..0000000 --- a/~WRL2559.tmp +++ /dev/null Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" index e4f252e..46790eb 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" Binary files differ diff --git "a/\346\231\272\350\203\275\350\247\204\345\210\222.docx" "b/\346\231\272\350\203\275\350\247\204\345\210\222.docx" index 987d60e..7f9ecc3 100644 --- "a/\346\231\272\350\203\275\350\247\204\345\210\222.docx" +++ "b/\346\231\272\350\203\275\350\247\204\345\210\222.docx" Binary files differ