package com.appleyk.service.impl;
import com.appleyk.database.JDBCKit;
import com.appleyk.node.Insurance;
import com.appleyk.service.InsuranceService;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import javax.swing.*;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Primary
public class InsuranceServiceImpl implements InsuranceService {
//获取所有的保险类型的id
@Override
public List<Integer> getAllTypes(){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
List<Integer> listNum = new ArrayList<Integer>();
try{
connection = JDBCKit.getConnection();
String sql="SELECT type_id FROM type;";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while(resultSet.next()){
int Num = resultSet.getInt("type_id");
listNum.add(Num);
}
return listNum;
} catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//获取所有的保险公司id
@Override
public List<Integer> getAllComs(){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
List<Integer> listNum = new ArrayList<Integer>();
try{
connection = JDBCKit.getConnection();
String sql="SELECT company_id FROM company;";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while(resultSet.next()){
int Num = resultSet.getInt("company_id");
listNum.add(Num);
}
return listNum;
} catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//根据公司name获取公司id
@Override
public Integer ComIdToName(int Com_nam){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
try{
connection = JDBCKit.getConnection();
String sql="SELECT company_id FROM company where company_name = " + Com_nam + ";";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
int id = resultSet.getInt("company_id");
return id;
} catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//根据保险类型id获得name
@Override
public String typeIdToName(int type_id){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
try{
connection = JDBCKit.getConnection();
String sql="SELECT type_name FROM type where type_id = " + type_id + ";";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
String Name = null;
while(resultSet.next())
{
Name = resultSet.getString("type_name");
}
return Name;
} catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//根据指定保险类型返回保险的数量
@Override
public Integer getAllComInNum(int Type_id){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
int Num = 0;
try{
connection = JDBCKit.getConnection();
String sql="select count(insurance_id) as Num from insurance where insurance_typeid = " + Type_id + ";";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while(resultSet.next()){
Num = resultSet.getInt("Num");
}
return Num;
}catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//根据保险的名字获取保险信息
@Override
public Insurance getInByName(String name){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
Insurance insurance = new Insurance();
try{
connection = JDBCKit.getConnection();
String sql="select * from insurance where insurance_name = \""+name+"\";";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while(resultSet.next()){
System.out.println(resultSet.getString("insurance_toubaonianling"));
insurance.setIn_toubaonianling(resultSet.getString("insurance_toubaonianling"));
insurance.setIn_kuanxianqi(resultSet.getString("insurance_kuanxianqi"));
insurance.setIn_youyuqi(resultSet.getString("insurance_youyuqi"));
insurance.setIn_zerentiaokuan(resultSet.getString("insurance_zerentiaokuan"));
insurance.setIn_mianzetiaokuan(resultSet.getString("insurance_mianzetiaokuan"));
insurance.setIn_jiaofeifangshi(resultSet.getString("insurance_jiaofeifangshi"));
insurance.setIn_baoxianqijian(resultSet.getString("insurance_baoxianqijian"));
insurance.setIn_shouyiren(resultSet.getString("insurance_shouyiren"));
}
return insurance;
}catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//返还所有公司每一类保险的数量(返回值map:type_name,InsuranceNum)
@Override
public Map<String,Integer> getInNumByTypes(){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
//每个类型保险的数量
Map<String ,Integer> NumByTypes = new HashMap<String, Integer>();
//获取保险的所有类型id
List<Integer> getAllTypes = getAllTypes();
try{
connection = JDBCKit.getConnection();
//遍历所有类型
for(int i = 0;i < getAllTypes.size();i++){
int type_id = getAllTypes.get(i);
String sql="SELECT COUNT(insurance_id) as NUM FROM insurance where insurance_typeid = " + type_id + ";";
statement=connection.prepareStatement(sql);
resultSet = statement.executeQuery();
while(resultSet.next()){
String type_name = typeIdToName(type_id);
System.out.println(type_name);
int Num = resultSet.getInt("NUM");
NumByTypes.put(type_name,Num);
}
}
return NumByTypes;
} catch (Exception ex){
ex.printStackTrace();
JDBCKit.release(resultSet, null, connection);
return null;
}
}
//返回指定id公司旗下每一类保险的数量(返回值map:type_name,InsuranceNum)
@Override
public Map<String,Integer> getComInsurNumByTypes(int Com_id){
Connection connection= null;
ResultSet resultSet=null;
PreparedStatement statement=null;
Map<String ,Integer> get
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本资源【基于neo4j的保险智能咨询系统源码+项目说明.zip】是一个综合性的学习资源,旨在帮助开发者深入了解并掌握如何利用Neo4j图数据库构建高效的保险智能咨询系统。该系统通过整合先进的图数据结构和查询语言,实现了对复杂保险数据的高效存储与查询,为用户提供了更加智能化、个性化的咨询服务。项目源码部分详细展示了系统的架构设计、核心算法实现以及关键功能模块的开发过程,包括用户界面设计、数据导入导出、查询优化等关键环节。同时,项目说明文档则提供了详尽的背景介绍、需求分析、技术选型依据以及各模块的功能描述和使用方法,为学习者提供了全面而深入的理解。通过学习和实践本项目,开发者可以深入了解Neo4j在保险行业中的应用潜力,掌握图数据库的基本操作和高级特性,提升数据处理能力和系统设计水平。此外,本项目还可以作为其他领域智能咨询系统开发的参考案例,具有较高的实用价值和学习意义。请注意,本资源仅供学习交流使用,请勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
基于neo4j的保险智能咨询系统源码+项目说明.zip (957个子文件)
InsuranceServiceImpl.class 14KB
ModelProcess.class 12KB
QuestionServiceImpl.class 9KB
Insurance_mysql.class 7KB
Insurance_mysql.class 7KB
ResponseResult.class 6KB
ResponseResult.class 6KB
HanLPTest.class 5KB
FileController.class 5KB
InsuranceManageController.class 4KB
test.class 4KB
Insurance.class 4KB
BayesTest.class 4KB
InsuranceController.class 3KB
CompanyManageController.class 3KB
TypeManageController.class 3KB
Company_mysql.class 3KB
QuestionRepository.class 3KB
Type_mysql.class 2KB
FileServiceImpl.class 2KB
FileServiceImpl.class 2KB
ResultData.class 2KB
ResultData.class 2KB
ShowController.class 2KB
ResponseMessage.class 2KB
ResponseMessage.class 2KB
Regular.class 2KB
CompanyController.class 2KB
TypeController.class 2KB
CountController.class 2KB
PageIndexController.class 2KB
JDBCKit.class 2KB
Company.class 2KB
InsuranceService.class 2KB
WebMvcConfiguration.class 1KB
WebMvcConfiguration.class 1KB
QuestionController.class 1KB
LoginController.class 1KB
Application.class 1KB
Application.class 1KB
BaseEntity.class 985B
InsuranceRepository.class 933B
Type.class 898B
TypeRepository.class 819B
PageIndexController.class 709B
CompanyRepository.class 632B
Insurance_mysqlDao.class 547B
InsuranceDao_mysql.class 547B
FileResult.class 420B
FileResult.class 410B
CompanyDao_mysql.class 339B
TypeDao_mysql.class 330B
QuestionService.class 307B
FileService.class 269B
FileService.class 269B
bootstrap.min.css 152KB
bootstrap.min.css 152KB
bootstrap.min.css 141KB
bootstrap.min.css 141KB
bootstrap.css 129KB
bootstrap.css 129KB
animate.css 76KB
animate.css 76KB
font-awesome.css 25KB
font-awesome.css 25KB
layer.css 14KB
layer.css 14KB
style.css 11KB
style.css 11KB
style.css 8KB
style.css 8KB
layer.css 5KB
layer.css 5KB
dashboard.css 2KB
dashboard.css 2KB
signin.css 906B
signin.css 906B
bootstrapValidator.css 700B
bootstrapValidator.css 700B
fontawesome-webfont.eot 125KB
fontawesome-webfont.eot 71KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-2.gif 2KB
loading-2.gif 2KB
loading-1.gif 701B
loading-1.gif 701B
.gitignore 176B
policy_analysis.html 418KB
policy_analysis.html 418KB
edit.html 151KB
edit.html 151KB
add.html 150KB
add.html 150KB
list.html 150KB
list.html 150KB
edit.html 148KB
edit.html 148KB
list.html 147KB
list.html 147KB
共 957 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
葡萄籽儿
- 粉丝: 721
- 资源: 2493
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- matlab平台的的PCB板缺陷检测.zip
- matlab平台的的SVM方法的水果识别分类.zip
- matlab平台的的答题纸答题卡识别.zip
- matlab平台的的病虫害检测系统.zip
- 基于python的多传感器数据融合故障诊断程序,三条分支
- sgp4与sdp4模型文档+一个SGP4的开源实现
- matlab平台的的车道线标定.zip
- matlab平台的的人脸+指纹融合系统.zip
- matlab平台的的路牌交通牌照识别.zip
- JAVA多线程示例代码
- matlab平台的的人脸门禁预警.zip
- matlab平台的的手写汉字识别.zip
- matlab平台的的人脸识别设计.zip
- matlab平台的的视频图像去雾.zip
- matlab平台的的手写字符识别.zip
- matlab平台的的小波变换dwt数字水印.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功