7.8
15832144755
2021-07-08 2080267e3245f0df9efc621c279922dc5ebb7c8e
src/main/java/com/hxzkoa/services/ZhwService.java
@@ -46,6 +46,7 @@
import com.hxzkoa.json.tb_realinwarning;
import com.hxzkoa.json.tb_realocation;
import com.hxzkoa.json.tb_realpositoin;
import com.hxzkoa.json.tb_shipin;
import com.hxzkoa.json.tb_system;
import com.hxzkoa.json.tb_tag;
import com.hxzkoa.json.tb_tagpower;
@@ -493,6 +494,7 @@
            realocation.setP_image((String) obj[22]);
            realocation.setP_addtiem((String) obj[23]);
            realocation.setP_sousuo((String) obj[25]);
            realocation.setP_shipin((String) obj[26]);
            tb_realocationList.add(realocation);
         }
      }
@@ -837,7 +839,7 @@
      String sql = null;
      Query query = null;
      sql = "UPDATE tb_person SET p_fence=0 WHERE p_tagid=:tagid";
      cs.tb_caozuo("tb_gps", 3);
      cs.tb_caozuo("tb_person", 3);
      query = this.em.createNativeQuery(sql);
      query.setParameter("tagid", tagid);
      int executeUpdate = query.executeUpdate();
@@ -849,7 +851,19 @@
      String sql = null;
      Query query = null;
      sql = "UPDATE tb_person SET p_sos=0 WHERE p_tagid=:tagid";
      cs.tb_caozuo("tb_gps", 3);
      cs.tb_caozuo("tb_person", 3);
      query = this.em.createNativeQuery(sql);
      query.setParameter("tagid", tagid);
      int executeUpdate = query.executeUpdate();
      return executeUpdate;
   }
   @Transactional
   public int shipin(String tagid) {
      String sql = null;
      Query query = null;
      sql = "UPDATE tb_person SET p_shipin=0 WHERE p_tagid=:tagid";
      cs.tb_caozuo("tb_person", 3);
      query = this.em.createNativeQuery(sql);
      query.setParameter("tagid", tagid);
      int executeUpdate = query.executeUpdate();
@@ -867,5 +881,46 @@
      String status = resultList.get(0).toString();
      return status;
   }
   public List<tb_person> getfencename(String tagid) {
      String sql = null;
      Query query = null;
      sql = "SELECT p_fencename from tb_person WHERE p_tagid="+tagid;
      query = this.em.createNativeQuery(sql);
//    System.out.print(sql);
      List resultList = query.getResultList();
//    System.out.print(resultList.size());
      List<tb_person> tb_person = new ArrayList<tb_person>();
      if (resultList.size() > 0) {
         for (int i = 0; i < resultList.size(); i++) {
            tb_person person = new tb_person();
//          Object[] obj = (Object[]) resultList.get(i);
            person.setP_fencename(resultList.get(i) == null ? "" : resultList.get(i).toString());
//          System.out.print(person.getP_fencename());
            tb_person.add(person);
         }
      }
      return tb_person;
   }
   public List<tb_shipin> getshebeiid(String fencename) {
      String sql = null;
      Query query = null;
      sql = "SELECT shebeiid,tongdaoid from tb_shipin WHERE fencename=:fencename";
      query = this.em.createNativeQuery(sql);
      query.setParameter("fencename", fencename);
      List resultList = query.getResultList();
      List<tb_shipin> tb_shipinList = new ArrayList<tb_shipin>();
      if (resultList.size() > 0) {
         for (int i = 0; i < resultList.size(); i++) {
            tb_shipin shipin = new tb_shipin();
            Object[] obj = (Object[]) resultList.get(i);
            shipin.setShebeiid((String) obj[0]);
            shipin.setTongdaoid((String) obj[1]);
            tb_shipinList.add(shipin);
         }
      }
      return tb_shipinList;
   }
      
}