15832144755
2022-01-06 7b4c8991dca9cf2a809a95e239d144697d3afb56
src/main/java/com/hxzkoa/services/ZhwService.java
@@ -585,6 +585,7 @@
            realocation.setP_kaoqqingname((String) obj[21]);
            realocation.setP_image((String) obj[22]);
            realocation.setP_addtiem((String) obj[23]);
            realocation.setBaoliu6((String) obj[33]);
            tb_realocationList.add(realocation);
         }
      }
@@ -695,7 +696,7 @@
   public List<tb_gps> getGPS() {
      String sql = null;
      Query query = null;
      sql = "SELECT a.*,c.p_name,c.p_online FROM tb_gps AS a,( SELECT tagid, max(addtime) time FROM tb_gps GROUP BY tagid ) AS b, tb_person as c WHERE a.addtime = b.time AND a.tagid = b.tagid AND c.p_tagid=a.tagid";
      sql = "SELECT a.*,c.p_name,c.p_online,p_sex,p_minzu,p_phone,p_department FROM tb_gps AS a,( SELECT tagid, max(addtime) time FROM tb_gps GROUP BY tagid ) AS b, tb_person as c WHERE a.addtime = b.time AND a.tagid = b.tagid AND c.p_tagid=a.tagid";
      query = this.em.createNativeQuery(sql);
      List resultList = query.getResultList();
      List<tb_gps> tb_gpsList = new ArrayList<tb_gps>();
@@ -708,7 +709,7 @@
            gps.setGps_NS((String) obj[3]);
            gps.setGsp_jingdu((String) obj[4]);
            gps.setGps_EW((String) obj[5]);
            gps.setGps_state((String) obj[25]);
            gps.setGps_state((String) obj[35]);
            gps.setGps_num((String) obj[7]);
            gps.setGps_hdop((String) obj[8]);
            gps.setGps_haiba_gao((String) obj[9]);
@@ -721,7 +722,11 @@
            gps.setGps_power((String) obj[16]);
            gps.setGps_sos((String) obj[17]);
            gps.setAddtime((String) obj[18]);
            gps.setName((String) obj[24]);
            gps.setName((String) obj[34]);
            gps.setSex((String) obj[36]);
            gps.setMinzu((String) obj[37]);
            gps.setDianhua((String) obj[38]);
            gps.setBumen((String) obj[39]);
            tb_gpsList.add(gps);
         }
      }
@@ -918,6 +923,18 @@
   }
   
   @Transactional
   public int chaichugao(String tagid) {
      String sql = null;
      Query query = null;
      sql = "UPDATE tb_person SET baoliu6=0 WHERE p_tagid=:tagid";
      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;
@@ -1109,5 +1126,56 @@
      }
      return tb_realkaoqinList;
   }
   public List<tb_person> getsosgaojing() {
      String sql = null;
      Query query = null;
      sql = "select p_tagid from tb_person where p_sos = '1'";
      query = this.em.createNativeQuery(sql);
      List resultList = query.getResultList();
      List<tb_person> soslist = new ArrayList<tb_person>();
      if (resultList.size() > 0) {
         for (int i = 0; i < resultList.size(); i++) {
            tb_person person = new tb_person();
            person.setP_tagid(resultList.get(i) == null ? "" : resultList.get(i).toString());
            soslist.add(person);
         }
      }
      return soslist;
   }
   public List<tb_person> getfencegaojing() {
      String sql = null;
      Query query = null;
      sql = "select p_tagid from tb_person where p_fence = '1'";
      query = this.em.createNativeQuery(sql);
      List resultList = query.getResultList();
      List<tb_person> soslist = new ArrayList<tb_person>();
      if (resultList.size() > 0) {
         for (int i = 0; i < resultList.size(); i++) {
            tb_person person = new tb_person();
            person.setP_tagid(resultList.get(i) == null ? "" : resultList.get(i).toString());
            soslist.add(person);
         }
      }
      return soslist;
   }
   public List<tb_person> getchufencegaojing() {
      String sql = null;
      Query query = null;
      sql = "select p_tagid from tb_person where p_fence = '2'";
      query = this.em.createNativeQuery(sql);
      List resultList = query.getResultList();
      List<tb_person> soslist = new ArrayList<tb_person>();
      if (resultList.size() > 0) {
         for (int i = 0; i < resultList.size(); i++) {
            tb_person person = new tb_person();
            person.setP_tagid(resultList.get(i) == null ? "" : resultList.get(i).toString());
            soslist.add(person);
         }
      }
      return soslist;
   }
      
}