| | |
| | | public List<tb_fence> getFenceList() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,floor,type,bumen,name,zuobiao,shape,start,stop,addtime,color FROM tb_fence"; |
| | | sql = "SELECT id,floor,type,bumen,name,zuobiao,shape,start,stop,addtime,color,baoliu1 FROM tb_fence"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_fence> tb_fenceList = new ArrayList<tb_fence>(); |
| | |
| | | fence.setStop(obj[8] == null ? "" : obj[8].toString()); |
| | | fence.setAddtime(obj[9] == null ? "" : obj[9].toString()); |
| | | fence.setColor(obj[10] == null ? "" : obj[10].toString()); |
| | | fence.setBaoliu1(obj[11] == null ? "" : obj[11].toString()); |
| | | tb_fenceList.add(fence); |
| | | } |
| | | } |
| | | return tb_fenceList; |
| | | } |
| | | |
| | | public List<tb_fence> getFenceLista() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,floor,type,bumen,name,zuobiao,shape,start,stop,addtime,color,baoliu1 FROM tb_fence"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_fence> tb_fenceList = new ArrayList<tb_fence>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_fence fence = new tb_fence(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | fence.setId((int) obj[0]); |
| | | fence.setFloor(obj[1] == null ? "" : obj[1].toString()); |
| | | fence.setType(obj[2] == null ? "" : obj[2].toString()); |
| | | fence.setBumen(obj[3] == null ? "" : obj[3].toString()); |
| | | fence.setName(obj[4] == null ? "" : obj[4].toString()); |
| | | fence.setZuobiao(obj[5] == null ? "" : obj[5].toString()); |
| | | fence.setShape(obj[6] == null ? "" : obj[6].toString()); |
| | | fence.setStart(obj[7] == null ? "" : obj[7].toString()); |
| | | fence.setStop(obj[8] == null ? "" : obj[8].toString()); |
| | | fence.setAddtime(obj[9] == null ? "" : obj[9].toString()); |
| | | fence.setColor(obj[10] == null ? "" : obj[10].toString()); |
| | | fence.setBaoliu1(obj[11] == null ? "" : obj[11].toString()); |
| | | tb_fenceList.add(fence); |
| | | } |
| | | } |
| | | return tb_fenceList; |
| | | } |
| | | |
| | | public List<tb_fence> getFenceList2() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,floor,type,bumen,name,zuobiao,shape,start,stop,addtime,color,baoliu1 FROM tb_fence Where floor != '百度地图'"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_fence> tb_fenceList = new ArrayList<tb_fence>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_fence fence = new tb_fence(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | fence.setId((int) obj[0]); |
| | | fence.setFloor(obj[1] == null ? "" : obj[1].toString()); |
| | | fence.setType(obj[2] == null ? "" : obj[2].toString()); |
| | | fence.setBumen(obj[3] == null ? "" : obj[3].toString()); |
| | | fence.setName(obj[4] == null ? "" : obj[4].toString()); |
| | | fence.setZuobiao(obj[5] == null ? "" : obj[5].toString()); |
| | | fence.setShape(obj[6] == null ? "" : obj[6].toString()); |
| | | fence.setStart(obj[7] == null ? "" : obj[7].toString()); |
| | | fence.setStop(obj[8] == null ? "" : obj[8].toString()); |
| | | fence.setAddtime(obj[9] == null ? "" : obj[9].toString()); |
| | | fence.setColor(obj[10] == null ? "" : obj[10].toString()); |
| | | fence.setBaoliu1(obj[11] == null ? "" : obj[11].toString()); |
| | | tb_fenceList.add(fence); |
| | | } |
| | | } |
| | |
| | | query.setParameter("floor", shipin.getFloor()); |
| | | query.setParameter("name", shipin.getName()); |
| | | int executeUpdate = query.executeUpdate(); |
| | | // String sql2 = null; |
| | | // Query query2 = null; |
| | | // sql2 = "SELECT id FROM tb_shipin WHERE shebeiid=:shebeiid"; |
| | | // query2 = this.em.createNativeQuery(sql2); |
| | | // query2.setParameter("shebeiid",shipin.getShebeiid()); |
| | | // List resultList2 = query2.getResultList(); |
| | | // String id = null; |
| | | // if (resultList2.size() > 0) { |
| | | // Object[] obj = (Object[])resultList2.get(0); |
| | | // id = obj[0].toString(); |
| | | // } |
| | | // String xieyi = "BSTOCS1,ADDVIDEO,"+id+","+shipin.getFencename()+","+shipin.getShebeiid()+","+shipin.getTongdaoid()+","+shipin.getPosx()+","+shipin.getPosy()+","+shipin.getPosz()+","+shipin.getFloor()+","+shipin.getName()+",END"; |
| | | // Udp_ |
| | | return executeUpdate; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public List idfindshebeiid(String id) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT shebeiid FROM tb_shipin WHERE id = :id"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("id", id); |
| | | List resultList = query.getResultList(); |
| | | return resultList; |
| | | } |
| | | |
| | | @Transactional |
| | | public void shipinManagement_deleteAll() { |
| | | String sql = null; |
| | | Query query = null; |
| | |
| | | public List<tb_shipin> searchshipinManagement(String input) { |
| | | String sql = null; |
| | | Query query = null; |
| | | System.out.print(input); |
| | | sql = "SELECT * FROM tb_shipin WHERE fencename = :fencename"; |
| | | sql = "SELECT * FROM tb_shipin WHERE name = :name"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("fencename", input); |
| | | query.setParameter("name", input); |
| | | List resultList = query.getResultList(); |
| | | List<tb_shipin> tb_shipinList = new ArrayList<tb_shipin>(); |
| | | if (resultList.size() > 0) { |
| | |
| | | shipin.setShebeiid(obj[2] == null ? "" : obj[2].toString()); |
| | | shipin.setTongdaoid(obj[3] == null ? "" : obj[3].toString()); |
| | | shipin.setAddtime(obj[4] == null ? "" : obj[4].toString()); |
| | | shipin.setPosx(obj[5] == null ? "" : obj[5].toString()); |
| | | shipin.setPosy(obj[6] == null ? "" : obj[6].toString()); |
| | | shipin.setPosz(obj[7] == null ? "" : obj[7].toString()); |
| | | shipin.setFloor(obj[8] == null ? "" : obj[8].toString()); |
| | | shipin.setName(obj[9] == null ? "" : obj[9].toString()); |
| | | tb_shipinList.add(shipin); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public void fenceList_modify(tb_fence fence) { |
| | | public int fenceList_modify(tb_fence fence) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "UPDATE tb_fence SET bumen=:bumen,name=:name,zuobiao=:zuobiao,start=:start,stop=:stop WHERE id=:id"; |
| | | sql = "UPDATE tb_fence SET bumen=:bumen,name=:name,zuobiao=:zuobiao,start=:start,stop=:stop,baoliu1=:baoliu1 WHERE id=:id"; |
| | | cs.tb_caozuo("tb_fence", 3); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("bumen", fence.getBumen()); |
| | |
| | | query.setParameter("start", fence.getStart()); |
| | | query.setParameter("stop", fence.getStop()); |
| | | query.setParameter("id", fence.getId()); |
| | | query.executeUpdate(); |
| | | query.setParameter("baoliu1", fence.getBaoliu1()); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void fenceList_delete(String[] checkVal) { |
| | | public int fenceList_delete(String[] checkVal) { |
| | | String sql = null; |
| | | Query query = null; |
| | | int aaa = checkVal.length; |
| | | for (int i = 0; i < checkVal.length; i++) { |
| | | int id = Integer.parseInt(checkVal[i]); |
| | | sql = "DELETE FROM tb_fence WHERE id = :id"; |
| | |
| | | query.setParameter("id", id); |
| | | query.executeUpdate(); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void fenceList_deleteAll() { |
| | | public int fenceList_deleteAll() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "DELETE FROM tb_fence"; |
| | | cs.tb_caozuo("tb_fence", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.executeUpdate(); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | public List<tb_xunjianset> getInspectionSettings() { |