diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java new file mode 100644 index 0000000..edd72a6 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java @@ -0,0 +1,23 @@ +package com.casic.PgInterface.maintenance.dto; + +public class PgAssetInSpectionRecordStatic { + + private String inspect_time; + private String num; + + public String getInspect_time() { + return inspect_time; + } + + public void setInspect_time(String inspect_time) { + this.inspect_time = inspect_time; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java new file mode 100644 index 0000000..edd72a6 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java @@ -0,0 +1,23 @@ +package com.casic.PgInterface.maintenance.dto; + +public class PgAssetInSpectionRecordStatic { + + private String inspect_time; + private String num; + + public String getInspect_time() { + return inspect_time; + } + + public void setInspect_time(String inspect_time) { + this.inspect_time = inspect_time; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } +} diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java index b9938e3..e0f2fc9 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java @@ -1,4 +1,50 @@ package com.casic.PgInterface.maintenance.manager; +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.maintenance.domain.PgAssetInSpectionRecord; +import com.casic.PgInterface.maintenance.dto.PgAssetInSpectionRecordStatic; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; -public class PgAssetInSpectionRecordManager { -} +@Resource +public class PgAssetInSpectionRecordManager extends HibernateEntityDao { + + public List getAssetInSpectionRecordStatic( + String startTime, String endTime, String staticType){ + + String dateType=""; + String sql=""; + List pgAssetInSpectionRecordStaticList=new ArrayList<>(); + + switch(staticType){ + case "year": + dateType = "yyyy"; + break; + case "month"://月 + dateType = "yyyy-mm"; + break; + case "week"://周 + dateType = "iw"; + break; + case "day"://日 + dateType="yyyy-mm-dd"; + break; + default: + break; + } + + sql="select count(*), to_char(t.inspect_time, '"+dateType+"') from PG_ASSET_INSPECTIONRECORD t where t.inspect_time >= " + + "to_date('"+startTime+"', 'yyyy-mm-dd') and t.inspect_time <= to_date('"+endTime+"', 'yyyy-mm-dd') group " + + "by to_char(t.inspect_time, '"+dateType+"')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for(int i=0;i - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java new file mode 100644 index 0000000..edd72a6 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java @@ -0,0 +1,23 @@ +package com.casic.PgInterface.maintenance.dto; + +public class PgAssetInSpectionRecordStatic { + + private String inspect_time; + private String num; + + public String getInspect_time() { + return inspect_time; + } + + public void setInspect_time(String inspect_time) { + this.inspect_time = inspect_time; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } +} diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java index b9938e3..e0f2fc9 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java @@ -1,4 +1,50 @@ package com.casic.PgInterface.maintenance.manager; +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.maintenance.domain.PgAssetInSpectionRecord; +import com.casic.PgInterface.maintenance.dto.PgAssetInSpectionRecordStatic; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; -public class PgAssetInSpectionRecordManager { -} +@Resource +public class PgAssetInSpectionRecordManager extends HibernateEntityDao { + + public List getAssetInSpectionRecordStatic( + String startTime, String endTime, String staticType){ + + String dateType=""; + String sql=""; + List pgAssetInSpectionRecordStaticList=new ArrayList<>(); + + switch(staticType){ + case "year": + dateType = "yyyy"; + break; + case "month"://月 + dateType = "yyyy-mm"; + break; + case "week"://周 + dateType = "iw"; + break; + case "day"://日 + dateType="yyyy-mm-dd"; + break; + default: + break; + } + + sql="select count(*), to_char(t.inspect_time, '"+dateType+"') from PG_ASSET_INSPECTIONRECORD t where t.inspect_time >= " + + "to_date('"+startTime+"', 'yyyy-mm-dd') and t.inspect_time <= to_date('"+endTime+"', 'yyyy-mm-dd') group " + + "by to_char(t.inspect_time, '"+dateType+"')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for(int i=0;i - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java new file mode 100644 index 0000000..edd72a6 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java @@ -0,0 +1,23 @@ +package com.casic.PgInterface.maintenance.dto; + +public class PgAssetInSpectionRecordStatic { + + private String inspect_time; + private String num; + + public String getInspect_time() { + return inspect_time; + } + + public void setInspect_time(String inspect_time) { + this.inspect_time = inspect_time; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } +} diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java index b9938e3..e0f2fc9 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java @@ -1,4 +1,50 @@ package com.casic.PgInterface.maintenance.manager; +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.maintenance.domain.PgAssetInSpectionRecord; +import com.casic.PgInterface.maintenance.dto.PgAssetInSpectionRecordStatic; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; -public class PgAssetInSpectionRecordManager { -} +@Resource +public class PgAssetInSpectionRecordManager extends HibernateEntityDao { + + public List getAssetInSpectionRecordStatic( + String startTime, String endTime, String staticType){ + + String dateType=""; + String sql=""; + List pgAssetInSpectionRecordStaticList=new ArrayList<>(); + + switch(staticType){ + case "year": + dateType = "yyyy"; + break; + case "month"://月 + dateType = "yyyy-mm"; + break; + case "week"://周 + dateType = "iw"; + break; + case "day"://日 + dateType="yyyy-mm-dd"; + break; + default: + break; + } + + sql="select count(*), to_char(t.inspect_time, '"+dateType+"') from PG_ASSET_INSPECTIONRECORD t where t.inspect_time >= " + + "to_date('"+startTime+"', 'yyyy-mm-dd') and t.inspect_time <= to_date('"+endTime+"', 'yyyy-mm-dd') group " + + "by to_char(t.inspect_time, '"+dateType+"')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for(int i=0;i getDeviceList()throws Exception { - Map resultMap = new HashMap(); + public Map getDeviceList(@FormParam("road") String road, + @FormParam("partition") String partition, + @FormParam("devType") String devType)throws Exception { + Map resultMap = new HashMap<>(); String msg=""; - List pgDeviceDtoList=new ArrayList(); + List pgDeviceDtoList=new ArrayList<>(); try { - pgDeviceDtoList = pgDeviceManager.getAllDevice(); + pgDeviceDtoList = pgDeviceManager.getAllDevice(road,partition,devType); if(pgDeviceDtoList.size()==0) msg="没有找到设备信息"; else diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 49c7b3b..582247f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,28 +6,15 @@ - - - - - - - - - - - - - - - + + + - - - - - - + + + + + @@ -62,8 +49,10 @@ + + - + @@ -71,7 +60,7 @@ - + @@ -83,8 +72,8 @@ - - + + @@ -95,8 +84,8 @@ - - + + @@ -104,7 +93,7 @@ - + @@ -119,13 +108,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +174,9 @@ readInputStream httpClient SEQ_PG_MAINTANCEPLAN_HEAD_ID + inspectAddress + getAllDevice + getPgDevice @@ -174,12 +195,6 @@ @@ -263,10 +284,11 @@ @@ -404,7 +441,7 @@ - + @@ -534,7 +571,7 @@ @@ -1221,7 +1260,7 @@ - @@ -1233,10 +1272,11 @@ - + + - - + + @@ -1247,7 +1287,7 @@ - + @@ -1258,7 +1298,7 @@ - + @@ -1332,7 +1372,6 @@ - @@ -1357,7 +1396,8 @@ - @@ -1387,107 +1427,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1597,115 +1536,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1713,56 +1543,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1777,48 +1557,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1826,78 +1564,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1926,9 +1592,6 @@ - - - @@ -1936,17 +1599,6 @@ - - - - - - - - - - - @@ -1954,9 +1606,6 @@ - - - @@ -1964,9 +1613,6 @@ - - - @@ -1977,13 +1623,6 @@ - - - - - - - @@ -1998,23 +1637,8 @@ - - - - - - - - - - - - - - - - - + + @@ -2026,10 +1650,6 @@ - - - - @@ -2040,6 +1660,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index fbd9a87..6a33267 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -19,15 +19,22 @@ public class PgDeviceManager extends HibernateEntityDao { //获取当前设备列表 - public List getAllDevice() { + public List getAllDevice(String road,String partition,String devType) { Criteria criteria = createCriteria(PgDevice.class); + + if(road!=null) + criteria.add(Restrictions.eq("road",road)); + if(partition!=null) + criteria.add(Restrictions.eq("partition",partition)); + if(devType!=null) + criteria.add(Restrictions.eq("devType",devType)); + criteria.add(Restrictions.eq("active", 1)); criteria.addOrder(Order.desc("id")); - List pgDeviceList = criteria.list(); - List pgDeviceDtoList = new ArrayList(); + List pgDeviceDtoList = new ArrayList<>(); for (PgDevice pgDevice : pgDeviceList) { pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); } diff --git a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java index cc8ed09..b3811bc 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java +++ b/src/main/java/com/casic/PgInterface/maintenance/domain/PgAssetInSpectionRecordDetail.java @@ -27,7 +27,6 @@ private String creator;//null private String configNote;//记录单配置说明 - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ASSET_INSPECTIONRECORDDET_ID") @Column(name="KEY_ID") diff --git a/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java new file mode 100644 index 0000000..edd72a6 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/maintenance/dto/PgAssetInSpectionRecordStatic.java @@ -0,0 +1,23 @@ +package com.casic.PgInterface.maintenance.dto; + +public class PgAssetInSpectionRecordStatic { + + private String inspect_time; + private String num; + + public String getInspect_time() { + return inspect_time; + } + + public void setInspect_time(String inspect_time) { + this.inspect_time = inspect_time; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } +} diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java index b9938e3..e0f2fc9 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetInSpectionRecordManager.java @@ -1,4 +1,50 @@ package com.casic.PgInterface.maintenance.manager; +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.maintenance.domain.PgAssetInSpectionRecord; +import com.casic.PgInterface.maintenance.dto.PgAssetInSpectionRecordStatic; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; -public class PgAssetInSpectionRecordManager { -} +@Resource +public class PgAssetInSpectionRecordManager extends HibernateEntityDao { + + public List getAssetInSpectionRecordStatic( + String startTime, String endTime, String staticType){ + + String dateType=""; + String sql=""; + List pgAssetInSpectionRecordStaticList=new ArrayList<>(); + + switch(staticType){ + case "year": + dateType = "yyyy"; + break; + case "month"://月 + dateType = "yyyy-mm"; + break; + case "week"://周 + dateType = "iw"; + break; + case "day"://日 + dateType="yyyy-mm-dd"; + break; + default: + break; + } + + sql="select count(*), to_char(t.inspect_time, '"+dateType+"') from PG_ASSET_INSPECTIONRECORD t where t.inspect_time >= " + + "to_date('"+startTime+"', 'yyyy-mm-dd') and t.inspect_time <= to_date('"+endTime+"', 'yyyy-mm-dd') group " + + "by to_char(t.inspect_time, '"+dateType+"')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for(int i=0;i getDeviceList()throws Exception { - Map resultMap = new HashMap(); + public Map getDeviceList(@FormParam("road") String road, + @FormParam("partition") String partition, + @FormParam("devType") String devType)throws Exception { + Map resultMap = new HashMap<>(); String msg=""; - List pgDeviceDtoList=new ArrayList(); + List pgDeviceDtoList=new ArrayList<>(); try { - pgDeviceDtoList = pgDeviceManager.getAllDevice(); + pgDeviceDtoList = pgDeviceManager.getAllDevice(road,partition,devType); if(pgDeviceDtoList.size()==0) msg="没有找到设备信息"; else diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 441bf12..ac05bdf 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ