| | |
| | | } |
| | | return tb_warningList; |
| | | } |
| | | |
| | | public List<tb_warning> getWarningSummarya() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,type,objectid,`status`,time,baoliu1 FROM tb_warning ORDER BY id DESC"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_warning> tb_warningList = new ArrayList<tb_warning>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_warning warning = new tb_warning(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | warning.setId((int) obj[0]); |
| | | warning.setType(obj[1] == null ? "" : obj[1].toString()); |
| | | warning.setObjectid(obj[2] == null ? "" : obj[2].toString()); |
| | | warning.setStatus(obj[3] == null ? "" : obj[3].toString()); |
| | | warning.setTime(obj[4] == null ? "" : obj[4].toString()); |
| | | warning.setBaoliu1(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_warningList.add(warning); |
| | | } |
| | | } |
| | | return tb_warningList; |
| | | } |
| | | |
| | | public int getWarningSummaryCount() { |
| | | String sql = null; |
| | |
| | | } |
| | | return tb_realinwarningList; |
| | | } |
| | | |
| | | public List<tb_realinwarning> getRealinWarninga() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,area,name,bumen,tagid,intime FROM tb_realinwarning"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_realinwarning> tb_realinwarningList = new ArrayList<tb_realinwarning>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_realinwarning realinwarning = new tb_realinwarning(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | realinwarning.setId((int) obj[0]); |
| | | realinwarning.setArea(obj[1] == null ? "" : obj[1].toString()); |
| | | realinwarning.setName(obj[2] == null ? "" : obj[2].toString()); |
| | | realinwarning.setBumen(obj[3] == null ? "" : obj[3].toString()); |
| | | realinwarning.setTagid(obj[4] == null ? "" : obj[4].toString()); |
| | | realinwarning.setIntime(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_realinwarningList.add(realinwarning); |
| | | } |
| | | } |
| | | return tb_realinwarningList; |
| | | } |
| | | |
| | | public int getRealinWarningCount() { |
| | | String sql = null; |
| | |
| | | query.executeUpdate(); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public int realinWarning_deletea(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_realinwarning WHERE id = :id"; |
| | | cs.tb_caozuo("tb_realinwarning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("id", id); |
| | | query.executeUpdate(); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void realinWarning_deleteAll() { |
| | |
| | | query = this.em.createNativeQuery(sql); |
| | | query.executeUpdate(); |
| | | } |
| | | |
| | | @Transactional |
| | | public int realinWarning_deleteAlla() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "DELETE FROM tb_realinwarning"; |
| | | cs.tb_caozuo("tb_realinwarning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | public List<tb_realinwarning> searchRealinWarning(String input) { |
| | | String sql = null; |
| | |
| | | } |
| | | return tb_historyinwarningList; |
| | | } |
| | | |
| | | public List<tb_historyinwarning> getHistoricalWarninga() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,area,name,bumen,tagid,intime,outtime,alltime,beizhu FROM tb_historyinwarning"; |
| | | query = this.em.createNativeQuery(sql); |
| | | List resultList = query.getResultList(); |
| | | List<tb_historyinwarning> tb_historyinwarningList = new ArrayList<tb_historyinwarning>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | tb_historyinwarning historyinwarning = new tb_historyinwarning(); |
| | | historyinwarning.setId((int) obj[0]); |
| | | historyinwarning.setArea(obj[1] == null ? "" : obj[1].toString()); |
| | | historyinwarning.setName(obj[2] == null ? "" : obj[2].toString()); |
| | | historyinwarning.setBumen(obj[3] == null ? "" : obj[3].toString()); |
| | | historyinwarning.setTagid(obj[4] == null ? "" : obj[4].toString()); |
| | | historyinwarning.setIntime(obj[5] == null ? "" : obj[5].toString()); |
| | | historyinwarning.setOuttime(obj[6] == null ? "" : obj[6].toString()); |
| | | historyinwarning.setAlltime(obj[7] == null ? "" : obj[7].toString()); |
| | | historyinwarning.setBeizhu(obj[8] == null ? "" : obj[8].toString()); |
| | | tb_historyinwarningList.add(historyinwarning); |
| | | } |
| | | } |
| | | return tb_historyinwarningList; |
| | | } |
| | | |
| | | public int getHistoricalWarningCount() { |
| | | String sql = null; |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public int historicalWarning_deletea(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_historyinwarning WHERE id = :id"; |
| | | cs.tb_caozuo("tb_historyinwarning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("id", id); |
| | | query.executeUpdate(); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void Warning_delete(String[] checkVal) { |
| | | String sql = null; |
| | | Query query = null; |
| | |
| | | query.executeUpdate(); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public int Warning_deletea(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_warning WHERE id = :id"; |
| | | cs.tb_caozuo("tb_warning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("id", id); |
| | | query.executeUpdate(); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void historicalWarning_deleteAll() { |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public int historicalWarning_deleteAlla() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "DELETE FROM tb_historyinwarning"; |
| | | cs.tb_caozuo("tb_historyinwarning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void Warning_deleteAll() { |
| | | String sql = null; |
| | | Query query = null; |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public int Warning_deleteAlla() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "DELETE FROM tb_warning"; |
| | | cs.tb_caozuo("tb_warning", 2); |
| | | query = this.em.createNativeQuery(sql); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void Warning_deletefenlei(String fenlei) { |
| | | String sql = null; |
| | | Query query = null; |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public void historicalWarning_handle(String[] checkVal) { |
| | | public int historicalWarning_handle(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 = "UPDATE tb_warning SET status='已处理' WHERE objectid = :id"; |
| | |
| | | query.setParameter("id", id); |
| | | query.executeUpdate(); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | | public void historicalWarning_handleAll() { |
| | | public int historicalWarning_handleAll() { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "UPDATE tb_warning SET status='已处理'"; |
| | | cs.tb_caozuo("tb_warning", 3); |
| | | query = this.em.createNativeQuery(sql); |
| | | query.executeUpdate(); |
| | | int aaa = query.executeUpdate(); |
| | | return aaa; |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | query.executeUpdate(); |
| | | } |
| | | |
| | | public List<tb_warning> getfenlei(String fenlei) { |
| | | public List<tb_warning> getleixing(String fenlei) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,type,objectid,`status`,time,baoliu1 FROM tb_warning WHERE type=:fenlei ORDER BY id DESC"; |
| | |
| | | } |
| | | return tb_warningList; |
| | | } |
| | | |
| | | public List<tb_warning> getzhuangtai(String fenlei) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,type,objectid,`status`,time,baoliu1 FROM tb_warning WHERE status=:fenlei ORDER BY id DESC"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("fenlei", fenlei); |
| | | List resultList = query.getResultList(); |
| | | List<tb_warning> tb_warningList = new ArrayList<tb_warning>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_warning warning = new tb_warning(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | warning.setId((int) obj[0]); |
| | | warning.setType(obj[1] == null ? "" : obj[1].toString()); |
| | | warning.setObjectid(obj[2] == null ? "" : obj[2].toString()); |
| | | warning.setStatus(obj[3] == null ? "" : obj[3].toString()); |
| | | warning.setTime(obj[4] == null ? "" : obj[4].toString()); |
| | | warning.setBaoliu1(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_warningList.add(warning); |
| | | } |
| | | } |
| | | return tb_warningList; |
| | | } |
| | | |
| | | public List<tb_warning> getshuangshai(String fenlei,String fenlei2) { |
| | | String sql = null; |
| | | Query query = null; |
| | | sql = "SELECT id,type,objectid,`status`,time,baoliu1 FROM tb_warning WHERE type=:fenlei and status=:fenlei2 ORDER BY id DESC"; |
| | | query = this.em.createNativeQuery(sql); |
| | | query.setParameter("fenlei", fenlei); |
| | | query.setParameter("fenlei2", fenlei2); |
| | | List resultList = query.getResultList(); |
| | | List<tb_warning> tb_warningList = new ArrayList<tb_warning>(); |
| | | if (resultList.size() > 0) { |
| | | for (int i = 0; i < resultList.size(); i++) { |
| | | tb_warning warning = new tb_warning(); |
| | | Object[] obj = (Object[]) resultList.get(i); |
| | | warning.setId((int) obj[0]); |
| | | warning.setType(obj[1] == null ? "" : obj[1].toString()); |
| | | warning.setObjectid(obj[2] == null ? "" : obj[2].toString()); |
| | | warning.setStatus(obj[3] == null ? "" : obj[3].toString()); |
| | | warning.setTime(obj[4] == null ? "" : obj[4].toString()); |
| | | warning.setBaoliu1(obj[5] == null ? "" : obj[5].toString()); |
| | | tb_warningList.add(warning); |
| | | } |
| | | } |
| | | return tb_warningList; |
| | | } |
| | | } |