From bc131131c5c96f8cb3bed679d4a359820c22e335 Mon Sep 17 00:00:00 2001
From: 15832144755 <67030627+15832144755@users.noreply.github.com>
Date: 星期四, 17 三月 2022 09:38:47 +0800
Subject: [PATCH] 3.17

---
 src/main/java/com/hxzkoa/services/FenceService.java |  112 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 102 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/hxzkoa/services/FenceService.java b/src/main/java/com/hxzkoa/services/FenceService.java
index 36e9ff9..930bc11 100644
--- a/src/main/java/com/hxzkoa/services/FenceService.java
+++ b/src/main/java/com/hxzkoa/services/FenceService.java
@@ -30,7 +30,7 @@
 	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>();
@@ -49,6 +49,65 @@
 				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);
 			}
 		}
@@ -107,6 +166,19 @@
 		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;
 	}
 	
@@ -142,6 +214,17 @@
 	}
 	
 	@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;
@@ -153,10 +236,9 @@
 	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) {
@@ -168,6 +250,11 @@
 				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);
 			}
 		}
@@ -210,10 +297,10 @@
 	}
 
 	@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());
@@ -222,13 +309,16 @@
 		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";
@@ -237,16 +327,18 @@
 			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() {

--
Gitblit v1.10.0