ADD INDRNN

dev
PeterAlbus 4 years ago
parent f3818d3e3f
commit daf3262939

@ -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<Predict> predictList=predictService.findAll();
List<IndRNN> predictList=indRNNService.findAll();
ModelAndView modelAndView=new ModelAndView();
modelAndView.addObject("predictList",predictList);
modelAndView.setViewName("/pages/predict/IndRNN.jsp");

@ -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<IndRNN> findAll();
}

@ -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;
}
}

@ -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<IndRNN> findAll();
}

@ -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<IndRNN> 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;
}
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.peteralbus.dao.IndRNNDao">
<select id="findAll" resultType="IndRNN">
select * from epidemic.indrnn
</select>
</mapper>

@ -30,7 +30,7 @@
<li class="nav-item"><a class="nav-link js-scroll-trigger" href="${pageContext.request.contextPath}/InfoCollection">打卡</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger" href="${pageContext.request.contextPath}/china_daily">图表展示</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger" href="${pageContext.request.contextPath}/chinamap">地图展示</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger" href="#">疫情状况预测</a></li>
<li class="nav-item"><a class ="nav-link js-scroll-trigger" href="#">疫情状况预测</a></li>
</ul>
</div>
</div>
@ -39,20 +39,6 @@
<h1 class="text-center text-white font-weight-bold" style="width: 100%;position: absolute;top:200px">疫情状况预测</h1>
</div>
<div class="d-flex container-fluid toggled" id="wrapper">
<div class="bg-light border-right" id="sidebar-wrapper">
<div class="sidebar-heading">切换数据</div>
<div class="list-group list-group-flush">
<a href="${pageContext.request.contextPath}/GlobalDeathPredict" class="list-group-item list-group-item-action bg-light">全球死亡人数预测</a>
<a href="${pageContext.request.contextPath}/GlobalConfirmPredict" class="list-group-item list-group-item-action bg-light">全球确诊人数预测</a>
<a href="${pageContext.request.contextPath}/ChinaConfirmPredict" class="list-group-item list-group-item-action bg-light">中国确诊人数预测</a>
<a href="${pageContext.request.contextPath}/USAConfirmPredict" class="list-group-item list-group-item-action bg-light">美国确诊人数预测</a>
<a href="#predict" class="list-group-item list-group-item-action bg-light">IndRNN模型展示</a>
</div>
</div>
<div id="page-content-wrapper">
<div class="hide-button">
<button class="btn btn-light" id="menu-toggle">查看其他数据</button>
</div>
<section class="page-section" id="predict">
<div class="container" style="text-align: center">
<h2 class="text-center mt-0">IndRNN模型-世界确诊人数</h2>
@ -60,7 +46,6 @@
<div class="box"></div>
</div>
</section>
</div>
</div>
<script>
var myChart=echarts.init(document.querySelector(".box"));
@ -77,19 +62,19 @@
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${predict.getSh_confirm()==0&&predict.getSh_confirm_predict()!=0}">
<c:when test="${predict.getBrazil()==0&&predict.getBrazil_Predict()!=0}">
a.push('');
</c:when>
<c:when test="${predict.getSh_confirm()!=0}">
a.push(${predict.getSh_confirm()});
<c:when test="${predict.getBrazil()!=0}">
a.push(${predict.getBrazil()});
</c:when>
</c:choose>
<c:choose>
<c:when test="${predict.getSh_confirm_predict()==0&&predict.getSh_confirm()!=0}">
<c:when test="${predict.getBrazil_Predict()==0&&predict.getBrazil()!=0}">
predict.push('');
</c:when>
<c:when test="${predict.getSh_confirm_predict()!=0}">
predict.push(${predict.getSh_confirm_predict()});
<c:when test="${predict.getBrazil_Predict()!=0}">
predict.push(${predict.getBrazil_Predict()});
</c:when>
</c:choose>
</c:forEach>

Loading…
Cancel
Save