diff --git a/lib/javax.annotation.jar b/lib/javax.annotation.jar index 52dca7f..34047f3 100644 Binary files a/lib/javax.annotation.jar and b/lib/javax.annotation.jar differ diff --git a/out/production/dormitorySystem/com/itheima/dao/AdminDao.xml b/out/production/dormitorySystem/com/itheima/dao/AdminDao.xml index 1768369..51976de 100644 --- a/out/production/dormitorySystem/com/itheima/dao/AdminDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/AdminDao.xml @@ -1,95 +1,118 @@ + + - + - + - - select count(a_id) from d_admin + and a_username like '%${a_username}%' + and a_describe like '%${a_describe}%' + and a_id like '%${a_id}%' - + insert into d_admin (a_username,a_password,a_name,a_phone,a_power,a_describe) values(#{a_username},#{a_password},#{a_name},#{a_phone},#{a_power},#{a_describe}) - + delete from d_admin where a_id=#{a_id} - select * from d_admin where a_id=#{a_id} + - + update d_admin + a_username=#{a_username}, + a_password=#{a_password}, + a_name=#{a_name}, + a_phone=#{a_phone}, + a_power=#{a_power}, + a_describe=#{a_describe}, + where a_id = #{a_id} diff --git a/out/production/dormitorySystem/com/itheima/dao/ClassDao.xml b/out/production/dormitorySystem/com/itheima/dao/ClassDao.xml index e77c088..9adbd7a 100644 --- a/out/production/dormitorySystem/com/itheima/dao/ClassDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/ClassDao.xml @@ -1,80 +1,103 @@  + + - + - - select count(c_id) from d_class + and c_classname like '%${c_classname}%' + and c_counsellor like '%${c_counsellor}%' + and c_classid like '%${c_classid}%' - + delete from d_class where c_id=#{c_id} - + + insert into d_class (c_classid,c_classname,c_counsellor) values(#{c_classid},#{c_classname},#{c_counsellor}) - select * from d_class where c_id=#{c_id} - + + update d_class + c_classid=#{c_classid}, + c_classname=#{c_classname}, + c_counsellor=#{c_counsellor}, + where c_id = #{c_id} - - - + + + + + + + @@ -87,18 +110,21 @@ - + + diff --git a/out/production/dormitorySystem/com/itheima/dao/DormCleanDao.xml b/out/production/dormitorySystem/com/itheima/dao/DormCleanDao.xml index 46dfbee..d78cd8d 100644 --- a/out/production/dormitorySystem/com/itheima/dao/DormCleanDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/DormCleanDao.xml @@ -1,80 +1,98 @@ + + - + - - select count(g_id) from d_dormgrade + - and d_id like '%${d_id}%' + and d_id like '%${d_id}%' + - and d_dormbuilding like '%${d_dormbuilding}%' + and d_dormbuilding like '%${d_dormbuilding}%' - + - insert into d_dormgrade (d_id,d_dormbuilding,d_grade,create_time,update_time) - values(#{d_id},#{d_dormbuilding},#{d_grade},now(),now()) + + insert into d_dormgrade (d_id, d_dormbuilding, d_grade, create_time, update_time) + values (#{d_id}, #{d_dormbuilding}, #{d_grade}, now(), now()) - - + + delete from d_dormgrade where g_id=#{g_id} - select * from d_dormgrade where g_id=#{g_id} - + update d_dormgrade + d_id=#{d_id}, + d_dormbuilding=#{d_dormbuilding}, + d_grade=#{d_grade}, - + + update_time = now(), + where g_id = #{g_id} + - + + - + + - diff --git a/out/production/dormitorySystem/com/itheima/dao/DormRepairDao.xml b/out/production/dormitorySystem/com/itheima/dao/DormRepairDao.xml index d2faf71..816b15b 100644 --- a/out/production/dormitorySystem/com/itheima/dao/DormRepairDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/DormRepairDao.xml @@ -1,87 +1,108 @@ + + - + - - + select count(r_id) from d_dormrepair + - and d_id like '%${d_id}%' + and d_id like '%${d_id}%' + - and d_dormbuilding like '%${d_dormbuilding}%' + and d_dormbuilding like '%${d_dormbuilding}%' - + - insert into d_dormrepair (d_id,d_dormbuilding,r_name,reason,create_time,update_time) - values(#{d_id},#{d_dormbuilding},#{r_name},#{reason},now(),now()) + + insert into d_dormrepair (d_id, d_dormbuilding, r_name, reason, create_time, update_time) + values (#{d_id}, #{d_dormbuilding}, #{r_name}, #{reason}, now(), now()) - - + + delete from d_dormrepair where r_id=#{r_id} - select * from d_dormrepair where r_id=#{r_id} + - + update d_dormrepair + d_id=#{d_id}, + d_dormbuilding=#{d_dormbuilding}, + r_name=#{r_name}, + reason=#{reason}, - + + update_time=now(), + where r_id = #{r_id} - + + - - + + + - diff --git a/out/production/dormitorySystem/com/itheima/dao/DormitoryDao.xml b/out/production/dormitorySystem/com/itheima/dao/DormitoryDao.xml index db80f34..1dab2bf 100644 --- a/out/production/dormitorySystem/com/itheima/dao/DormitoryDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/DormitoryDao.xml @@ -1,88 +1,117 @@  + + - + - - + select count(s_dormitoryid) from d_dormitoryinfo + - and a_name like '%${a_name}%' + and a_name like '%${a_name}%' + - and s_dormitoryid like '%${s_dormitoryid}%' + and s_dormitoryid like '%${s_dormitoryid}%' + - and d_dormbuilding like '%${d_dormbuilding}%' + and d_dormbuilding like '%${d_dormbuilding}%' - + - + - insert into d_dormitoryinfo (s_dormitoryid,d_dormbuilding,d_bedtotal,d_bed,a_name) - values(#{s_dormitoryid},#{d_dormbuilding},#{d_bedtotal},#{d_bed},#{a_name}) + + insert into d_dormitoryinfo (s_dormitoryid, d_dormbuilding, d_bedtotal, d_bed, a_name) + values (#{s_dormitoryid}, #{d_dormbuilding}, #{d_bedtotal}, #{d_bed}, #{a_name}) - - + + delete from d_dormitoryinfo where d_id=#{d_id} - select * from d_dormitoryinfo where d_id=#{d_id} - + update d_dormitoryinfo + s_dormitoryid=#{s_dormitoryid}, + d_dormbuilding=#{d_dormbuilding}, + d_bedtotal=#{d_bedtotal}, + d_bed=#{d_bed}, + a_name=#{a_name}, + where d_id = #{d_id} - + + - - + + + + + + + + + @@ -95,13 +124,16 @@ + + diff --git a/out/production/dormitorySystem/com/itheima/dao/StudentCleanDao.xml b/out/production/dormitorySystem/com/itheima/dao/StudentCleanDao.xml index 61b0dfe..12ae8f7 100644 --- a/out/production/dormitorySystem/com/itheima/dao/StudentCleanDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/StudentCleanDao.xml @@ -1,96 +1,119 @@ + + - + - - + select count(g_id) from d_stgrade + - and s_studentid like '%${s_studentid}%' + and s_studentid like '%${s_studentid}%' + - and s_name like '%${s_name}%' + and s_name like '%${s_name}%' + - and s_dormitoryid like '%${s_dormitoryid}%' + and s_dormitoryid like '%${s_dormitoryid}%' - + - insert into d_stgrade (s_studentid,s_name,s_grade,s_classid,s_dormitoryid,create_time,update_time) - values(#{s_studentid},#{s_name},#{s_grade},#{s_classid},#{s_dormitoryid},now(),now()) + + insert into d_stgrade (s_studentid, s_name, s_grade, s_classid, s_dormitoryid, create_time, update_time) + values (#{s_studentid}, #{s_name}, #{s_grade}, #{s_classid}, #{s_dormitoryid}, now(), now()) - - + + delete from d_stgrade where g_id=#{g_id} - select * from d_stgrade where g_id=#{g_id} + - + update d_stgrade + s_studentid=#{s_studentid}, + s_name=#{s_name}, + s_grade=#{s_grade}, + s_classid=#{s_classid}, + s_dormitoryid=#{s_dormitoryid}, - + + update_time = now(), + where g_id = #{g_id} - + + - - - - - + + + + + + - diff --git a/out/production/dormitorySystem/com/itheima/dao/StudentDao.xml b/out/production/dormitorySystem/com/itheima/dao/StudentDao.xml index 10997e3..9eec920 100644 --- a/out/production/dormitorySystem/com/itheima/dao/StudentDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/StudentDao.xml @@ -1,92 +1,121 @@  + + - + - - + select count(s_studentid) from d_student - - and s_name like '%${s_name}%' - - - and s_studentid like '%${s_studentid}%' - - - and s_classid like '%${s_classid}%' - - - and s_classname like '%${s_classname}%' - - + + + and s_name like '%${s_name}%' + + + + and s_studentid like '%${s_studentid}%' + + + + and s_classid like '%${s_classid}%' + + + + and s_classname like '%${s_classname}%' + + - - + + + delete from d_student where s_id=#{s_id} - + + - insert into d_student (s_studentid,s_name,s_sex,s_age,s_phone,s_classid,s_classname,s_dormitoryid) - values(#{s_studentid},#{s_name},#{s_sex},#{s_age},#{s_phone},#{s_classid},#{s_classname},#{s_dormitoryid}) + + insert into d_student (s_studentid, s_name, s_sex, s_age, s_phone, s_classid, s_classname, s_dormitoryid) + values (#{s_studentid}, #{s_name}, #{s_sex}, #{s_age}, #{s_phone}, #{s_classid}, #{s_classname}, #{s_dormitoryid}) - - + select * from d_student where s_id=#{s_id} - + + update d_student + s_studentid=#{s_studentid}, + s_name=#{s_name}, + s_sex=#{s_sex}, + s_age=#{s_age}, + s_phone=#{s_phone}, + s_classid=#{s_classid}, + s_classname=#{s_classname}, + s_dormitoryid=#{s_dormitoryid}, + where s_id = #{s_id} + diff --git a/out/production/dormitorySystem/com/itheima/dao/VisitorDao.xml b/out/production/dormitorySystem/com/itheima/dao/VisitorDao.xml index 493d10d..843f6bd 100644 --- a/out/production/dormitorySystem/com/itheima/dao/VisitorDao.xml +++ b/out/production/dormitorySystem/com/itheima/dao/VisitorDao.xml @@ -1,42 +1,54 @@ + + - + - - + select count(v_id) from d_visitor + - and v_name like '%${v_name}%' + and v_name like '%${v_name}%' + - and v_phone like '%${v_phone}%' + and v_phone like '%${v_phone}%' - + - insert into d_visitor (v_name,v_phone,v_dormitoryid,v_dormbuilding,create_time) - values(#{v_name},#{v_phone},#{v_dormitoryid},#{v_dormbuilding},now()) + + insert into d_visitor (v_name, v_phone, v_dormitoryid, v_dormbuilding, create_time) + values (#{v_name}, #{v_phone}, #{v_dormitoryid}, #{v_dormbuilding}, now()) + diff --git a/src/com/itheima/po/Admin.java b/src/com/itheima/po/Admin.java index b850c78..c2ea357 100644 --- a/src/com/itheima/po/Admin.java +++ b/src/com/itheima/po/Admin.java @@ -1,74 +1,97 @@ package com.itheima.po; +// 导入用于处理 JSON 注解的类 import com.fasterxml.jackson.annotation.JsonIgnore; +// 表示管理员实体的类 public class Admin { - private Integer a_id; - private String a_username; + // 管理员ID(主键) + private Integer a_id; + // 管理员用户名 + private String a_username; + // 管理员密码(使用 @JsonIgnore 注解,JSON 序列化时忽略该字段) @JsonIgnore - private String a_password; + private String a_password; - private String a_name; - private Integer a_phone; + // 管理员姓名 + private String a_name; + // 管理员电话号码 + private Integer a_phone; + // 管理员权限级别(使用 @JsonIgnore 注解,JSON 序列化时忽略该字段) @JsonIgnore - private Integer a_power; + private Integer a_power; - private String a_describe; + // 管理员描述或备注信息 + private String a_describe; + // 获取管理员ID的方法 public Integer getA_id() { return a_id; } + // 设置管理员ID的方法 public void setA_id(Integer a_id) { this.a_id = a_id; } + // 获取管理员用户名的方法 public String getA_username() { return a_username; } + // 设置管理员用户名的方法 public void setA_username(String a_username) { this.a_username = a_username; } + // 获取管理员密码的方法 public String getA_password() { return a_password; } + // 设置管理员密码的方法 public void setA_password(String a_password) { this.a_password = a_password; } + // 获取管理员姓名的方法 public String getA_name() { return a_name; } + // 设置管理员姓名的方法 public void setA_name(String a_name) { this.a_name = a_name; } + // 获取管理员电话号码的方法 public Integer getA_phone() { return a_phone; } + // 设置管理员电话号码的方法 public void setA_phone(Integer a_phone) { this.a_phone = a_phone; } + // 获取管理员权限级别的方法 public Integer getA_power() { return a_power; } + // 设置管理员权限级别的方法 public void setA_power(Integer a_power) { this.a_power = a_power; } + // 获取管理员描述信息的方法 public String getA_describe() { return a_describe; } + // 设置管理员描述信息的方法 public void setA_describe(String a_describe) { this.a_describe = a_describe; } diff --git a/src/com/itheima/po/Class.java b/src/com/itheima/po/Class.java index 54ef098..b0767f8 100644 --- a/src/com/itheima/po/Class.java +++ b/src/com/itheima/po/Class.java @@ -1,51 +1,67 @@ package com.itheima.po; +// 导入链表类,用于存储学生对象的列表 import java.util.List; +// 表示班级实体的类 public class Class { - private Integer c_id; - private Integer c_classid; - private String c_classname; - private String c_counsellor; - //班级与学生为一对多关系,使用链表 - private List students; + // 班级主键ID + private Integer c_id; + // 班级编号 + private Integer c_classid; + // 班级名称 + private String c_classname; + // 班级辅导员姓名 + private String c_counsellor; + // 班级与学生为一对多关系,使用链表存储学生对象 + private List students; + // 获取班级主键ID的方法 public Integer getC_id() { return c_id; } + // 设置班级主键ID的方法 public void setC_id(Integer c_id) { this.c_id = c_id; } + // 获取班级编号的方法 public Integer getC_classid() { return c_classid; } + // 设置班级编号的方法 public void setC_classid(Integer c_classid) { this.c_classid = c_classid; } + // 获取班级名称的方法 public String getC_classname() { return c_classname; } + // 设置班级名称的方法 public void setC_classname(String c_classname) { this.c_classname = c_classname; } + // 获取班级辅导员姓名的方法 public String getC_counsellor() { return c_counsellor; } + // 设置班级辅导员姓名的方法 public void setC_counsellor(String c_counsellor) { this.c_counsellor = c_counsellor; } + // 获取学生列表的方法 public List getStudents() { return students; } + // 设置学生列表的方法 public void setStudents(List students) { this.students = students; } diff --git a/src/com/itheima/po/DormClean.java b/src/com/itheima/po/DormClean.java index 65b934c..2f15d42 100644 --- a/src/com/itheima/po/DormClean.java +++ b/src/com/itheima/po/DormClean.java @@ -1,72 +1,92 @@ package com.itheima.po; +// 导入 Jackson 注解,用于格式化日期时间 import com.fasterxml.jackson.annotation.JsonFormat; +// 导入日期类,用于表示时间 import java.util.Date; /** * @program: dormitorySystem - * @description: 宿舍卫生 + * @description: 宿舍卫生实体类 * @author: Joyrocky * @create: 2019-04-24 11:21 **/ public class DormClean { + // 宿舍卫生记录的主键ID private Integer g_id; + // 宿舍ID private Integer d_id; - private String d_dormbuilding; + // 宿舍楼名称 + private String d_dormbuilding; + // 卫生评分 private Integer d_grade; + // 创建时间,使用 @JsonFormat 注解格式化为 yyyy-MM-dd HH:mm:ss 格式,并指定时区为 GMT+8 @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date create_time; + + // 更新时间,使用 @JsonFormat 注解格式化为 yyyy-MM-dd HH:mm:ss 格式,并指定时区为 GMT+8 @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date update_time; + // 获取主键ID的方法 public Integer getG_id() { return g_id; } + // 设置主键ID的方法 public void setG_id(Integer g_id) { this.g_id = g_id; } + // 获取宿舍ID的方法 public Integer getD_id() { return d_id; } + // 设置宿舍ID的方法 public void setD_id(Integer d_id) { this.d_id = d_id; } + // 获取宿舍楼名称的方法 public String getD_dormbuilding() { return d_dormbuilding; } + // 设置宿舍楼名称的方法 public void setD_dormbuilding(String d_dormbuilding) { this.d_dormbuilding = d_dormbuilding; } + // 获取卫生评分的方法 public Integer getD_grade() { return d_grade; } + // 设置卫生评分的方法 public void setD_grade(Integer d_grade) { this.d_grade = d_grade; } + // 获取创建时间的方法 public Date getCreate_time() { return create_time; } + // 设置创建时间的方法 public void setCreate_time(Date create_time) { this.create_time = create_time; } + // 获取更新时间的方法 public Date getUpdate_time() { return update_time; } + // 设置更新时间的方法 public void setUpdate_time(Date update_time) { this.update_time = update_time; } } - diff --git a/src/com/itheima/po/DormRepair.java b/src/com/itheima/po/DormRepair.java index c42869d..d1615c8 100644 --- a/src/com/itheima/po/DormRepair.java +++ b/src/com/itheima/po/DormRepair.java @@ -1,81 +1,104 @@ package com.itheima.po; +// 导入 Jackson 注解,用于格式化日期时间 import com.fasterxml.jackson.annotation.JsonFormat; +// 导入日期类,用于表示时间 import java.util.Date; /** * @program: dormitorySystem - * @description: 维修登记 + * @description: 维修登记实体类 * @author: Joyrocky * @create: 2019-04-28 00:23 **/ public class DormRepair { + // 维修记录主键ID private int r_id; + // 宿舍ID private int d_id; + // 宿舍楼编号 private int d_dormbuilding; + // 报修人姓名 private String r_name; + // 报修原因 private String reason; + // 创建时间,使用 @JsonFormat 注解格式化为 yyyy-MM-dd HH:mm:ss 格式,并指定时区为 GMT+8 @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date create_time; + + // 更新时间,使用 @JsonFormat 注解格式化为 yyyy-MM-dd HH:mm:ss 格式,并指定时区为 GMT+8 @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date update_time; + // 获取维修记录主键ID的方法 public int getR_id() { return r_id; } + // 设置维修记录主键ID的方法 public void setR_id(int r_id) { this.r_id = r_id; } + // 获取宿舍ID的方法 public int getD_id() { return d_id; } + // 设置宿舍ID的方法 public void setD_id(int d_id) { this.d_id = d_id; } + // 获取宿舍楼编号的方法 public int getD_dormbuilding() { return d_dormbuilding; } + // 设置宿舍楼编号的方法 public void setD_dormbuilding(int d_dormbuilding) { this.d_dormbuilding = d_dormbuilding; } + // 获取报修人姓名的方法 public String getR_name() { return r_name; } + // 设置报修人姓名的方法 public void setR_name(String r_name) { this.r_name = r_name; } + // 获取报修原因的方法 public String getReason() { return reason; } + // 设置报修原因的方法 public void setReason(String reason) { this.reason = reason; } + // 获取创建时间的方法 public Date getCreate_time() { return create_time; } + // 设置创建时间的方法 public void setCreate_time(Date create_time) { this.create_time = create_time; } + // 获取更新时间的方法 public Date getUpdate_time() { return update_time; } + // 设置更新时间的方法 public void setUpdate_time(Date update_time) { this.update_time = update_time; } } - diff --git a/src/com/itheima/po/Dormitory.java b/src/com/itheima/po/Dormitory.java index 56132a9..35c8c7f 100644 --- a/src/com/itheima/po/Dormitory.java +++ b/src/com/itheima/po/Dormitory.java @@ -1,71 +1,102 @@ package com.itheima.po; +// 导入 Serializable 接口,用于支持序列化 import java.io.Serializable; +// 导入链表类,用于存储学生对象的列表 import java.util.List; +// 表示宿舍实体的类,实现 Serializable 接口支持序列化 public class Dormitory implements Serializable { + // 序列化版本号,用于保证序列化和反序列化的一致性 private static final long serialVersionUID = 1L; - private Integer d_id; - private Integer s_dormitoryid; - private String d_dormbuilding; - private String d_bedtotal; - private String d_bed; - private String a_name; + // 宿舍主键ID + private Integer d_id; + // 学生宿舍编号 + private Integer s_dormitoryid; + // 宿舍楼名称 + private String d_dormbuilding; + // 宿舍床位总数 + private String d_bedtotal; + // 宿舍当前空床位数 + private String d_bed; + // 宿舍管理员姓名 + private String a_name; + + // 存储宿舍对应学生对象的列表 private List students; + // 获取序列化版本号的方法 public static long getSerialVersionUID() { return serialVersionUID; } + // 获取宿舍主键ID的方法 public Integer getD_id() { return d_id; } + // 设置宿舍主键ID的方法 public void setD_id(Integer d_id) { this.d_id = d_id; } + // 获取学生宿舍编号的方法 public Integer getS_dormitoryid() { return s_dormitoryid; } + // 设置学生宿舍编号的方法 public void setS_dormitoryid(Integer s_dormitoryid) { this.s_dormitoryid = s_dormitoryid; } - public String getD_dormbuilding() {return d_dormbuilding;} + // 获取宿舍楼名称的方法 + public String getD_dormbuilding() { + return d_dormbuilding; + } - public void setD_dormbuilding(String d_dormbuilding) {this.d_dormbuilding = d_dormbuilding;} + // 设置宿舍楼名称的方法 + public void setD_dormbuilding(String d_dormbuilding) { + this.d_dormbuilding = d_dormbuilding; + } + // 获取宿舍床位总数的方法 public String getD_bedtotal() { return d_bedtotal; } + // 设置宿舍床位总数的方法 public void setD_bedtotal(String d_bedtotal) { this.d_bedtotal = d_bedtotal; } + // 获取宿舍当前空床位数的方法 public String getD_bed() { return d_bed; } + // 设置宿舍当前空床位数的方法 public void setD_bed(String d_bed) { this.d_bed = d_bed; } + // 获取宿舍管理员姓名的方法 public String getA_name() { return a_name; } + // 设置宿舍管理员姓名的方法 public void setA_name(String a_name) { this.a_name = a_name; } + // 获取宿舍对应学生列表的方法 public List getStudents() { return students; } + // 设置宿舍对应学生列表的方法 public void setStudents(List students) { this.students = students; } diff --git a/src/com/itheima/po/PageInfo.java b/src/com/itheima/po/PageInfo.java index 568112e..f15c073 100644 --- a/src/com/itheima/po/PageInfo.java +++ b/src/com/itheima/po/PageInfo.java @@ -1,65 +1,84 @@ package com.itheima.po; +// 导入 Serializable 接口,用于支持序列化 import java.io.Serializable; +// 导入集合类,用于存储分页数据 import java.util.ArrayList; import java.util.List; +// 通用分页信息类,支持泛型 T,用于表示分页数据 public class PageInfo implements Serializable { - private Integer pageIndex =1;//页码 - private Integer pageSize =3;//显示条数 - private Integer totalCount =0; //总条数 - private Integer pageTotalCount =0; //总页数 - //每页显示的数据集合 + // 序列化版本号,用于保证序列化和反序列化的一致性 + private static final long serialVersionUID = 1L; + + // 当前页码,默认值为 1 + private Integer pageIndex = 1; + // 每页显示的数据条数,默认值为 3 + private Integer pageSize = 3; + // 数据总条数,默认值为 0 + private Integer totalCount = 0; + // 总页数,默认值为 0 + private Integer pageTotalCount = 0; + // 每页显示的数据集合,使用泛型 T,并初始化为空列表 private List list = new ArrayList(); + // 获取当前页码的方法 public Integer getPageIndex() { return pageIndex; } + // 设置当前页码的方法,若页码小于 1,则默认设置为 1 public void setPageIndex(Integer pageIndex) { this.pageIndex = pageIndex; - if (pageIndex==null || pageIndex<1){ - this.pageIndex =1; + if (pageIndex == null || pageIndex < 1) { + this.pageIndex = 1; } } + // 获取每页显示数据条数的方法 public Integer getPageSize() { return pageSize; } + // 设置每页显示数据条数的方法,若小于 1,则默认设置为 3 public void setPageSize(Integer pageSize) { this.pageSize = pageSize; - if (pageSize ==null || pageSize<1){ - this.pageSize =3; + if (pageSize == null || pageSize < 1) { + this.pageSize = 3; } } + // 获取数据总条数的方法 public Integer getTotalCount() { return totalCount; } + // 设置数据总条数的方法 public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; } - //获取总页数 + // 获取总页数的方法,根据总条数和每页条数计算 public Integer getPageTotalCount() { - - this.pageTotalCount = totalCount/pageSize; - if(totalCount%pageSize!=0){ - this.pageTotalCount ++; + this.pageTotalCount = totalCount / pageSize; + // 如果总条数不能被每页条数整除,则总页数加 1 + if (totalCount % pageSize != 0) { + this.pageTotalCount++; } return pageTotalCount; } + // 设置总页数的方法(通常不需要手动设置) public void setPageTotalCount(Integer pageTotalCount) { this.pageTotalCount = pageTotalCount; } + // 获取每页数据集合的方法 public List getList() { return list; } + // 设置每页数据集合的方法 public void setList(List list) { this.list = list; } diff --git a/src/com/itheima/po/Student.java b/src/com/itheima/po/Student.java index a620c4e..3656f23 100644 --- a/src/com/itheima/po/Student.java +++ b/src/com/itheima/po/Student.java @@ -1,91 +1,121 @@ package com.itheima.po; +// 学生实体类,包含学生的基本信息 public class Student { + // 序列化版本号,用于保证序列化和反序列化的一致性 private static final long serialVersionUID = 1L; - private Integer s_id; - private Integer s_studentid; - private String s_name; - private String s_sex; - private Integer s_age; - private Integer s_phone; - private Integer s_classid; - private String s_classname; - private Integer s_dormitoryid; + // 学生的唯一标识(ID) + private Integer s_id; + // 学号 + private Integer s_studentid; + // 学生姓名 + private String s_name; + // 学生性别 + private String s_sex; + // 学生年龄 + private Integer s_age; + // 学生手机号码 + private Integer s_phone; + // 学生所在班级ID + private Integer s_classid; + // 学生班级名称 + private String s_classname; + // 学生所在宿舍ID + private Integer s_dormitoryid; + + // 获取序列化版本号的方法 public static long getSerialVersionUID() { return serialVersionUID; } + // 获取学生ID的方法 public Integer getS_id() { return s_id; } + // 设置学生ID的方法 public void setS_id(Integer s_id) { this.s_id = s_id; } + // 获取学号的方法 public Integer getS_studentid() { return s_studentid; } + // 设置学号的方法 public void setS_studentid(Integer s_studentid) { this.s_studentid = s_studentid; } + // 获取学生姓名的方法 public String getS_name() { return s_name; } + // 设置学生姓名的方法 public void setS_name(String s_name) { this.s_name = s_name; } + // 获取学生性别的方法 public String getS_sex() { return s_sex; } + // 设置学生性别的方法 public void setS_sex(String s_sex) { this.s_sex = s_sex; } + // 获取学生年龄的方法 public Integer getS_age() { return s_age; } + // 设置学生年龄的方法 public void setS_age(Integer s_age) { this.s_age = s_age; } + // 获取学生手机号码的方法 public Integer getS_phone() { return s_phone; } + // 设置学生手机号码的方法 public void setS_phone(Integer s_phone) { this.s_phone = s_phone; } + // 获取学生所在班级ID的方法 public Integer getS_classid() { return s_classid; } + // 设置学生所在班级ID的方法 public void setS_classid(Integer s_classid) { this.s_classid = s_classid; } + // 获取学生班级名称的方法 public String getS_classname() { return s_classname; } + // 设置学生班级名称的方法 public void setS_classname(String s_classname) { this.s_classname = s_classname; } + // 获取学生所在宿舍ID的方法 public Integer getS_dormitoryid() { return s_dormitoryid; } + // 设置学生所在宿舍ID的方法 public void setS_dormitoryid(Integer s_dormitoryid) { this.s_dormitoryid = s_dormitoryid; } - } diff --git a/src/com/itheima/po/StudentClean.java b/src/com/itheima/po/StudentClean.java index dbdfbcb..b4485c0 100644 --- a/src/com/itheima/po/StudentClean.java +++ b/src/com/itheima/po/StudentClean.java @@ -1,90 +1,116 @@ package com.itheima.po; +// 导入 JSON 日期格式化工具,用于日期的格式化 import com.fasterxml.jackson.annotation.JsonFormat; +// 导入 Date 类,用于时间数据类型 import java.util.Date; /** * @program: dormitorySystem - * @description: 学生卫生 + * @description: 学生卫生记录类 * @author: Joyrocky * @create: 2019-04-25 12:12 **/ public class StudentClean { + // 卫生记录的唯一标识ID private Integer g_id; + // 学生的学号 private Integer s_studentid; + // 学生的姓名 private String s_name; + // 学生的年级 private Integer s_grade; + // 学生所属班级ID private Integer s_classid; + // 学生宿舍ID private Integer s_dormitoryid; - @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + // 创建时间字段,使用注解格式化为指定日期时间格式("yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date create_time; - @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + + // 更新时间字段,使用注解格式化为指定日期时间格式("yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date update_time; + // 获取卫生记录ID的方法 public Integer getG_id() { return g_id; } + // 设置卫生记录ID的方法 public void setG_id(Integer g_id) { this.g_id = g_id; } + // 获取学生学号的方法 public Integer getS_studentid() { return s_studentid; } + // 设置学生学号的方法 public void setS_studentid(Integer s_studentid) { this.s_studentid = s_studentid; } + // 获取学生姓名的方法 public String getS_name() { return s_name; } + // 设置学生姓名的方法 public void setS_name(String s_name) { this.s_name = s_name; } + // 获取学生年级的方法 public Integer getS_grade() { return s_grade; } + // 设置学生年级的方法 public void setS_grade(Integer s_grade) { this.s_grade = s_grade; } + // 获取学生所属班级ID的方法 public Integer getS_classid() { return s_classid; } + // 设置学生所属班级ID的方法 public void setS_classid(Integer s_classid) { this.s_classid = s_classid; } + // 获取学生宿舍ID的方法 public Integer getS_dormitoryid() { return s_dormitoryid; } - public void setS_dormitoryid(Integer s_dormtoryid) { - this.s_dormitoryid = s_dormtoryid; + // 设置学生宿舍ID的方法 + public void setS_dormitoryid(Integer s_dormitoryid) { + this.s_dormitoryid = s_dormitoryid; } + // 获取记录创建时间的方法 public Date getCreate_time() { return create_time; } + // 设置记录创建时间的方法 public void setCreate_time(Date create_time) { this.create_time = create_time; } + // 获取记录更新时间的方法 public Date getUpdate_time() { return update_time; } + // 设置记录更新时间的方法 public void setUpdate_time(Date update_time) { this.update_time = update_time; } } - diff --git a/src/com/itheima/po/Visitor.java b/src/com/itheima/po/Visitor.java index 8761091..8c8fa29 100644 --- a/src/com/itheima/po/Visitor.java +++ b/src/com/itheima/po/Visitor.java @@ -1,71 +1,94 @@ package com.itheima.po; +// 导入 JSON 日期格式化工具,用于日期的格式化 import com.fasterxml.jackson.annotation.JsonFormat; +// 导入 Date 类,用于时间数据类型 import java.util.Date; /** * @program: dormitorySystem - * @description: 访客 + * @description: 访客类,用于存储访客的信息 * @author: Joyrocky * @create: 2019-05-14 00:37 **/ public class Visitor { + // 访客的唯一标识ID private Integer v_id; + + // 访客的姓名 private String v_name; + + // 访客的电话号码 private Integer v_phone; + + // 访客所访问的宿舍ID private Integer v_dormitoryid; + + // 访客所在的宿舍楼名称 private String v_dormbuilding; - @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + // 访客记录的创建时间,使用注解格式化为指定的日期时间格式 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date create_time; + // 获取访客ID的方法 public Integer getV_id() { return v_id; } + // 设置访客ID的方法 public void setV_id(Integer v_id) { this.v_id = v_id; } + // 获取访客姓名的方法 public String getV_name() { return v_name; } + // 设置访客姓名的方法 public void setV_name(String v_name) { this.v_name = v_name; } + // 获取访客电话号码的方法 public Integer getV_phone() { return v_phone; } + // 设置访客电话号码的方法 public void setV_phone(Integer v_phone) { this.v_phone = v_phone; } + // 获取访客所访问的宿舍ID的方法 public Integer getV_dormitoryid() { return v_dormitoryid; } + // 设置访客所访问的宿舍ID的方法 public void setV_dormitoryid(Integer v_dormitoryid) { this.v_dormitoryid = v_dormitoryid; } + // 获取访客所在宿舍楼名称的方法 public String getV_dormbuilding() { return v_dormbuilding; } + // 设置访客所在宿舍楼名称的方法 public void setV_dormbuilding(String v_dormbuilding) { this.v_dormbuilding = v_dormbuilding; } + // 获取访客记录的创建时间的方法 public Date getCreate_time() { return create_time; } + // 设置访客记录的创建时间的方法 public void setCreate_time(Date create_time) { this.create_time = create_time; } } - diff --git a/web/WEB-INF/jsp/admin_edit.jsp b/web/WEB-INF/jsp/admin_edit.jsp index 96ecd79..c0fa947 100644 --- a/web/WEB-INF/jsp/admin_edit.jsp +++ b/web/WEB-INF/jsp/admin_edit.jsp @@ -5,15 +5,20 @@ Time: 16:35 To change this template use File | Settings | File Templates. --%> + <%@ page contentType="text/html;charset=UTF-8" language="java" %> + <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 修改信息 + + + @@ -21,73 +26,88 @@ +
- <%--把表单封装成一个Admin对象传给服务端--%> -
+ <%-- 将表单数据封装成一个 Admin 对象,提交到后端 --%> + + + +
+
+
+
+
+
+
+
+
+
+
+
- +
-
@@ -95,12 +115,15 @@
- - - + <%-- 设置网页图标 --%> + <%-- 引入字体样式 --%> + <%-- 引入后台管理样式表 --%> + <%-- 引入jQuery --%> + <%-- 引入layui库 --%> + <%-- 引入自定义JS文件 --%> + <%-- 引入excel导出扩展 --%> + <%-- 内联样式定义 --%> -
+
<%-- 导航栏容器 --%> - 首页 - 管理员信息 + 首页 <%-- 首页链接 --%> + 管理员信息 <%-- 管理员信息链接 --%> - + <%-- 刷新图标按钮 --%> +
-
+
<%-- 页面主要内容容器 --%>
- - - - - - - - + <%-- 表单提交管理员查询 --%> + <%-- 隐藏的ID输入框 --%> + <%-- 用户名输入框 --%> + <%-- 级别描述输入框 --%> + + <%-- 当前页码隐藏输入框 --%> + <%-- 每页显示条数隐藏输入框 --%> + <%-- 搜索按钮 --%>
- - - 共有数据:${ai.totalCount} 条 + <%-- 添加按钮 --%> + <%-- 导出按钮 --%> + 共有数据:${ai.totalCount} 条 <%-- 显示总条数 --%> <%--表格数据--%> - +
<%-- 管理员列表表格 --%> - <%----%> - - - <%----%> - - - <%----%> - - + <%-- ID列 --%> + <%-- 用户名列 --%> + <%-- 姓名列 --%> + <%-- 电话列 --%> + <%-- 级别描述列 --%> + <%-- 操作列 --%> + - + <%-- 遍历管理员列表数据 --%> - <%----%> - <%----%> - - - <%----%> - - - <%----%> - + <%-- ID数据 --%> + <%-- 用户名数据 --%> + <%-- 姓名数据 --%> + <%-- 电话数据 --%> + <%-- 级别描述数据 --%> - +
--%> - <%--
--%> - <%--
ID用户名密码姓名电话级别级别描述操作ID用户名姓名电话级别描述操作
--%> - <%--
--%> - <%--
${class.c_id}${ai.a_id}${ai.a_username}${ai.a_password}${ai.a_name}${ai.a_phone}${ai.a_power}${ai.a_describe}${ai.a_id}${ai.a_username}${ai.a_name}${ai.a_phone}${ai.a_describe} - <%--href="/findAdminById?a_id=${ai.a_id}"--%> - - - - - - + <%-- 编辑按钮 --%> + <%-- 删除按钮 --%>
- - <%--添加模态框--%> - - -
- - - - - - -
-
- - - - - - - diff --git a/web/WEB-INF/jsp/class_Studentlist.jsp b/web/WEB-INF/jsp/class_Studentlist.jsp index a1231e2..c70ee96 100644 --- a/web/WEB-INF/jsp/class_Studentlist.jsp +++ b/web/WEB-INF/jsp/class_Studentlist.jsp @@ -5,56 +5,55 @@ Time: 14:06 To change this template use File | Settings | File Templates. --%> -<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Dormitory" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + +<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Dormitory" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - 后台登录 - - - - <%----%> - - - - - - - - + 后台登录 + + + + <%----%> + + + + + + +
-
- - + + + - +
<%--表格数据--%> - +
@@ -67,25 +66,20 @@ - - - + - - - - + + - - - - - - - + + + + + + + -
班级编号
${c.c_classid}${c.c_classname}${c.c_counsellor}${sc.s_studentid}${sc.s_name}${sc.s_phone}${sc.s_dormitoryid}${c.c_classid} ${c.c_classname} ${c.c_counsellor} ${sc.s_studentid} ${sc.s_name} ${sc.s_phone} ${sc.s_dormitoryid}
@@ -93,8 +87,7 @@
- - diff --git a/web/WEB-INF/jsp/class_edit.jsp b/web/WEB-INF/jsp/class_edit.jsp index c3681e0..35fc1dd 100644 --- a/web/WEB-INF/jsp/class_edit.jsp +++ b/web/WEB-INF/jsp/class_edit.jsp @@ -5,66 +5,72 @@ Time: 16:35 To change this template use File | Settings | File Templates. --%> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + - 修改信息 - - - - - - - + 修改信息 + + + + + + + -
-
- +
+ + + +
- +
+
- +
+
- +
- +
-
+ diff --git a/web/WEB-INF/jsp/class_list.jsp b/web/WEB-INF/jsp/class_list.jsp index d0c4026..cb4c6ba 100644 --- a/web/WEB-INF/jsp/class_list.jsp +++ b/web/WEB-INF/jsp/class_list.jsp @@ -4,123 +4,122 @@ Date: 2018/10/31 Time: 14:06 To change this template use File | Settings | File Templates. ---%> -<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Class" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Class" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - 后台登录 - - - - <%----%> - - - - - - - - + 后台登录 + + + + <%----%> + + + + + + + + -
+ -
-
-
- - - - - - +
+
+ + + + + + + +
- - - - 共有数据:${ci.totalCount} 条 + + + + 共有数据:${ci.totalCount} 条 - <%--添加模态框--%> - +
+ + +
-
@@ -64,7 +76,7 @@
- diff --git a/web/WEB-INF/jsp/dormclean_list.jsp b/web/WEB-INF/jsp/dormclean_list.jsp index ffd1a5a..b51bbbe 100644 --- a/web/WEB-INF/jsp/dormclean_list.jsp +++ b/web/WEB-INF/jsp/dormclean_list.jsp @@ -5,61 +5,63 @@ Time: 23:00 To change this template use File | Settings | File Templates. --%> -<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.DormClean" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + +<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.DormClean" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> - 后台登录 - - - - <%----%> - - - - - - - - - + 后台登录 + + + + <%----%> + + + + + + + + + -
+ +
- - - + + + - - - + + +
+ - - - 共有数据:${di.totalCount} 条 + + + 共有数据:${di.totalCount} 条 <%--添加模态框--%> @@ -69,35 +71,34 @@
- +
- +
- +
- - + +
- <%--表格数据--%> @@ -105,28 +106,25 @@ <%----%> - - - - - - - + + + + + + + - <%----%> - - - - - - + + + + + +
--%> <%--
--%> <%--
ID宿舍编号宿舍楼宿舍卫生创建日期更新日期操作ID 宿舍编号 宿舍楼 宿舍卫生 创建日期 更新日期 操作
--%> - <%--
--%> - <%--
${di.g_id}${di.d_id}${di.d_dormbuilding}${di.d_grade}${di.g_id} ${di.d_id} ${di.d_dormbuilding} ${di.d_grade} - + @@ -138,16 +136,17 @@
-
- +
+
- - - - - - - - + $("#addEmployee diff --git a/web/WEB-INF/jsp/dormitory_Studentlist.jsp b/web/WEB-INF/jsp/dormitory_Studentlist.jsp index b0b041d..2d71d21 100644 --- a/web/WEB-INF/jsp/dormitory_Studentlist.jsp +++ b/web/WEB-INF/jsp/dormitory_Studentlist.jsp @@ -1,94 +1,89 @@ -<%-- +<%-- Created by IntelliJ IDEA. User: hkw Date: 2018/10/31 Time: 14:06 To change this template use File | Settings | File Templates. --%> -<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Dormitory" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - 后台登录 - - - - <%----%> - - - - - - - - - +<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.itheima.po.Dormitory" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + 后台登录 + + + + <%----%> + + + + + + + + + -
- - 首页 - 人员信息 - + -
-
-
- - +
+
+ + +
- <%--添加模态框--%> -