package com.dao.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.dao.ILeader_groupDao;
import com.entity.Consum;
import com.entity.ConsumDetail;
import com.entity.ConsumStock_in;
import com.entity.ConsumStock_out;
import com.entity.EquipmentMaintance;
import com.entity.Member_daily;
import com.entity.User;
import com.entity.Yuyue;
import com.util.jdbc.DBConnection;
public class Leader_groupDao implements ILeader_groupDao{
Connection conn = null;
PreparedStatement pstmt = null;// sql语句预编译对象
String sql = null;
ResultSet rs = null;
private int currentpage = 1;
private int pagesize = 3;
int lastpage;
public Leader_groupDao() {
// TODO Auto-generated constructor stub
super();
conn = DBConnection.getConnection();
}
public List<Yuyue> findall(int currentpage1,String experiment) throws Exception{
// TODO Auto-generated method stub
List<Yuyue> courselist = new ArrayList<Yuyue>();
PreparedStatement pstmt = null;
String sql = "select * from yuyue where flag='0' and experiment_room=?";
pstmt = this.conn.prepareStatement(sql);
pstmt.setString(1, experiment);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
Yuyue course = new Yuyue();
course.setCourse(rs.getString("course"));
course.setExperiment(rs.getString("experiment"));
course.setTeacherName(rs.getString("teacherName"));
course.setExperiment_room(rs.getString("experiment_room"));
course.setClassNum(rs.getString("classNum"));
course.setPersonNum(rs.getString("personNum"));
course.setTime(rs.getString("exTime"));
course.setAllTime(rs.getString("allTime"));
course.setThrough(rs.getString("through"));
course.setSite(rs.getString("site"));
course.setWeekDay(rs.getString("weekday"));
courselist.add(course);
}
rs.close();
int listlength = courselist.size();
this.currentpage = currentpage1;
if (listlength % pagesize == 0) {
this.lastpage = listlength / pagesize;
} else {
this.lastpage = listlength / pagesize + 1;
}
if (this.currentpage < 1)
this.currentpage = 1;
if (this.currentpage > this.lastpage)
this.currentpage = this.lastpage;
int startindex = (this.currentpage - 1) * pagesize;
int endindex = startindex + pagesize;
if (endindex > listlength)
endindex = listlength;
courselist = courselist.subList(startindex, endindex);
return courselist;
}
public int courselistSize(int currentpage1,String experiment) throws Exception{
// TODO Auto-generated method stub
List<Yuyue> courselist = new ArrayList<Yuyue>();
PreparedStatement pstmt = null;
String sql = "select * from yuyue where flag='0' and experiment_room=?";
pstmt = this.conn.prepareStatement(sql);
pstmt.setString(1, experiment);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
Yuyue course = new Yuyue();
course.setCourse(rs.getString("course"));
course.setExperiment(rs.getString("experiment"));
course.setTeacherName(rs.getString("teacherName"));
course.setClassNum(rs.getString("classNum"));
course.setPersonNum(rs.getString("personNum"));
course.setTime(rs.getString("exTime"));
course.setAllTime(rs.getString("allTime"));
course.setThrough(rs.getString("through"));
course.setSite(rs.getString("site"));
courselist.add(course);
}
rs.close();
int listlength = courselist.size();
return listlength;
}
public int getLastPage(String experiment) throws Exception {
int count = 0;
PreparedStatement pstmt = null;
String sql = "select count(*) from yuyue where flag='0' and experiment_room=?";
try {
pstmt = this.conn.prepareStatement(sql);
pstmt.setString(1, experiment);
ResultSet rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
pstmt.close();
} catch (Exception e2) {
// TODO: handle exception
}
}
if (count % pagesize == 0) {
lastpage = count / pagesize;
} else {
lastpage = count / pagesize + 1;
}
return lastpage;
}
public boolean updateYuyueFlag(int id) throws Exception{
boolean flag=false;
PreparedStatement pstmt=null;
String sql="update yuyue set flag='1' where id=?";
try{
pstmt=this.conn.prepareStatement(sql);
pstmt.setInt(1,id);
int count=pstmt.executeUpdate();
if(count>0){
flag=true;
//System.out.println("update success");
}
}catch(Exception e){
throw e;
}finally{
try{
pstmt.close();
}catch(Exception e){}
}
return flag;
// TODO Auto-generated method stub
}
public boolean DeleteFlag(int id) throws Exception {
// TODO Auto-generated method stub
boolean flag=false;
PreparedStatement pstmt=null;
String sql="delete from yuyue where id=?";
try{
pstmt=this.conn.prepareStatement(sql);
pstmt.setInt(1,id);
int count=pstmt.executeUpdate();
if(count>0){
flag=true;
//System.out.println("delete success");
}
}catch(Exception e){
throw e;
}finally{
try {
pstmt.close();
} catch (Exception e2) {
// TODO: handle exception
}
}
return flag;
}
//同时插入审核未通过表
public void registerYuyue(String course,String experiment_room,String experiment,String username,String teachername,String classNum,String personNum,String exTime,String allTime,String site,String weekday,String through)
{
String sql = "insert into yuyueno (course,experiment_room,experiment,username,teacherName,classNum,personNum,exTime,allTime,site,weekday,through,flag)values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
try
{
this.pstmt = this.conn.prepareStatement(sql);
this.pstmt.setString(1, course);
this.pstmt.setString(2, experiment_room);
this.pstmt.setString(3,experiment);
this.pstmt.setString(4, username);
this.pstmt.setString(5, teachername);
this.pstmt.setString(6, classNum);
this.pstmt.setString(7, personNum);
this.pstmt.setString(8, exTime);
this.pstmt.setString(9,allTime);
this.pstmt.setString(10, site);
this.pstmt.setString(11, weekday);
this.pstmt.setString(12, through);
this.pstmt.setString(13, "2");
this.pstmt.executeUpdate();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
public void insertClasstable(String course, String teacherName, String experiment, String classNum, String site, String time, String through, String weekday)
{
String course1 = course + experiment;
String sql = "insert into classTable values(?,?,?,?,?,?,?)";
try
{
this.pstmt = this.conn.prepareStatement(sql);
this.pstmt.setString(1, course1);
this.pstmt.setString(2, teacherName);
this.pstmt.setString(3, classNum);
this.pstmt.setString(4, time);
this.pstmt.setString(5, site);
this.pstmt.setString(6, through);
this.pstmt.setString(7, weekday);
this.pstmt.executeUpdate();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
public boolean enterConsume(Consum consum) {
// TODO Auto-generated method stub
boolean flag=false;
String sql = "insert into consum_cata (goodsNumber,name,type,date_produce,unit,unit_price,number,manufacturer,save_address,save_life,bei) values(?,?,?,?,?,?,?,?,?,?,?)";
try {
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, consum.getGoodsNumber());
pstmt.setString(2, consum.getName()
没有合适的资源?快使用搜索试试~ 我知道了~
实验室管理系统
共804个文件
js:232个
java:114个
class:114个
3星 · 超过75%的资源 需积分: 44 121 下载量 21 浏览量
2017-09-04
17:02:35
上传
评论 15
收藏 5.72MB ZIP 举报
温馨提示
java实现,包含小部分的js,实验室管理系统,包括实验设备的管理(包括实验用品,实验设备报修等等)、实验员的管理、任课教师的管理以及学生选实验课都有,界面友好,可以使用,数据库可以根据实体类自己创建,谢谢支持!
资源推荐
资源详情
资源评论
收起资源包目录
实验室管理系统 (804个子文件)
ScriptResource.axd 254KB
ScriptResource(1).axd 64KB
WebResource.axd 20KB
Leader_groupDao.class 24KB
AdminiDao.class 21KB
TeacherDao.class 20KB
UserDao.class 8KB
ClassForm.class 7KB
Email.class 7KB
Mail.class 7KB
MemberDao.class 6KB
TeacherServiceImpl.class 6KB
Leader_groupServiceImpl.class 5KB
UserServlet.class 5KB
UploadHandleServlet.class 5KB
EnterConsumStock_in.class 5KB
TijiaoCheckServlet.class 4KB
AdminiServiceImpl.class 4KB
EnterConsumStock_out.class 4KB
GongzuoliangServlet.class 4KB
SelectEquipment_BaofeiByYearServlet.class 4KB
EnterMemberDailyServlet.class 4KB
EnterEquipment_MaintenceServlet.class 3KB
DownLoadServlet.class 3KB
EnterEquipBaofeiServlet.class 3KB
YuyueServlet.class 3KB
SelectEquipment_BaofeiByYearServlet1.class 3KB
SelectConsumStockOutServlet1.class 3KB
Yuyue.class 3KB
EnterConsumGuiHuanServlet.class 3KB
SelectCourseByCourseNum.class 3KB
Equipment_mingxi.class 3KB
EnterEquipment_BaoXiuServlet.class 3KB
sendEmailServlet.class 3KB
EnterPersonInforServlet.class 3KB
SelectPersonNumByClassNumServlet.class 3KB
DBConnection.class 3KB
SelectCourseByClassNumServlet.class 3KB
SelectClassNumByUsernameServlet.class 3KB
SelectExperimentByCourseServlet.class 3KB
EnterEquipment_runningServlet.class 3KB
SelectCourseByUsernameServlet.class 3KB
registerServlet.class 3KB
MyCourseTableServlet.class 3KB
SelectEquipMainExperimentServlet.class 3KB
GuihuanServlet.class 3KB
SelectEquipMaintanceNameServlet.class 3KB
ChushihuaServlet.class 3KB
DBConnection1.class 3KB
SelectNews.class 3KB
SelectByKuCunServlet.class 3KB
LookGuiHuanByConsum_outServlet.class 3KB
CourseList.class 3KB
SelectYuyueFormServlet.class 3KB
Consum.class 3KB
SelectCourseByCourseServlet.class 3KB
TeacherCheckYuyueServlet.class 3KB
TestThroughYear.class 2KB
SelectEquipment_MingxiBynameServlet.class 2KB
Member_daily.class 2KB
ChangePassServlet.class 2KB
SelectConsunCateByTuiJianServlet.class 2KB
LookEquipmentBreakdawnServlet.class 2KB
MemberServiceImpl.class 2KB
MoreGongGaoServlet.class 2KB
MoreShiYanServlet.class 2KB
SelectEquipentMingXiServlet.class 2KB
SelectSiteByExperiment_roomServlet.class 2KB
LookGongGaoServlet.class 2KB
SelectClassFormServlet11.class 2KB
TestFormatDate.class 2KB
UpdateQXServlet.class 2KB
LookShiYanServlet.class 2KB
EnterConsumServlet.class 2KB
NewsServlet.class 2KB
UserServiceImpl.class 2KB
TijiaoNewsServlet.class 2KB
SelectClassFormServlet.class 2KB
ConsumStock_out.class 2KB
Statistic_all_dailyServlet.class 2KB
SelectConsum_cataServlet.class 2KB
SelectMemberDailyServlet.class 2KB
Statistic_single_dailyServlet.class 2KB
ConsumDetailServlet.class 2KB
SelectConsumStockOutServlet.class 2KB
EquipmentMaintance.class 2KB
TeacherService.class 2KB
SelectSingle_dailyServlet.class 2KB
AdminiService.class 2KB
MD5.class 2KB
Equipment_breakdown_submit.class 2KB
ITeacherDao.class 2KB
SelectEquipBreakDownServlet.class 2KB
ClassForm1.class 2KB
SelectMemberServlet.class 2KB
GongGao.class 2KB
mail.class 2KB
ConsumStock_in.class 2KB
Leader_groupService.class 2KB
IAdminiDao.class 2KB
共 804 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- IT_lau2018-01-16脚本脚本呢????
- collys2017-12-12是我要的。
yangyang9310
- 粉丝: 5
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功