From daf32629395005b18b173a8657b2bc0e0a1ef5ad Mon Sep 17 00:00:00 2001 From: PeterAlbus Date: Tue, 8 Jun 2021 17:56:05 +0800 Subject: [PATCH] ADD INDRNN --- .../controller/PredictController.java | 6 +- .../java/com/peteralbus/dao/IndRNNDao.java | 12 + .../java/com/peteralbus/domain/IndRNN.java | 326 ++++++++++++++++++ .../com/peteralbus/service/IndRNNService.java | 12 + .../service/impl/IndRNNServiceImpl.java | 39 +++ .../com/peteralbus/dao/IndRNNDao.xml | 9 + src/main/webapp/pages/predict/IndRNN.jsp | 41 +-- 7 files changed, 416 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/peteralbus/dao/IndRNNDao.java create mode 100644 src/main/java/com/peteralbus/domain/IndRNN.java create mode 100644 src/main/java/com/peteralbus/service/IndRNNService.java create mode 100644 src/main/java/com/peteralbus/service/impl/IndRNNServiceImpl.java create mode 100644 src/main/resources/com/peteralbus/dao/IndRNNDao.xml diff --git a/src/main/java/com/peteralbus/controller/PredictController.java b/src/main/java/com/peteralbus/controller/PredictController.java index a4308d5..785f2a1 100644 --- a/src/main/java/com/peteralbus/controller/PredictController.java +++ b/src/main/java/com/peteralbus/controller/PredictController.java @@ -1,6 +1,8 @@ package com.peteralbus.controller; +import com.peteralbus.domain.IndRNN; import com.peteralbus.domain.Predict; +import com.peteralbus.service.IndRNNService; import com.peteralbus.service.PredictService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -14,6 +16,8 @@ public class PredictController { @Autowired private PredictService predictService; + @Autowired + private IndRNNService indRNNService; @RequestMapping("/GlobalDeathPredict") public ModelAndView GlobalDeathPredict() { @@ -53,7 +57,7 @@ public class PredictController @RequestMapping("/IndRNNPredict") public ModelAndView IndRNNPredict() { - List predictList=predictService.findAll(); + List predictList=indRNNService.findAll(); ModelAndView modelAndView=new ModelAndView(); modelAndView.addObject("predictList",predictList); modelAndView.setViewName("/pages/predict/IndRNN.jsp"); diff --git a/src/main/java/com/peteralbus/dao/IndRNNDao.java b/src/main/java/com/peteralbus/dao/IndRNNDao.java new file mode 100644 index 0000000..607a880 --- /dev/null +++ b/src/main/java/com/peteralbus/dao/IndRNNDao.java @@ -0,0 +1,12 @@ +package com.peteralbus.dao; + +import com.peteralbus.domain.IndRNN; + +import java.util.List; + +/*Created on 2021/6/8.*/ +/*@author PeterAlbus*/ +public interface IndRNNDao +{ + public List findAll(); +} diff --git a/src/main/java/com/peteralbus/domain/IndRNN.java b/src/main/java/com/peteralbus/domain/IndRNN.java new file mode 100644 index 0000000..fa2c941 --- /dev/null +++ b/src/main/java/com/peteralbus/domain/IndRNN.java @@ -0,0 +1,326 @@ +package com.peteralbus.domain; + +/*Created on 2021/6/8.*/ +/*@author PeterAlbus*/ +public class IndRNN +{ + String date; + int Brazil; + int Brazil_Predict; + int China; + int China_Predict; + int France; + int France_Predict; + int global; + int global_Predict; + int India; + int India_Predict; + int Russia; + int Russia_Predict; + int US; + int US_Predict; + int Brazil_death; + int Brazil_death_predict; + int China_death; + int China_death_predict; + int France_death; + int France_death_predict; + int global_death; + int global_death_predict; + int India_death; + int India_death_predict; + int Russia_death; + int Russia_death_predict; + int US_death; + int US_death_predict; + + public String getDate() + { + return date; + } + + public void setDate(String date) + { + this.date = date; + } + + public int getBrazil() + { + return Brazil; + } + + public void setBrazil(int brazil) + { + Brazil = brazil; + } + + public int getBrazil_Predict() + { + return Brazil_Predict; + } + + public void setBrazil_Predict(int brazil_Predict) + { + Brazil_Predict = brazil_Predict; + } + + public int getChina() + { + return China; + } + + public void setChina(int china) + { + China = china; + } + + public int getChina_Predict() + { + return China_Predict; + } + + public void setChina_Predict(int china_Predict) + { + China_Predict = china_Predict; + } + + public int getFrance() + { + return France; + } + + public void setFrance(int france) + { + France = france; + } + + public int getFrance_Predict() + { + return France_Predict; + } + + public void setFrance_Predict(int france_Predict) + { + France_Predict = france_Predict; + } + + public int getGlobal() + { + return global; + } + + public void setGlobal(int global) + { + this.global = global; + } + + public int getGlobal_Predict() + { + return global_Predict; + } + + public void setGlobal_Predict(int global_Predict) + { + this.global_Predict = global_Predict; + } + + public int getIndia() + { + return India; + } + + public void setIndia(int india) + { + India = india; + } + + public int getIndia_Predict() + { + return India_Predict; + } + + public void setIndia_Predict(int india_Predict) + { + India_Predict = india_Predict; + } + + public int getRussia() + { + return Russia; + } + + public void setRussia(int russia) + { + Russia = russia; + } + + public int getRussia_Predict() + { + return Russia_Predict; + } + + public void setRussia_Predict(int russia_Predict) + { + Russia_Predict = russia_Predict; + } + + public int getUS() + { + return US; + } + + public void setUS(int US) + { + this.US = US; + } + + public int getUS_Predict() + { + return US_Predict; + } + + public void setUS_Predict(int US_Predict) + { + this.US_Predict = US_Predict; + } + + public int getBrazil_death() + { + return Brazil_death; + } + + public void setBrazil_death(int brazil_death) + { + Brazil_death = brazil_death; + } + + public int getBrazil_death_predict() + { + return Brazil_death_predict; + } + + public void setBrazil_death_predict(int brazil_death_predict) + { + Brazil_death_predict = brazil_death_predict; + } + + public int getChina_death() + { + return China_death; + } + + public void setChina_death(int china_death) + { + China_death = china_death; + } + + public int getChina_death_predict() + { + return China_death_predict; + } + + public void setChina_death_predict(int china_death_predict) + { + China_death_predict = china_death_predict; + } + + public int getFrance_death() + { + return France_death; + } + + public void setFrance_death(int france_death) + { + France_death = france_death; + } + + public int getFrance_death_predict() + { + return France_death_predict; + } + + public void setFrance_death_predict(int france_death_predict) + { + France_death_predict = france_death_predict; + } + + public int getGlobal_death() + { + return global_death; + } + + public void setGlobal_death(int global_death) + { + this.global_death = global_death; + } + + public int getGlobal_death_predict() + { + return global_death_predict; + } + + public void setGlobal_death_predict(int global_death_predict) + { + this.global_death_predict = global_death_predict; + } + + public int getIndia_death() + { + return India_death; + } + + public void setIndia_death(int india_death) + { + India_death = india_death; + } + + public int getIndia_death_predict() + { + return India_death_predict; + } + + public void setIndia_death_predict(int india_death_predict) + { + India_death_predict = india_death_predict; + } + + public int getRussia_death() + { + return Russia_death; + } + + public void setRussia_death(int russia_death) + { + Russia_death = russia_death; + } + + public int getRussia_death_predict() + { + return Russia_death_predict; + } + + public void setRussia_death_predict(int russia_death_predict) + { + Russia_death_predict = russia_death_predict; + } + + public int getUS_death() + { + return US_death; + } + + public void setUS_death(int US_death) + { + this.US_death = US_death; + } + + public int getUS_death_predict() + { + return US_death_predict; + } + + public void setUS_death_predict(int US_death_predict) + { + this.US_death_predict = US_death_predict; + } +} diff --git a/src/main/java/com/peteralbus/service/IndRNNService.java b/src/main/java/com/peteralbus/service/IndRNNService.java new file mode 100644 index 0000000..13d8ae9 --- /dev/null +++ b/src/main/java/com/peteralbus/service/IndRNNService.java @@ -0,0 +1,12 @@ +package com.peteralbus.service; + +import com.peteralbus.domain.IndRNN; + +import java.util.List; + +/*Created on 2021/6/8.*/ +/*@author PeterAlbus*/ +public interface IndRNNService +{ + public List findAll(); +} diff --git a/src/main/java/com/peteralbus/service/impl/IndRNNServiceImpl.java b/src/main/java/com/peteralbus/service/impl/IndRNNServiceImpl.java new file mode 100644 index 0000000..13ede86 --- /dev/null +++ b/src/main/java/com/peteralbus/service/impl/IndRNNServiceImpl.java @@ -0,0 +1,39 @@ +package com.peteralbus.service.impl; + +import com.peteralbus.dao.IndRNNDao; +import com.peteralbus.dao.PredictDao; +import com.peteralbus.domain.IndRNN; +import com.peteralbus.service.IndRNNService; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +/*Created on 2021/6/8.*/ +/*@author PeterAlbus*/ +@Service("IndRNNService") +public class IndRNNServiceImpl implements IndRNNService +{ + + @Override + public List findAll() + { + try { + InputStream in= Resources.getResourceAsStream("SqlMapConfig.xml"); + SqlSessionFactoryBuilder build=new SqlSessionFactoryBuilder(); + SqlSessionFactory factory=build.build(in); + SqlSession sqlSession=factory.openSession(); + IndRNNDao indRNNDao=sqlSession.getMapper(IndRNNDao.class); + return indRNNDao.findAll(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } +} + diff --git a/src/main/resources/com/peteralbus/dao/IndRNNDao.xml b/src/main/resources/com/peteralbus/dao/IndRNNDao.xml new file mode 100644 index 0000000..589fe21 --- /dev/null +++ b/src/main/resources/com/peteralbus/dao/IndRNNDao.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/src/main/webapp/pages/predict/IndRNN.jsp b/src/main/webapp/pages/predict/IndRNN.jsp index 6bf4165..ad83439 100644 --- a/src/main/webapp/pages/predict/IndRNN.jsp +++ b/src/main/webapp/pages/predict/IndRNN.jsp @@ -30,7 +30,7 @@ - + @@ -39,28 +39,13 @@

疫情状况预测

-