From b0d403429e7c791f168db896609c7b8d15afd99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=89=AC?= <2016910632@qq.com> Date: Tue, 17 Dec 2024 22:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/itheima/dao/AdminDao.java | 17 ++++- src/com/itheima/dao/AdminDao.xml | 57 +++++++++++----- src/com/itheima/dao/ClassDao.java | 19 +++++- src/com/itheima/dao/ClassDao.xml | 55 +++++++++------ src/com/itheima/dao/DormCleanDao.java | 17 ++++- src/com/itheima/dao/DormCleanDao.xml | 51 +++++++++----- src/com/itheima/dao/DormRepairDao.java | 19 +++++- src/com/itheima/dao/DormRepairDao.xml | 47 ++++++++----- src/com/itheima/dao/DormitoryDao.java | 20 +++++- src/com/itheima/dao/DormitoryDao.xml | 54 +++++++++------ src/com/itheima/dao/StudentCleanDao.java | 20 +++++- src/com/itheima/dao/StudentCleanDao.xml | 55 +++++++++------ src/com/itheima/dao/StudentDao.java | 17 ++++- src/com/itheima/dao/StudentDao.xml | 85 +++++++++++++++--------- src/com/itheima/dao/VisitorDao.java | 9 ++- src/com/itheima/dao/VisitorDao.xml | 30 ++++++--- 16 files changed, 404 insertions(+), 168 deletions(-) diff --git a/src/com/itheima/dao/AdminDao.java b/src/com/itheima/dao/AdminDao.java index b319d48..5546fb1 100644 --- a/src/com/itheima/dao/AdminDao.java +++ b/src/com/itheima/dao/AdminDao.java @@ -23,9 +23,22 @@ public interface AdminDao { //获取用户列表 public List getAdminList(@Param("a_username") String a_username, @Param("a_describe") String a_describe,@Param("a_id") Integer a_id, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); +<<<<<<< HEAD + public int addAdmin(Admin admin); + //添加管理员信息 + public int deleteAdmin(Integer a_id); + //删除管理员信息 + public int updateAdmin(Admin admin); + //修改管理员信息 + public Admin findAdminById(Integer a_id); + // 根据ID查询管理员信息 + public List getAll(); + // 获取所有管理员信息 +======= public int addAdmin(Admin admin); //添加管理员信息 public int deleteAdmin(Integer a_id); //删除管理员信息 public int updateAdmin(Admin admin); //修改管理员信息 - public Admin findAdminById(Integer a_id); - public List getAll(); + public Admin findAdminById(Integer a_id);// 根据ID查询管理员信息 + public List getAll();// 获取所有管理员信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/AdminDao.xml b/src/com/itheima/dao/AdminDao.xml index 1768369..7189526 100644 --- a/src/com/itheima/dao/AdminDao.xml +++ b/src/com/itheima/dao/AdminDao.xml @@ -3,93 +3,114 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + + - + - - select count(a_id) from d_admin + - and a_username like '%${a_username}%' + and a_username like '%${a_username}%' + - and a_describe like '%${a_describe}%' + and a_describe like '%${a_describe}%' + - and a_id like '%${a_id}%' + 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/src/com/itheima/dao/ClassDao.java b/src/com/itheima/dao/ClassDao.java index dc7d886..36aa26d 100644 --- a/src/com/itheima/dao/ClassDao.java +++ b/src/com/itheima/dao/ClassDao.java @@ -18,10 +18,25 @@ public interface ClassDao { //获取用户列表 public List getClassList(@Param("c_classname") String c_classname, @Param("c_classid") Integer c_classid, @Param("c_counsellor") String c_counsellor, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); +<<<<<<< HEAD + public int deleteClass(Integer c_id); + //删除班级信息 + public int addClass(Class ucalss); + //添加班级信息 + public int updateClass(Class uclass); + //修改班级信息 + public Class findClassById(Integer c_id); + // 根据ID查询班级信息 + public List findClassStudent(Class uclass); + //查询班级人员信息 + public List getAll(); + // 获取所有班级信息 +======= public int deleteClass(Integer c_id); //删除班级信息 public int addClass(Class ucalss); //添加班级信息 public int updateClass(Class uclass); //修改班级信息 - public Class findClassById(Integer c_id); + public Class findClassById(Integer c_id);// 根据ID查询班级信息 public List findClassStudent(Class uclass);//查询班级人员信息 - public List getAll(); + public List getAll();// 获取所有班级信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/ClassDao.xml b/src/com/itheima/dao/ClassDao.xml index e77c088..19cbcfb 100644 --- a/src/com/itheima/dao/ClassDao.xml +++ b/src/com/itheima/dao/ClassDao.xml @@ -3,62 +3,78 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + + - - select count(c_id) from d_class + - and c_classname like '%${c_classname}%' + and c_classname like '%${c_classname}%' + - and c_counsellor like '%${c_counsellor}%' + and c_counsellor like '%${c_counsellor}%' + - and c_classid like '%${c_classid}%' + 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}) + 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}, @@ -66,6 +82,7 @@ where c_id = #{c_id} + diff --git a/src/com/itheima/dao/DormCleanDao.java b/src/com/itheima/dao/DormCleanDao.java index 11e9098..b0c8267 100644 --- a/src/com/itheima/dao/DormCleanDao.java +++ b/src/com/itheima/dao/DormCleanDao.java @@ -20,10 +20,23 @@ public interface DormCleanDao { //获取用户列表 public List getDormCleanList(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); +<<<<<<< HEAD + public int addDormClean(DormClean dormclean); + //添加宿舍卫生信息 + public int deleteDormClean(Integer g_id); + //删除宿舍卫生信息 + public int updateDormClean(DormClean dormclean); + //修改宿舍卫生信息 + public DormClean findDormCleanById(Integer g_id); + // 根据ID查询宿舍卫生信息 + public List getAll(); + // 获取所有宿舍卫生信息 +======= public int addDormClean(DormClean dormclean); //添加宿舍卫生信息 public int deleteDormClean(Integer g_id); //删除宿舍卫生信息 public int updateDormClean(DormClean dormclean); //修改宿舍卫生信息 - public DormClean findDormCleanById(Integer g_id); - public List getAll(); + public DormClean findDormCleanById(Integer g_id); // 根据ID查询宿舍卫生信息 + public List getAll();// 获取所有宿舍卫生信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/DormCleanDao.xml b/src/com/itheima/dao/DormCleanDao.xml index 46dfbee..517e72b 100644 --- a/src/com/itheima/dao/DormCleanDao.xml +++ b/src/com/itheima/dao/DormCleanDao.xml @@ -3,78 +3,93 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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/src/com/itheima/dao/DormRepairDao.java b/src/com/itheima/dao/DormRepairDao.java index 6d710eb..ac7e36b 100644 --- a/src/com/itheima/dao/DormRepairDao.java +++ b/src/com/itheima/dao/DormRepairDao.java @@ -22,10 +22,23 @@ public interface DormRepairDao { //获取用户列表 public List getDormRepairList(@Param("d_id") Integer d_id, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); - public int addDormRepair(DormRepair dormrepair); //添加宿舍信息 - public int deleteDormRepair(Integer r_id); //删除宿舍信息 - public int updateDormRepair(DormRepair dormrepair); //修改宿舍信息 +<<<<<<< HEAD + public int addDormRepair(DormRepair dormrepair); + //添加宿舍维修信息 + public int deleteDormRepair(Integer r_id); + //删除宿舍维修信息 + public int updateDormRepair(DormRepair dormrepair); + //修改宿舍维修信息 public DormRepair findDormRepairById(Integer r_id); + // 根据ID查询宿舍维修信息 public List getAll(); + // 获取所有宿舍维修信息 +======= + public int addDormRepair(DormRepair dormrepair); //添加宿舍维修信息 + public int deleteDormRepair(Integer r_id); //删除宿舍维修信息 + public int updateDormRepair(DormRepair dormrepair); //修改宿舍维修信息 + public DormRepair findDormRepairById(Integer r_id);// 根据ID查询宿舍维修信息 + public List getAll();// 获取所有宿舍维修信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/DormRepairDao.xml b/src/com/itheima/dao/DormRepairDao.xml index d2faf71..75b1037 100644 --- a/src/com/itheima/dao/DormRepairDao.xml +++ b/src/com/itheima/dao/DormRepairDao.xml @@ -3,68 +3,82 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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(), @@ -72,6 +86,7 @@ where r_id = #{r_id} + diff --git a/src/com/itheima/dao/DormitoryDao.java b/src/com/itheima/dao/DormitoryDao.java index af6f2f1..bb0e712 100644 --- a/src/com/itheima/dao/DormitoryDao.java +++ b/src/com/itheima/dao/DormitoryDao.java @@ -18,12 +18,28 @@ public interface DormitoryDao { //获取用户列表 public List getDormitoryList(@Param("a_name") String a_name, @Param("s_dormitoryid") Integer s_dormitoryid, @Param("d_dormbuilding") String d_dormbuilding, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); +<<<<<<< HEAD + public int addDormitory(Dormitory dormitory); + //添加宿舍信息 + public int deleteDormitory(Integer d_id); + //删除宿舍信息 + public int updateDormitory(Dormitory dormitory); + //修改宿舍信息 + public Dormitory findDormitoryById(Integer d_id); + // 根据ID查询宿舍信息 + + public List findDormitoryStudent(Dormitory dormitory); + //查询宿舍人员信息 + public List getAll(); + // 获取所有宿舍信息 +======= public int addDormitory(Dormitory dormitory); //添加宿舍信息 public int deleteDormitory(Integer d_id); //删除宿舍信息 public int updateDormitory(Dormitory dormitory); //修改宿舍信息 - public Dormitory findDormitoryById(Integer d_id); + public Dormitory findDormitoryById(Integer d_id); // 根据ID查询宿舍信息 public List findDormitoryStudent(Dormitory dormitory);//查询宿舍人员信息 - public List getAll(); + public List getAll();// 获取所有宿舍信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/DormitoryDao.xml b/src/com/itheima/dao/DormitoryDao.xml index db80f34..ce6691f 100644 --- a/src/com/itheima/dao/DormitoryDao.xml +++ b/src/com/itheima/dao/DormitoryDao.xml @@ -3,70 +3,85 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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}, @@ -74,6 +89,7 @@ where d_id = #{d_id} + diff --git a/src/com/itheima/dao/StudentCleanDao.java b/src/com/itheima/dao/StudentCleanDao.java index 6599148..0293e40 100644 --- a/src/com/itheima/dao/StudentCleanDao.java +++ b/src/com/itheima/dao/StudentCleanDao.java @@ -20,10 +20,24 @@ public interface StudentCleanDao { //获取用户列表 public List getStudentCleanList(@Param("s_studentid") Integer s_studentid, @Param("s_name") String s_name, @Param("s_dormitoryid") Integer s_dormitoryid, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize); - public int addStudentClean(StudentClean studentclean); //添加宿舍卫生信息 - public int deleteStudentClean(Integer g_id); //删除宿舍卫生信息 - public int updateStudentClean(StudentClean studentclean); //修改宿舍卫生信息 +<<<<<<< HEAD + public int addStudentClean(StudentClean studentclean); + //添加学生卫生信息 + public int deleteStudentClean(Integer g_id); + //删除学生卫生信息 + public int updateStudentClean(StudentClean studentclean); + //修改学生卫生信息 public StudentClean findStudentCleanById(Integer g_id); + // 根据ID查询学生卫生信息 public List getAll(); + // 获取所有学生卫生信息 +======= + public int addStudentClean(StudentClean studentclean); //添加学生卫生信息 + public int deleteStudentClean(Integer g_id); //删除学生卫生信息 + public int updateStudentClean(StudentClean studentclean); //修改学生卫生信息 + public StudentClean findStudentCleanById(Integer g_id);// 根据ID查询学生卫生信息 + + public List getAll();// 获取所有学生卫生信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/StudentCleanDao.xml b/src/com/itheima/dao/StudentCleanDao.xml index 61b0dfe..5e55bec 100644 --- a/src/com/itheima/dao/StudentCleanDao.xml +++ b/src/com/itheima/dao/StudentCleanDao.xml @@ -3,85 +3,102 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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/src/com/itheima/dao/StudentDao.java b/src/com/itheima/dao/StudentDao.java index 634277c..8152a7c 100644 --- a/src/com/itheima/dao/StudentDao.java +++ b/src/com/itheima/dao/StudentDao.java @@ -20,9 +20,22 @@ public interface StudentDao { public List getStudentList(@Param("s_name") String s_name, @Param("s_studentid")Integer s_studentid,@Param("s_classid")Integer s_classid, @Param("s_classname")String s_classname, @Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize); +<<<<<<< HEAD + public int deleteStudent(Integer s_id); + //删除学生信息 + public int addStudent(Student student); + //添加学生信息 + public int updateStudent(Student student); + //修改学生信息 + public Student findStudentById(Integer s_id); + // 根据ID查询学生信息 + public List getAll(); + // 获取所有学生信息 +======= public int deleteStudent(Integer s_id); //删除学生信息 public int addStudent(Student student); //添加学生信息 public int updateStudent(Student student); //修改学生信息 - public Student findStudentById(Integer s_id); - public List getAll(); + public Student findStudentById(Integer s_id);// 根据ID查询学生信息 + public List getAll();// 获取所有学生信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/StudentDao.xml b/src/com/itheima/dao/StudentDao.xml index 10997e3..92e5e70 100644 --- a/src/com/itheima/dao/StudentDao.xml +++ b/src/com/itheima/dao/StudentDao.xml @@ -3,83 +3,105 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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}, @@ -87,6 +109,7 @@ where s_id = #{s_id} + diff --git a/src/com/itheima/dao/VisitorDao.java b/src/com/itheima/dao/VisitorDao.java index b54a851..e7a25ef 100644 --- a/src/com/itheima/dao/VisitorDao.java +++ b/src/com/itheima/dao/VisitorDao.java @@ -21,7 +21,14 @@ public interface VisitorDao { //获取用户列表 public List getVisitorList(@Param("v_name") String v_name, @Param("v_phone")Integer v_phone,@Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize); - public int addVisitor(Visitor visitor); //添加学生信息 +<<<<<<< HEAD + public int addVisitor(Visitor visitor); + //添加访客信息 public List getAll(); + //获取所有访客信息 +======= + public int addVisitor(Visitor visitor); //添加访客信息 + public List getAll();//获取所有访客信息 +>>>>>>> 5a268e17dc083cddf695d0a8f5feff0d7e289ef4 } diff --git a/src/com/itheima/dao/VisitorDao.xml b/src/com/itheima/dao/VisitorDao.xml index 493d10d..848b445 100644 --- a/src/com/itheima/dao/VisitorDao.xml +++ b/src/com/itheima/dao/VisitorDao.xml @@ -3,42 +3,50 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > - + - - 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()) + +