package dao;
import entity.JwClass;
import util.DBConnection;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class JwClassDao {
private Connection conn = null;
private PreparedStatement ps = null;
private ResultSet rs = null;
public JwClass selectById(String id){
String sql = "SELECT * FROM jw_class where id = ?";
try {
conn = DBConnection.getConnection();
ps = conn.prepareStatement(sql);
ps.setString(1,id);
rs = ps.executeQuery();
if (rs.next()) {
JwClass jwClass = new JwClass();
jwClass.setId(rs.getString("id"));
jwClass.setCamp_area_id(rs.getString("camp_area_id"));
jwClass.setCamp_area(rs.getString("camp_area"));
jwClass.setBuilding_id(rs.getString("building_id"));
jwClass.setBuilding_name(rs.getString("building_name"));
jwClass.setRoom_name(rs.getString("room_name"));
jwClass.setFloor_num(rs.getInt("floor_num"));
jwClass.setHouse_num(rs.getInt("house_num"));
jwClass.setRoom_type_name(rs.getString("room_type_name"));
jwClass.setAllow_num(rs.getInt("allow_num"));
jwClass.setArea(rs.getDouble("area"));
jwClass.setStatus_flag(rs.getString("status_flag"));
jwClass.setCreate_by(rs.getString("create_by"));
jwClass.setCreate_time(rs.getTimestamp("create_time"));
jwClass.setUpdate_by(rs.getString("update_by"));
jwClass.setUpdate_time(rs.getTimestamp("update_time"));
return jwClass;
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public List<JwClass> selectAll(){
List<JwClass>tqmPlans = new ArrayList<>();
String sql = "SELECT * FROM jw_class";
try {
conn = DBConnection.getConnection();
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
JwClass jwClass = new JwClass();
jwClass.setId(rs.getString("id"));
jwClass.setCamp_area_id(rs.getString("camp_area_id"));
jwClass.setCamp_area(rs.getString("camp_area"));
jwClass.setBuilding_id(rs.getString("building_id"));
jwClass.setBuilding_name(rs.getString("building_name"));
jwClass.setRoom_name(rs.getString("room_name"));
jwClass.setFloor_num(rs.getInt("floor_num"));
jwClass.setHouse_num(rs.getInt("house_num"));
jwClass.setRoom_type_name(rs.getString("room_type_name"));
jwClass.setAllow_num(rs.getInt("allow_num"));
jwClass.setArea(rs.getDouble("area"));
jwClass.setStatus_flag(rs.getString("status_flag"));
jwClass.setCreate_by(rs.getString("create_by"));
jwClass.setCreate_time(rs.getTimestamp("create_time"));
jwClass.setUpdate_by(rs.getString("update_by"));
jwClass.setUpdate_time(rs.getTimestamp("update_time"));
tqmPlans.add(jwClass);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return tqmPlans;
}
public int insert(JwClass tqmPlan){
String sql = "INSERT INTO jw_class(id,camp_area_id,camp_area,building_id,building_name,room_name,floor_num" +
",house_num,room_type_name,allow_num,area,status_flag,create_by,create_time,update_by" +
",update_time) VALUE (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try {
conn = DBConnection.getConnection();
ps = conn.prepareStatement(sql);
ps.setString(1,tqmPlan.getId());
ps.setString(2,tqmPlan.getCamp_area_id());
ps.setString(3,tqmPlan.getCamp_area());
ps.setString(4,tqmPlan.getBuilding_id());
ps.setString(5,tqmPlan.getBuilding_name());
ps.setString(6,tqmPlan.getRoom_name());
ps.setInt(7,tqmPlan.getFloor_num());
ps.setInt(8,tqmPlan.getHouse_num());
ps.setString(9,tqmPlan.getRoom_type_name());
ps.setInt(10,tqmPlan.getAllow_num());
ps.setDouble(11,tqmPlan.getArea());
ps.setString(12,tqmPlan.getStatus_flag());
ps.setString(13,tqmPlan.getCreate_by());
ps.setTimestamp(14,tqmPlan.getCreate_time());
ps.setString(15,tqmPlan.getUpdate_by());
ps.setTimestamp(16,tqmPlan.getUpdate_time());
int i = ps.executeUpdate();
return i;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
public int updateById(JwClass tqmPlan){
try {
String sql= "UPDATE jw_class SET camp_area_id=?,camp_area=?,building_id=?,building_name=?,room_name=?,floor_num=?," +
"house_num=?,room_type_name=?,allow_num=?,area=?,status_flag=?,create_by=?" +
",create_time=?,update_by=?," +
"update_time=? where id = ?";
conn = DBConnection.getConnection();
ps = conn.prepareStatement(sql);
ps.setString(1,tqmPlan.getCamp_area_id());
ps.setString(2,tqmPlan.getCamp_area());
ps.setString(3,tqmPlan.getBuilding_id());
ps.setString(4,tqmPlan.getBuilding_name());
ps.setString(5,tqmPlan.getRoom_name());
ps.setInt(6,tqmPlan.getFloor_num());
ps.setInt(7,tqmPlan.getHouse_num());
ps.setString(8,tqmPlan.getRoom_type_name());
ps.setInt(9,tqmPlan.getAllow_num());
ps.setDouble(10,tqmPlan.getArea());
ps.setString(11,tqmPlan.getStatus_flag());
ps.setString(12,tqmPlan.getCreate_by());
ps.setTimestamp(13,tqmPlan.getCreate_time());
ps.setString(14,tqmPlan.getUpdate_by());
ps.setTimestamp(15,tqmPlan.getUpdate_time());
ps.setString(16,tqmPlan.getId());
int i = ps.executeUpdate();
return i;
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
public int deleteById(String id) {
int i = 0;
try {
conn = DBConnection.getConnection();
String sql = "DELETE FROM jw_class WHERE id = ?";
ps = conn.prepareStatement(sql);
ps.setString(1,id);
i = ps.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
return i;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![sql](https://img-home.csdnimg.cn/images/20210720083646.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 147 条
- 1
- 2
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/5d18159d5d0340f5a1fe19067ad9eeeb_m0_74909414.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
康康峰
- 粉丝: 221
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- AI高清贺卡+中秋贺卡
- 2024最新版Ubuntu基础使用-适合新手的讲解
- 基于Springboot和Vue的人事管理系统源码 人事管理系统代码,包括程序,中文注释,配置说明操作步骤
- 国庆抽奖大转盘,丝滑抽奖页面
- 电力系统静态稳定性仿真simulink仿真 用simulink搭建搭建单机无穷大系统,对其静态稳定性进行仿真分析
- 西门子1200自动洗车博途仿真 自动洗车博图PLC程序洗车机控制HMI组态 、包含内容:①三种液体博途PLC与HMI仿真工程?(
- 高校体育场馆运营管理系统的设计与实现 开题报告申请书 (1)
- ZHENG YING PASSPORT.pdf
- GoogleDriveSetup.95.0.2.0.exe
- 企业客户信息反馈平台代码系统 Springboot企业客户信息反馈平台,包括程序,中文注释,配置说明操作步骤
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)