Compare commits

...

4 Commits

@ -1,54 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">
<!-- 读取db.properties -->
<!-- 声明 XML 文档的版本和编码格式 -->
<beans xmlns="http://www.springframework.org/schema/beans" <!-- Spring Beans -->
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <!-- 定义 XML Schema 实例命名空间 -->
xmlns:aop="http://www.springframework.org/schema/aop" <!-- 定义 AOP 命名空间 -->
xmlns:tx="http://www.springframework.org/schema/tx" <!-- 定义事务管理命名空间 -->
xmlns:context="http://www.springframework.org/schema/context" <!-- 定义 Spring 上下文命名空间 -->
xsi:schemaLocation="http://www.springframework.org/schema/beans <!-- 定义 XML Schema 文件位置 -->
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd <!-- Beans schema 的位置 -->
http://www.springframework.org/schema/tx <!-- 事务管理 schema 的位置 -->
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd <!-- 事务管理 schema 文件 -->
http://www.springframework.org/schema/context <!-- 上下文配置 schema 的位置 -->
http://www.springframework.org/schema/context/spring-context-4.3.xsd <!-- 上下文配置 schema 文件 -->
http://www.springframework.org/schema/aop <!-- AOP schema 的位置 -->
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd"> <!-- AOP schema 文件 -->
<!-- 读取 db.properties 配置文件中的数据库相关信息 -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.apache.commons.dbcp2.BasicDataSource">
<!--数据库驱动 -->
<property name="driverClassName" value="${jdbc.driver}" />
<!--连接数据库的url -->
<property name="url" value="${jdbc.url}" />
<!--连接数据库的用户名 -->
<property name="username" value="${jdbc.username}" />
<!--连接数据库的密码 -->
<property name="password" value="${jdbc.password}" />
<!--最大连接数 -->
<property name="maxTotal" value="${jdbc.maxTotal}" />
<!--最大空闲连接 -->
<property name="maxIdle" value="${jdbc.maxIdle}" />
<!--初始化连接数 -->
<property name="initialSize" value="${jdbc.initialSize}" />
</bean>
<!-- 事务管理器,依赖于数据源 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 开启事务注解 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
<!-- 配置MyBatis工厂SqlSessionFactory -->
<!-- 配置数据源,使用 Apache DBCP2 数据源 -->
<bean id="dataSource"
class="org.apache.commons.dbcp2.BasicDataSource">
<!-- 配置数据库连接驱动 -->
<property name="driverClassName" value="${jdbc.driver}" />
<!-- 配置数据库连接的 URL -->
<property name="url" value="${jdbc.url}" />
<!-- 配置数据库连接的用户名 -->
<property name="username" value="${jdbc.username}" />
<!-- 配置数据库连接的密码 -->
<property name="password" value="${jdbc.password}" />
<!-- 配置最大连接数 -->
<property name="maxTotal" value="${jdbc.maxTotal}" />
<!-- 配置最大空闲连接数 -->
<property name="maxIdle" value="${jdbc.maxIdle}" />
<!-- 配置初始化连接数 -->
<property name="initialSize" value="${jdbc.initialSize}" />
</bean>
<!-- 配置事务管理器,依赖于上面定义的数据源 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 注入数据源到事务管理器 -->
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 开启事务注解支持,指定事务管理器 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
<!-- 配置 MyBatis 的 SqlSessionFactory负责创建数据库会话 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--注入数据源 -->
<!-- 注入数据源到 SqlSessionFactory -->
<property name="dataSource" ref="dataSource" />
<!--指定核MyBatis心配置文件位置 -->
<property name="configLocation" value="classpath:mybatis-config.xml" />
<!-- 配置 MyBatis 核心配置文件的位置 -->
<property name="configLocation" value="classpath:mybatis-config.xml" />
</bean>
<!-- 配置 MyBatis 的 Mapper 扫描器,用于自动扫描 DAO 接口 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 配置要扫描的包,扫描所有 Mapper 接口 -->
<property name="basePackage" value="com.itheima.dao"/>
</bean>
<!-- 配置mapper扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.itheima.dao"/>
</bean>
<!-- 扫描Service -->
<!-- 扫描并加载 Service 层的 Bean -->
<context:component-scan base-package="com.itheima.service" />
</beans>

@ -1,7 +1,6 @@
package com.itheima.controller;
import com.itheima.po.DormRepair;
import com.itheima.po.Dormitory;
import com.itheima.po.PageInfo;
import com.itheima.service.DormRepairService;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,9 +20,10 @@ import java.util.List;
* @author: Joyrocky
* @create: 2019-04-27 17:13
**/
@Controller
@Controller // 标记这是一个控制器类
public class DormRepairController {
// 依赖注入
// 依赖注入注入DormRepairService服务类用于业务层操作
@Autowired
private DormRepairService dormRepairService;
@ -32,64 +32,67 @@ public class DormRepairController {
* pageIndex
* pageSize
*/
@RequestMapping(value = "/findDormRepair")
public String findDormRepair(Integer d_id,String d_dormbuilding,
Integer pageIndex, Integer pageSize, Model model) {
PageInfo<DormRepair> di = dormRepairService.findPageInfo(d_id,d_dormbuilding,
pageIndex,pageSize);
model.addAttribute("di",di);
return "dormrepair_list";
@RequestMapping(value = "/findDormRepair") // 通过请求映射到该方法,处理查询请求
public String findDormRepair(Integer d_id, String d_dormbuilding, Integer pageIndex, Integer pageSize, Model model) {
// 调用service层的方法获取分页信息
PageInfo<DormRepair> di = dormRepairService.findPageInfo(d_id, d_dormbuilding, pageIndex, pageSize);
// 将查询结果添加到模型中,用于页面展示
model.addAttribute("di", di);
return "dormrepair_list"; // 返回视图名称
}
/**
* Excel
*/
@RequestMapping(value = "/exportdormrepairlist", method = RequestMethod.POST)
@ResponseBody
public List<DormRepair> exportDormrepair(){
@RequestMapping(value = "/exportdormrepairlist", method = RequestMethod.POST) // 映射POST请求处理导出操作
@ResponseBody // 返回响应体数据将以JSON格式返回
public List<DormRepair> exportDormrepair() {
// 调用service层获取所有的维修记录
List<DormRepair> dormRepairList = dormRepairService.getAll();
return dormRepairList;
return dormRepairList; // 返回维修记录列表
}
/**
* 宿
* 宿
*/
@RequestMapping(value = "/addDormRepair" ,method = RequestMethod.POST)
@ResponseBody
public String addDormitory( @RequestBody DormRepair dormrepair) {
@RequestMapping(value = "/addDormRepair", method = RequestMethod.POST) // 映射POST请求处理添加维修记录的操作
@ResponseBody // 返回响应体
public String addDormitory(@RequestBody DormRepair dormrepair) { // 使用@RequestBody注解接收请求体中的JSON数据并转换为对象
// 调用service层的添加方法返回结果可能是影响的行数
int d = dormRepairService.addDormRepair(dormrepair);
return "dormrepair_list";
return "dormrepair_list"; // 返回视图名称,表示添加成功后返回到维修记录列表页面
}
/**
* 宿
* 宿
*/
@RequestMapping( "/deleteDormRepair")
@ResponseBody
public String deleteDormRepair(Integer r_id) {
@RequestMapping("/deleteDormRepair") // 映射删除请求
@ResponseBody // 返回响应体
public String deleteDormRepair(Integer r_id) { // 接收要删除的维修记录的ID
// 调用service层的删除方法
int d = dormRepairService.deleteDormRepair(r_id);
return "dormrepair_list";
return "dormrepair_list"; // 删除成功后返回到维修记录列表页面
}
/**
*
* 宿
*/
@RequestMapping( "/updateDormRepair")
public String updateDormRepair( DormRepair dormrepair) {
@RequestMapping("/updateDormRepair") // 映射更新请求
public String updateDormRepair(DormRepair dormrepair) { // 接收要更新的维修记录对象
// 调用service层的更新方法
int d = dormRepairService.updateDormRepair(dormrepair);
return "redirect:/findDormRepair";
return "redirect:/findDormRepair"; // 更新成功后重定向到维修记录查询页面
}
@RequestMapping( "/findDormRepairById")
public String findDormRepairById(Integer r_id, HttpSession session) {
DormRepair d= dormRepairService.findDormRepairById(r_id);
session.setAttribute("d",d);
return "dormrepair_edit";
/**
* ID
*/
@RequestMapping("/findDormRepairById") // 映射查找请求
public String findDormRepairById(Integer r_id, HttpSession session) { // 接收维修记录的ID
// 调用service层的查询方法获取维修记录
DormRepair d = dormRepairService.findDormRepairById(r_id);
// 将查询到的维修记录存入session方便在编辑页面使用
session.setAttribute("d", d);
return "dormrepair_edit"; // 跳转到编辑页面,允许用户修改维修记录
}
}

@ -20,9 +20,10 @@ import java.util.List;
* @author: Joyrocky
* @create: 2019-04-25 12:13
**/
@Controller
@Controller // 标记该类为Spring MVC的控制器类
public class StudentCleanController {
//依赖注入
// 依赖注入StudentCleanService服务类用于业务逻辑处理
@Autowired
private StudentCleanService studentCleanService;
@ -31,60 +32,81 @@ public class StudentCleanController {
* pageIndex
* pageSize
*/
@RequestMapping(value = "/findStudentClean")
@RequestMapping(value = "/findStudentClean") // 映射到"/findStudentClean"路径处理GET请求
public String findDormClean(Integer s_studentid, String s_name, Integer s_dormitoryid, Integer pageIndex, Integer pageSize, Model model) {
PageInfo<StudentClean> di = studentCleanService.findPageInfo(s_studentid,s_name,s_dormitoryid,pageIndex,pageSize);
model.addAttribute("di",di);
// 调用service层的方法获取分页信息包括学生ID、姓名、宿舍ID等查询条件
PageInfo<StudentClean> di = studentCleanService.findPageInfo(s_studentid, s_name, s_dormitoryid, pageIndex, pageSize);
// 将查询结果添加到模型中,供视图层展示
model.addAttribute("di", di);
// 返回视图名称,指向"studentclean_list"页面展示列表数据
return "studentclean_list";
}
/**
* Excel
*/
@RequestMapping(value = "/exportstudentcleanlist", method = RequestMethod.POST)
@ResponseBody
public List<StudentClean> exportStudentclean(){
@RequestMapping(value = "/exportstudentcleanlist", method = RequestMethod.POST) // 映射到"/exportstudentcleanlist"路径处理POST请求
@ResponseBody // 返回响应体响应数据会自动转换为JSON格式
public List<StudentClean> exportStudentclean() {
// 调用service层获取所有学生卫生信息列表
List<StudentClean> studentCleanList = studentCleanService.getAll();
// 返回所有学生卫生信息数据
return studentCleanList;
}
/**
* 宿
*/
@RequestMapping(value = "/addStudentClean" ,method = RequestMethod.POST)
@ResponseBody
public String addDormClean( @RequestBody StudentClean studentclean) {
@RequestMapping(value = "/addStudentClean", method = RequestMethod.POST) // 映射到"/addStudentClean"路径处理POST请求
@ResponseBody // 返回响应体
public String addDormClean(@RequestBody StudentClean studentclean) { // 使用@RequestBody注解将请求体中的JSON数据绑定为StudentClean对象
// 调用service层的添加方法将新的卫生记录添加到数据库
int d = studentCleanService.addStudentClean(studentclean);
// 返回结果页面名称,表示添加成功后跳转到"studentclean_list"页面
return "studentclean_list";
}
/**
* 宿
*/
@RequestMapping( "/deleteStudentClean")
@ResponseBody
public String deleteDormClean(Integer g_id) {
@RequestMapping("/deleteStudentClean") // 映射到"/deleteStudentClean"路径,处理请求
@ResponseBody // 返回响应体
public String deleteDormClean(Integer g_id) { // 接收要删除的卫生记录IDg_id
// 调用service层的删除方法根据ID删除对应的学生卫生记录
int d = studentCleanService.deleteStudentClean(g_id);
// 返回结果页面名称,表示删除成功后跳转到"studentclean_list"页面
return "studentclean_list";
}
/**
* 宿
*/
@RequestMapping( "/updateStudentClean")
public String updateDormClean( StudentClean studentclean) {
@RequestMapping("/updateStudentClean") // 映射到"/updateStudentClean"路径,处理请求
public String updateDormClean(StudentClean studentclean) { // 接收修改后的卫生记录对象
// 调用service层的更新方法更新学生卫生信息
int d = studentCleanService.updateStudentClean(studentclean);
// 更新成功后重定向到"findStudentClean"页面,显示最新的卫生信息列表
return "redirect:/findStudentClean";
}
@RequestMapping( "/findStudentCleanById")
public String findDormCleanById(Integer g_id, HttpSession session) {
StudentClean d= studentCleanService.findStudentCleanById(g_id);
session.setAttribute("d",d);
/**
* ID宿
*/
@RequestMapping("/findStudentCleanById") // 映射到"/findStudentCleanById"路径,处理请求
public String findDormCleanById(Integer g_id, HttpSession session) { // 接收要查询的卫生记录IDg_id
// 调用service层的查询方法根据ID获取单个学生卫生记录
StudentClean d = studentCleanService.findStudentCleanById(g_id);
// 将查询到的学生卫生记录存入session方便在后续页面使用
session.setAttribute("d", d);
// 返回到"studentclean_edit"页面,允许用户编辑该卫生记录
return "studentclean_edit";
}
}

@ -1,25 +1,65 @@
package com.itheima.service;
import com.itheima.po.Admin;
import com.itheima.po.PageInfo;
package com.itheima.service; // 定义该接口所属的包为 com.itheima.service
import com.itheima.po.Admin; // 导入 Admin 类,表示管理员对象
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于分页信息封装
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 Admin 对象
/**
* Service
*
*/
public interface AdminService {
// 通过账号和密码查询用户
public Admin findAdmin(Admin admin);
//找到所有所有数据
public List<Admin> getAll();
/**
*
* @param admin Admin
* @return Admin null
*/
public Admin findAdmin(Admin admin);
//分页查询
public PageInfo<Admin> findPageInfo(String a_username, String a_describe,Integer a_id, Integer pageIndex, Integer pageSize);
/**
*
* @return
*/
public List<Admin> getAll();
public int addAdmin(Admin admin); //添加管理员信息
public int deleteAdmin(Integer a_id); //删除管理员信息
public int updateAdmin(Admin admin); //修改管理员信息
public Admin findAdminById(Integer a_id);
/**
*
* @param a_username
* @param a_describe
* @param a_id ID
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
public PageInfo<Admin> findPageInfo(String a_username, String a_describe, Integer a_id, Integer pageIndex, Integer pageSize);
/**
*
* @param admin Admin
* @return 1 0
*/
public int addAdmin(Admin admin);
/**
*
* @param a_id ID
* @return 1 0
*/
public int deleteAdmin(Integer a_id);
/**
*
* @param admin Admin
* @return 1 0
*/
public int updateAdmin(Admin admin);
/**
* ID
* @param a_id ID
* @return Admin null
*/
public Admin findAdminById(Integer a_id);
}

@ -1,21 +1,65 @@
package com.itheima.service;
import com.itheima.po.Class;
import com.itheima.po.PageInfo;
package com.itheima.service; // 定义该接口所属的包为 com.itheima.service
import java.util.List;
import com.itheima.po.Class; // 导入 Class 类,表示班级对象
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于封装分页信息
import java.util.List; // 导入 List 类,用于存储多个 Class 对象
/**
* Service
* Service
*
*/
public interface ClassService {
//分页查询
public PageInfo<Class> findPageInfo(String c_classname, String c_counsellor, Integer c_classid, Integer pageIndex, Integer pageSize);
/**
*
* @param c_classname
* @param c_counsellor
* @param c_classid ID
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
public PageInfo<Class> findPageInfo(String c_classname, String c_counsellor, Integer c_classid, Integer pageIndex, Integer pageSize);
/**
*
* @param c_id ID
* @return 10
*/
public int deleteClass(Integer c_id);
/**
*
* @param uclass
* @return 1 0
*/
public int addClass(Class uclass);
/**
* ID
* @param c_id ID
* @return null
*/
public Class findClassById(Integer c_id);
/**
*
* @param uclass
* @return 1 0
*/
public int updateClass(Class uclass);
/**
*
* @param uclass ID
* @return
*/
public List<Class> findClassStudent(Class uclass);
public int deleteClass(Integer c_id); //删除班级信息
public int addClass(Class ucalss); //添加班级信息
public Class findClassById(Integer c_id);
public int updateClass(Class uclass); //修改班级信息
public List<Class> findClassStudent(Class uclass);//查询班级人员信息
public List<Class> getAll();
/**
*
* @return
*/
public List<Class> getAll();
}

@ -1,23 +1,59 @@
package com.itheima.service;
package com.itheima.service; // 定义该接口所属的包路径为 com.itheima.service
import com.itheima.po.DormClean;
import com.itheima.po.PageInfo;
import com.itheima.po.DormClean; // 导入 DormClean 类,表示宿舍卫生的实体类
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于封装分页信息
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 DormClean 对象
/**
* @program: dormitorySystem
* @description: 宿
* @author: Joyrocky
* @create: 2019-04-24 15:18
* @program: dormitorySystem // 程序名称:宿舍管理系统
* @description: 宿 // 本接口定义了宿舍卫生相关的服务方法
* @author: Joyrocky // 作者Joyrocky
* @create: 2019-04-24 15:18 // 创建时间2019年4月24日15:18
**/
public interface DormCleanService {
//分页查询
/**
* 宿
* @param d_id 宿ID
* @param d_dormbuilding 宿
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
public PageInfo<DormClean> findPageInfo(Integer d_id, String d_dormbuilding, Integer pageIndex, Integer pageSize);
public int addDormClean(DormClean dormclean); //添加宿舍信息
public int deleteDormClean(Integer g_id); //删除宿舍信息
public int updateDormClean(DormClean dormclean); //修改宿舍信息
public DormClean findDormCleanById(Integer g_id);
public List<DormClean> getAll();
/**
* 宿
* @param dormclean 宿
* @return 1 0
*/
public int addDormClean(DormClean dormclean); // 添加宿舍卫生信息
/**
* 宿
* @param g_id 宿ID
* @return 1 0
*/
public int deleteDormClean(Integer g_id); // 删除宿舍卫生信息
/**
* 宿
* @param dormclean 宿
* @return 1 0
*/
public int updateDormClean(DormClean dormclean); // 修改宿舍卫生信息
/**
* 宿ID
* @param g_id 宿ID
* @return DormClean 宿
*/
public DormClean findDormCleanById(Integer g_id); // 根据ID查询单条宿舍卫生信息
/**
* 宿
* @return List<DormClean>宿
*/
public List<DormClean> getAll(); // 获取所有宿舍卫生记录
}

@ -1,24 +1,59 @@
package com.itheima.service;
package com.itheima.service; // 定义接口所属的包路径com.itheima.service
import com.itheima.po.DormRepair;
import com.itheima.po.PageInfo;
import com.itheima.po.DormRepair; // 导入 DormRepair 类,表示宿舍维修登记实体类
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于分页信息封装
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 DormRepair 对象
/**
* @program: dormitorySystem
* @description:
* @author: Joyrocky
* @create: 2019-04-28 00:25
* @program: dormitorySystem // 程序名称dormitorySystem
* @description: // 该接口用于处理宿舍维修登记相关业务
* @author: Joyrocky // 作者信息Joyrocky
* @create: 2019-04-28 00:25 // 创建日期2019-04-28
**/
public interface DormRepairService {
//分页查询
/**
* 宿
* @param d_id 宿ID
* @param d_dormbuilding 宿
* @param pageIndex
* @param pageSize
* @return PageInfo<DormRepair>
*/
public PageInfo<DormRepair> findPageInfo(Integer d_id, String d_dormbuilding, Integer pageIndex, Integer pageSize);
public int addDormRepair(DormRepair dormrepair); //添加宿舍信息
public int deleteDormRepair(Integer r_id); //删除宿舍信息
public int updateDormRepair(DormRepair dormrepair); //修改宿舍信息
public DormRepair findDormRepairById(Integer r_id);
public List<DormRepair> getAll();
/**
* 宿
* @param dormrepair 宿
* @return 1 0
*/
public int addDormRepair(DormRepair dormrepair); // 添加宿舍维修信息
/**
* 宿
* @param r_id ID
* @return 1 0
*/
public int deleteDormRepair(Integer r_id); // 删除宿舍维修登记信息
/**
* 宿
* @param dormrepair 宿
* @return 1 0
*/
public int updateDormRepair(DormRepair dormrepair); // 修改宿舍维修信息
/**
* ID宿
* @param r_id ID
* @return 宿 null
*/
public DormRepair findDormRepairById(Integer r_id); // 根据维修登记ID查询单条宿舍维修信息
/**
* 宿
* @return List<DormRepair>宿
*/
public List<DormRepair> getAll(); // 获取所有宿舍维修登记信息
}

@ -1,24 +1,64 @@
package com.itheima.service;
package com.itheima.service; // 定义接口所属的包路径com.itheima.service
import com.itheima.po.Dormitory;
import com.itheima.po.PageInfo;
import com.itheima.po.Dormitory; // 导入 Dormitory 类,表示宿舍实体类
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于分页信息封装
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 Dormitory 对象
/**
* Service
* Service // 该接口定义了宿舍管理服务层的各种业务操作
*/
public interface DormitoryService {
//分页查询
public PageInfo<Dormitory> findPageInfo(String a_name, Integer s_dormitoryid,String d_dormbuilding, Integer pageIndex, Integer pageSize);
/**
* 宿
* @param a_name 宿
* @param s_dormitoryid 宿ID
* @param d_dormbuilding 宿
* @param pageIndex
* @param pageSize
* @return PageInfo<Dormitory>
*/
public PageInfo<Dormitory> findPageInfo(String a_name, Integer s_dormitoryid, String d_dormbuilding, Integer pageIndex, Integer pageSize);
public int addDormitory(Dormitory dormitory); //添加宿舍信息
public int deleteDormitory(Integer d_id); //删除宿舍信息
public int updateDormitory(Dormitory dormitory); //修改宿舍信息
public Dormitory findDormitoryById(Integer d_id);
/**
* 宿
* @param dormitory 宿
* @return 1 0
*/
public int addDormitory(Dormitory dormitory); // 添加宿舍信息
public List<Dormitory> findDormitoryStudent(Dormitory dormitory);//查询宿舍人员信息
public List<Dormitory> getAll();
/**
* 宿
* @param d_id 宿ID
* @return 1 0
*/
public int deleteDormitory(Integer d_id); // 删除宿舍信息
/**
* 宿
* @param dormitory 宿
* @return 1 0
*/
public int updateDormitory(Dormitory dormitory); // 修改宿舍信息
/**
* 宿ID宿
* @param d_id 宿ID
* @return 宿 null
*/
public Dormitory findDormitoryById(Integer d_id); // 根据宿舍ID查询单条宿舍信息
/**
* 宿
* @param dormitory 宿
* @return 宿
*/
public List<Dormitory> findDormitoryStudent(Dormitory dormitory); // 查询宿舍人员信息
/**
* 宿
* @return List<Dormitory>宿
*/
public List<Dormitory> getAll(); // 获取所有宿舍信息
}

@ -1,23 +1,60 @@
package com.itheima.service;
package com.itheima.service; // 定义接口所属的包路径com.itheima.service
import com.itheima.po.PageInfo;
import com.itheima.po.StudentClean;
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于分页信息的封装
import com.itheima.po.StudentClean; // 导入 StudentClean 类,表示学生卫生相关的实体类
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 StudentClean 对象
/**
* @program: dormitorySystem
* @description:
* @author: Joyrocky
* @create: 2019-04-25 12:15
* @program: dormitorySystem // 程序名称dormitorySystem
* @description: // 该接口用于提供学生卫生管理相关的业务操作
* @author: Joyrocky // 作者信息Joyrocky
* @create: 2019-04-25 12:15 // 创建日期2019-04-25
**/
public interface StudentCleanService {
//分页查询
/**
*
* @param s_studentid ID
* @param s_name
* @param s_dormitoryid 宿ID
* @param pageIndex
* @param pageSize
* @return PageInfo<StudentClean>
*/
public PageInfo<StudentClean> findPageInfo(Integer s_studentid, String s_name, Integer s_dormitoryid, Integer pageIndex, Integer pageSize);
public int addStudentClean(StudentClean studentclean); //添加宿舍信息
public int deleteStudentClean(Integer g_id); //删除宿舍信息
public int updateStudentClean(StudentClean studentclean); //修改宿舍信息
public StudentClean findStudentCleanById(Integer g_id);
public List<StudentClean> getAll();
/**
*
* @param studentclean
* @return 1 0
*/
public int addStudentClean(StudentClean studentclean); // 添加学生卫生记录
/**
*
* @param g_id ID
* @return 1 0
*/
public int deleteStudentClean(Integer g_id); // 删除学生卫生记录
/**
*
* @param studentclean
* @return 1 0
*/
public int updateStudentClean(StudentClean studentclean); // 修改学生卫生记录
/**
* ID
* @param g_id ID
* @return null
*/
public StudentClean findStudentCleanById(Integer g_id); // 根据卫生记录ID查询单条学生卫生记录
/**
*
* @return List<StudentClean>
*/
public List<StudentClean> getAll(); // 获取所有学生卫生记录
}

@ -1,23 +1,60 @@
package com.itheima.service;
import com.itheima.po.PageInfo;
import com.itheima.po.Student;
import org.apache.ibatis.annotations.Param;
package com.itheima.service; // 定义接口所在的包路径com.itheima.service
import java.util.List;
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于封装分页信息,包含当前页、每页条数、总记录数等
import com.itheima.po.Student; // 导入 Student 类,用于表示学生实体类,通常包含学生的各种属性
import org.apache.ibatis.annotations.Param; // 导入 MyBatis 注解,用于指定参数名(此处代码没有实际使用)
import java.util.List; // 导入 List 类,用于存储多个 Student 对象,表示多个学生记录
/**
* Service
* Service // 该接口定义了学生管理的业务操作
*/
public interface StudentService {
//分页查询
public PageInfo<Student> findPageInfo(String s_name,Integer s_studentid,Integer s_classid,
String s_classname, Integer pageIndex, Integer pageSize);
/**
*
* @param s_name
* @param s_studentid ID
* @param s_classid ID
* @param s_classname
* @param pageIndex
* @param pageSize
* @return PageInfo<Student>
*/
public PageInfo<Student> findPageInfo(String s_name, Integer s_studentid, Integer s_classid,
String s_classname, Integer pageIndex, Integer pageSize);
/**
* ID
* @param s_id ID
* @return 1 0
*/
public int deleteStudent(Integer s_id); // 删除学生信息
/**
*
* @param student
* @return 1 0
*/
public int addStudent(Student student); // 添加学生信息
/**
*
* @param student
* @return 1 0
*/
public int updateStudent(Student student); // 修改学生信息
public int deleteStudent(Integer s_id); //通过id删除学生信息
public int addStudent(Student student); //添加学生信息
public int updateStudent(Student student); //修改学生信息
public Student findStudentById(Integer s_id);
public List<Student> getAll();
/**
* ID
* @param s_id ID
* @return null
*/
public Student findStudentById(Integer s_id); // 根据学生ID查询学生信息
/**
*
* @return List<Student>
*/
public List<Student> getAll(); // 获取所有学生信息
}

@ -1,20 +1,42 @@
package com.itheima.service;
package com.itheima.service; // 定义接口所在的包路径com.itheima.service
import com.itheima.po.PageInfo;
import com.itheima.po.Visitor;
import org.springframework.ui.Model;
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于封装分页信息,包含当前页、每页条数、总记录数等
import com.itheima.po.Visitor; // 导入 Visitor 类,用于表示访客实体类,通常包含访客的各种属性,如姓名、电话等
import org.springframework.ui.Model; // 导入 Spring 的 Model 类,通常用于在 Controller 中传递数据给视图(本代码中没有使用)
import java.util.List;
import java.util.List; // 导入 List 类,用于存储多个 Visitor 对象,表示多个访客记录
/**
* @program: dormitorySystem
* @description: 访
* @author: Joyrocky
* @create: 2019-05-14 12:39
* @program: dormitorySystem // 项目名称:宿舍管理系统
* @description: 访 // 接口描述:访客管理服务接口,定义了访客相关的业务操作
* @author: Joyrocky // 作者Joyrocky
* @create: 2019-05-14 12:39 // 创建时间2019年5月14日 12:39
**/
public interface VisitorService {
//分页查询
public PageInfo<Visitor> findPageInfo(String v_name, Integer v_phone , Integer pageIndex, Integer pageSize);
public int addVisitor(Visitor visitor); //添加访客信息
public List<Visitor> getAll();
/**
* 访
* @param v_name 访
* @param v_phone 访
* @param pageIndex
* @param pageSize
* @return PageInfo<Visitor>
*/
public PageInfo<Visitor> findPageInfo(String v_name, Integer v_phone,
Integer pageIndex, Integer pageSize);
// 分页查询访客信息根据姓名v_name和电话v_phone进行筛选查询分页参数为 pageIndex 和 pageSize。
// 返回一个 PageInfo<Visitor> 对象,包含了分页相关信息和查询结果。
/**
* 访
* @param visitor 访
* @return 1 0
*/
public int addVisitor(Visitor visitor); // 添加访客信息返回受影响的行数1 表示添加成功0 表示添加失败
/**
* 访
* @return List<Visitor>访
*/
public List<Visitor> getAll(); // 获取所有访客信息,返回一个 List<Visitor>,表示所有访客记录
}

@ -1,79 +1,113 @@
package com.itheima.service.impl;
package com.itheima.service.impl; // 定义包路径,说明该类是实现类,位于 service.impl 包下
import com.itheima.dao.AdminDao;
import com.itheima.po.Admin;
import com.itheima.po.PageInfo;
import com.itheima.service.AdminService;
import com.itheima.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.AdminDao; // 导入 AdminDao进行数据库操作
import com.itheima.po.Admin; // 导入 Admin 实体类,表示管理员
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于分页查询的结果封装
import com.itheima.service.AdminService; // 导入 AdminService 接口,定义管理员服务接口
import com.itheima.util.MD5Util; // 导入 MD5Util 工具类,用于密码加密(虽然在这个类里没有直接使用)
import org.springframework.beans.factory.annotation.Autowired; // 导入 Spring 的注解,自动注入依赖
import org.springframework.stereotype.Service; // 导入 Service 注解,表示该类是服务层的实现类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import java.util.List;
import java.util.List; // 导入 List 类,用于存储管理员列表
/**
* Service
*/
@Service("adminService")
@Transactional
public class AdminServiceImpl implements AdminService {
// 注入UserDao
@Autowired
private AdminDao adminDao;
@Service("adminService") // 将该类标记为一个 Spring 服务类,名字为 "adminService"
@Transactional // 表示该类的所有方法都应该支持事务管理
public class AdminServiceImpl implements AdminService { // 实现 AdminService 接口
//管理登陆查询
@Override
public Admin findAdmin(Admin admin) {
Admin a = adminDao.findAdmin(admin);
return a;
}
// 注入 AdminDao 用于访问数据库
@Autowired
private AdminDao adminDao; // 自动注入 AdminDao 对象Spring 会自动处理该依赖关系
@Override
public List<Admin> getAll(){
/**
*
* @param admin
* @return null
*/
@Override
public Admin findAdmin(Admin admin) { // 实现 AdminService 接口的 findAdmin 方法
Admin a = adminDao.findAdmin(admin); // 调用 AdminDao 的 findAdmin 方法查询管理员
return a; // 返回查询结果
}
List<Admin> adminList = adminDao.getAll();
return adminList;
/**
*
* @return
*/
@Override
public List<Admin> getAll() { // 实现 AdminService 接口的 getAll 方法
List<Admin> adminList = adminDao.getAll(); // 调用 AdminDao 的 getAll 方法查询所有管理员
return adminList; // 返回查询到的管理员列表
}
@Override
public PageInfo<Admin> findPageInfo(String a_username, String a_describe,Integer a_id,Integer pageIndex, Integer pageSize) {
PageInfo<Admin> pi = new PageInfo<Admin>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = adminDao.totalCount(a_username,a_describe,a_id);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示管理员信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<Admin> adminList = adminDao.getAdminList(a_username,a_describe,a_id,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(adminList);
}
return pi;
}
/**
*
* @param a_username
* @param a_describe
* @param a_id ID
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
@Override
public PageInfo<Admin> findPageInfo(String a_username, String a_describe, Integer a_id, Integer pageIndex, Integer pageSize) {
PageInfo<Admin> pi = new PageInfo<Admin>(); // 创建 PageInfo 对象,用于封装分页信息
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的管理员总数
Integer totalCount = adminDao.totalCount(a_username, a_describe, a_id); // 调用 adminDao 获取符合条件的管理员总数
if (totalCount > 0) { // 如果总记录数大于 0表示有查询结果
pi.setTotalCount(totalCount); // 设置分页对象的总记录数
// 计算查询数据的起始行数 (当前页 - 1) * 每页记录数
List<Admin> adminList = adminDao.getAdminList(a_username, a_describe, a_id,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()); // 调用 adminDao 查询分页数据
pi.setList(adminList); // 将查询结果设置到分页对象中
}
return pi; // 返回分页对象
}
//添加管理员信息
@Override
public int addAdmin(Admin admin) {
return adminDao.addAdmin(admin);
}
/**
*
* @param admin
* @return 1 0
*/
@Override
public int addAdmin(Admin admin) { // 实现 AdminService 接口的 addAdmin 方法
return adminDao.addAdmin(admin); // 调用 adminDao 的 addAdmin 方法添加管理员信息
}
//通过id删除管理员信息
@Override
public int deleteAdmin(Integer a_id) {
return adminDao.deleteAdmin(a_id);
}
/**
* ID
* @param a_id ID
* @return 1 0
*/
@Override
public int deleteAdmin(Integer a_id) { // 实现 AdminService 接口的 deleteAdmin 方法
return adminDao.deleteAdmin(a_id); // 调用 adminDao 的 deleteAdmin 方法删除管理员信息
}
//修改管理员信息
@Override
public int updateAdmin(Admin admin) {
return adminDao.updateAdmin(admin);
}
/**
*
* @param admin
* @return 1 0
*/
@Override
public int updateAdmin(Admin admin) { // 实现 AdminService 接口的 updateAdmin 方法
return adminDao.updateAdmin(admin); // 调用 adminDao 的 updateAdmin 方法修改管理员信息
}
@Override
public Admin findAdminById (Integer a_id){
Admin a = adminDao.findAdminById(a_id);
return a;
}
/**
* ID
* @param a_id ID
* @return
*/
@Override
public Admin findAdminById(Integer a_id) { // 实现 AdminService 接口的 findAdminById 方法
Admin a = adminDao.findAdminById(a_id); // 调用 adminDao 的 findAdminById 方法查询管理员信息
return a; // 返回查询结果
}
}

@ -1,79 +1,112 @@
package com.itheima.service.impl;
package com.itheima.service.impl; // 定义包路径,表明该类是实现类,位于 service.impl 包下
import com.itheima.dao.ClassDao; // 导入 ClassDao用于与数据库交互
import com.itheima.po.Class; // 导入 Class 实体类,表示班级
import com.itheima.po.PageInfo; // 导入 PageInfo 类,用于封装分页信息
import com.itheima.service.ClassService; // 导入 ClassService 接口,定义班级服务
import org.springframework.beans.factory.annotation.Autowired; // 导入 Spring 注解,用于自动注入依赖
import org.springframework.stereotype.Service; // 导入 Service 注解,标记该类为服务层的实现
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import com.itheima.dao.ClassDao;
import com.itheima.po.Class;
import com.itheima.po.PageInfo;
import com.itheima.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.List; // 导入 List 类,用于存储班级信息列表
/**
* Service
* Service
*/
@Service("classService")
@Transactional
public class ClassServiceImpl implements ClassService {
// classDao
@Autowired
private ClassDao classDao;
@Service("classService") // 将该类标记为 Spring 服务类bean 名称为 "classService"
@Transactional // 表示该类的所有方法都由 Spring 管理事务
public class ClassServiceImpl implements ClassService { // 实现 ClassService 接口
// 自动注入 ClassDao用于访问数据库操作
@Autowired
private ClassDao classDao; // Spring 会自动注入符合类型的 ClassDao 实现
/**
*
* @param c_classname
* @param c_counsellor
* @param c_classid ID
* @param pageIndex
* @param pageSize
* @return
*/
@Override
public PageInfo<Class> findPageInfo(String c_classname, String c_counsellor, Integer c_classid, Integer pageIndex, Integer pageSize) {
PageInfo<Class> pi = new PageInfo<Class>(); // 创建 PageInfo 对象,用于存储分页信息
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的总记录数
Integer totalCount = classDao.totalCount(c_classname, c_classid, c_counsellor); // 调用 ClassDao 获取总记录数
if (totalCount > 0) { // 如果总记录数大于 0表示有查询结果
pi.setTotalCount(totalCount); // 设置分页对象的总记录数
// 计算查询数据的起始行数 (当前页 - 1) * 每页记录数
List<Class> classList = classDao.getClassList(c_classname, c_classid, c_counsellor,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()); // 调用 ClassDao 获取分页数据
pi.setList(classList); // 将查询结果设置到分页对象中
}
return pi; // 返回分页对象
}
//分页查询
@Override
public PageInfo<Class> findPageInfo(String c_classname, String c_counsellor, Integer c_classid, Integer pageIndex, Integer pageSize) {
PageInfo<Class> pi = new PageInfo<Class>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = classDao.totalCount(c_classname,c_classid,c_counsellor);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示班级信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<Class> classList = classDao.getClassList(c_classname,c_classid,c_counsellor,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(classList);
}
return pi;
}
/**
*
* @return
*/
@Override
public List<Class> getAll() {
List<Class> classList = classDao.getAll(); // 调用 ClassDao 获取所有班级信息
return classList; // 返回班级列表
}
@Override
public List<Class> getAll(){
List<Class> classList = classDao.getAll();
return classList;
}
/**
* ID
* @param c_id ID
* @return 1 0
*/
@Override
public int deleteClass(Integer c_id) {
return classDao.deleteClass(c_id); // 调用 ClassDao 删除班级信息
}
//通过id删除班级信息
@Override
public int deleteClass(Integer c_id) {
return classDao.deleteClass(c_id);
}
/**
*
* @param uclass
* @return 1 0
*/
@Override
public int addClass(Class uclass) {
return classDao.addClass(uclass); // 调用 ClassDao 添加班级信息
}
//添加班级信息
@Override
public int addClass(Class uclass) {
return classDao.addClass(uclass);
}
/**
* ID
* @param c_id ID
* @return
*/
@Override
public Class findClassById(Integer c_id) {
Class c = classDao.findClassById(c_id); // 调用 ClassDao 根据班级 ID 查询班级信息
return c; // 返回查询结果
}
@Override
public Class findClassById (Integer c_id){
Class c = classDao.findClassById(c_id);
return c;
}
//修改班级信息
@Override
public int updateClass(Class uclass) {
return classDao.updateClass(uclass);
}
/**
*
* @param uclass
* @return 1 0
*/
@Override
public int updateClass(Class uclass) {
return classDao.updateClass(uclass); // 调用 ClassDao 修改班级信息
}
//查询宿舍人员信息
@Override
public List<Class> findClassStudent(Class uclass) {
List<Class> c = classDao.findClassStudent(uclass);
return c;
}
/**
*
* @param uclass
* @return
*/
@Override
public List<Class> findClassStudent(Class uclass) {
List<Class> c = classDao.findClassStudent(uclass); // 调用 ClassDao 查询班级的学生信息
return c; // 返回查询结果
}
}

@ -1,14 +1,14 @@
package com.itheima.service.impl;
package com.itheima.service.impl; // 定义该类所在的包路径,表示是服务实现类
import com.itheima.dao.DormCleanDao;
import com.itheima.po.DormClean;
import com.itheima.po.PageInfo;
import com.itheima.service.DormCleanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.DormCleanDao; // 导入 DormCleanDao用于与数据库交互操作宿舍卫生相关数据
import com.itheima.po.DormClean; // 导入 DormClean 类,表示宿舍卫生信息实体
import com.itheima.po.PageInfo; // 导入 PageInfo 类,封装分页信息
import com.itheima.service.DormCleanService; // 导入 DormCleanService 接口,表示宿舍卫生服务
import org.springframework.beans.factory.annotation.Autowired; // 导入 Spring 的注解,用于自动注入依赖
import org.springframework.stereotype.Service; // 导入 Service 注解,表示该类是 Spring 的服务类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解,用于声明事务管理
import java.util.List;
import java.util.List; // 导入 List 类,用于存储宿舍卫生信息列表
/**
* @program: dormitorySystem
@ -16,62 +16,96 @@ import java.util.List;
* @author: Joyrocky
* @create: 2019-04-24 15:19
**/
@Service("dormCleanService")
@Transactional
public class DormCleanServiceImpl implements DormCleanService {
// classDao
@Autowired
private DormCleanDao dormCleanDao;
@Service("dormCleanService") // 将该类标记为 Spring 的服务类bean 名称为 "dormCleanService"
@Transactional // 标明该类中的所有方法都由 Spring 管理事务
public class DormCleanServiceImpl implements DormCleanService { // 实现 DormCleanService 接口
// 自动注入 DormCleanDao用于访问宿舍卫生数据
@Autowired
private DormCleanDao dormCleanDao; // Spring 会自动注入符合类型的 DormCleanDao 实现类
//分页查询
/**
* 宿
* @param d_id 宿 ID
* @param d_dormbuilding 宿
* @param pageIndex
* @param pageSize
* @return 宿
*/
@Override
public PageInfo<DormClean> findPageInfo(Integer d_id, String d_dormbuilding, Integer pageIndex, Integer pageSize) {
// 创建 PageInfo 对象来存储分页信息
PageInfo<DormClean> pi = new PageInfo<DormClean>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = dormCleanDao.totalCount(d_id,d_dormbuilding);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示宿舍信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<DormClean> dormCleanList = dormCleanDao.getDormCleanList(d_id,d_dormbuilding,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(dormCleanList);
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页的记录数
// 获取符合条件的总记录数
Integer totalCount = dormCleanDao.totalCount(d_id, d_dormbuilding); // 调用 Dao 层方法获取总条数
if (totalCount > 0) { // 如果查询结果不为空
pi.setTotalCount(totalCount); // 设置总记录数
// 计算分页查询的起始行数,并获取当前页的宿舍卫生信息列表
List<DormClean> dormCleanList = dormCleanDao.getDormCleanList(d_id, d_dormbuilding,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()); // 调用 Dao 层方法获取分页数据
pi.setList(dormCleanList); // 设置分页对象的班级列表
}
return pi;
return pi; // 返回分页信息对象
}
/**
* 宿
* @return 宿
*/
@Override
public List<DormClean> getAll(){
List<DormClean> dormCleanList = dormCleanDao.getAll();
return dormCleanList;
public List<DormClean> getAll() {
// 获取所有宿舍卫生信息并返回
List<DormClean> dormCleanList = dormCleanDao.getAll(); // 调用 Dao 层方法获取所有宿舍卫生信息
return dormCleanList; // 返回所有宿舍卫生信息
}
//添加宿舍卫生信息
/**
* 宿
* @param dormclean 宿
* @return 1 0
*/
@Override
public int addDormClean(DormClean dormclean) {
return dormCleanDao.addDormClean(dormclean);
// 调用 Dao 层方法将宿舍卫生信息插入数据库
return dormCleanDao.addDormClean(dormclean); // 返回数据库操作受影响的行数
}
//通过id删除宿舍卫生信息
/**
* ID 宿
* @param g_id 宿 ID
* @return 1 0
*/
@Override
public int deleteDormClean(Integer g_id) {
return dormCleanDao.deleteDormClean(g_id);
// 调用 Dao 层方法根据 ID 删除宿舍卫生信息
return dormCleanDao.deleteDormClean(g_id); // 返回删除操作受影响的行数
}
//修改宿舍卫生信息
/**
* 宿
* @param dormclean 宿
* @return 1 0
*/
@Override
public int updateDormClean(DormClean dormclean) {
return dormCleanDao.updateDormClean(dormclean);
// 调用 Dao 层方法更新宿舍卫生信息
return dormCleanDao.updateDormClean(dormclean); // 返回更新操作受影响的行数
}
/**
* ID 宿
* @param g_id 宿 ID
* @return 宿
*/
@Override
public DormClean findDormCleanById (Integer g_id){
DormClean d = dormCleanDao.findDormCleanById(g_id);
return d;
public DormClean findDormCleanById(Integer g_id) {
// 调用 Dao 层方法根据 ID 查询宿舍卫生信息
DormClean d = dormCleanDao.findDormCleanById(g_id); // 获取宿舍卫生信息
return d; // 返回查询结果
}
}

@ -1,77 +1,91 @@
package com.itheima.service.impl;
import com.itheima.dao.DormRepairDao;
import com.itheima.po.DormRepair;
import com.itheima.po.PageInfo;
import com.itheima.service.DormRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.DormRepairDao; // 导入DormRepairDao接口用于数据访问操作
import com.itheima.po.DormRepair; // 导入DormRepair类用于表示宿舍维修记录
import com.itheima.po.PageInfo; // 导入PageInfo类用于分页信息
import com.itheima.service.DormRepairService; // 导入DormRepairService接口该类实现该接口
import org.springframework.beans.factory.annotation.Autowired; // 导入自动注入的注解
import org.springframework.stereotype.Service; // 导入Service注解标识这是一个Service类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import java.util.List;
import java.util.List; // 导入List类用于存储多个维修记录对象
/**
* @program: dormitorySystem
* @description:
* @description:
* @author: Joyrocky
* @create: 2019-04-28 00:24
**/
@Service("dormRepairService")
@Transactional
@Service("dormRepairService") // 标注该类为一个Spring服务组件名称为dormRepairService
@Transactional // 启用事务管理,确保该类中数据库操作的原子性
public class DormRepairServiceImpl implements DormRepairService {
// classDao
// 自动注入DormRepairDaoDAO层用于与数据库交互
@Autowired
private DormRepairDao dormRepairDao;
//分页查询
// 分页查询维修记录的方法
@Override
public PageInfo<DormRepair> findPageInfo(Integer d_id, String d_dormbuilding, Integer pageIndex, Integer pageSize) {
// 创建PageInfo对象用于存储分页信息
PageInfo<DormRepair> pi = new PageInfo<DormRepair>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = dormRepairDao.totalCount(d_id,d_dormbuilding);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示宿舍信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<DormRepair> dormRepairList = dormRepairDao.getDormRepairList(d_id,d_dormbuilding,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(dormRepairList);
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的总记录数
Integer totalCount = dormRepairDao.totalCount(d_id, d_dormbuilding);
// 如果总记录数大于0进行分页查询
if (totalCount > 0) {
pi.setTotalCount(totalCount); // 设置总记录数
// 计算当前页的起始位置,并查询当前页的维修记录列表
// currentPage = (pageIndex - 1) * pageSize
List<DormRepair> dormRepairList = dormRepairDao.getDormRepairList(
d_id, d_dormbuilding,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()
);
pi.setList(dormRepairList); // 设置当前页的维修记录列表
}
return pi;
return pi; // 返回包含分页信息的PageInfo对象
}
// 获取所有维修记录的方法
@Override
public List<DormRepair> getAll(){
public List<DormRepair> getAll() {
// 调用DAO层获取所有维修记录并返回列表
List<DormRepair> dormRepairList = dormRepairDao.getAll();
return dormRepairList;
return dormRepairList; // 返回维修记录列表
}
//添加宿舍信息
// 添加维修记录的方法
@Override
public int addDormRepair(DormRepair dormrepair) {
// 调用DAO层的addDormRepair方法添加维修记录并返回受影响的行数
return dormRepairDao.addDormRepair(dormrepair);
}
//通过id删除宿舍信息
// 通过维修记录ID删除维修记录的方法
@Override
public int deleteDormRepair(Integer r_id) {
// 调用DAO层的deleteDormRepair方法删除指定ID的维修记录并返回受影响的行数
return dormRepairDao.deleteDormRepair(r_id);
}
//修改宿舍信息
// 修改维修记录的方法
@Override
public int updateDormRepair(DormRepair dormrepair) {
// 调用DAO层的updateDormRepair方法更新维修记录并返回受影响的行数
return dormRepairDao.updateDormRepair(dormrepair);
}
// 根据维修记录ID查询单条维修记录的方法
@Override
public DormRepair findDormRepairById (Integer r_id){
public DormRepair findDormRepairById(Integer r_id) {
// 调用DAO层的findDormRepairById方法根据ID查询维修记录
DormRepair d = dormRepairDao.findDormRepairById(r_id);
return d;
return d; // 返回查询到的维修记录
}
}

@ -1,7 +1,5 @@
package com.itheima.service.impl;
import com.itheima.dao.DormitoryDao;
import com.itheima.po.Dormitory;
import com.itheima.po.PageInfo;
@ -13,70 +11,106 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Service
* 宿 Service
*/
@Service("dormitoryService")
@Transactional
@Service("dormitoryService") // 将该类标识为 Spring 服务类,能够被 Spring 容器自动管理
@Transactional // 开启事务管理,确保在操作宿舍数据时进行事务控制
public class DormitoryServiceImpl implements DormitoryService {
// classDao
@Autowired
private DormitoryDao dormitoryDao;
//分页查询
@Override
public PageInfo<Dormitory> findPageInfo(String a_name, Integer s_dormitoryid,String d_dormbuilding, Integer pageIndex, Integer pageSize) {
PageInfo<Dormitory> pi = new PageInfo<Dormitory>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = dormitoryDao.totalCount(a_name,s_dormitoryid,d_dormbuilding);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示宿舍信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<Dormitory> dormitoryList = dormitoryDao.getDormitoryList(a_name,s_dormitoryid,d_dormbuilding,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(dormitoryList);
}
return pi;
}
// 自动注入 DormitoryDaoDAO层处理宿舍数据的操作
@Autowired
private DormitoryDao dormitoryDao;
@Override
public List<Dormitory> getAll(){
List<Dormitory> dormitoryList = dormitoryDao.getAll();
return dormitoryList;
}
/**
* 宿
* @param a_name 宿
* @param s_dormitoryid 宿ID
* @param d_dormbuilding 宿
* @param pageIndex
* @param pageSize
* @return
*/
@Override
public PageInfo<Dormitory> findPageInfo(String a_name, Integer s_dormitoryid, String d_dormbuilding, Integer pageIndex, Integer pageSize) {
PageInfo<Dormitory> pi = new PageInfo<Dormitory>(); // 创建分页信息对象
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的条数
// 获取总条数,分页需要使用总记录数来计算总页数
Integer totalCount = dormitoryDao.totalCount(a_name, s_dormitoryid, d_dormbuilding);
// 如果总条数大于0则进行分页查询
if (totalCount > 0) {
pi.setTotalCount(totalCount); // 设置总记录数
// 计算分页查询时的开始行数
List<Dormitory> dormitoryList = dormitoryDao.getDormitoryList(
a_name, s_dormitoryid, d_dormbuilding,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()
);
pi.setList(dormitoryList); // 设置当前页的数据列表
}
return pi; // 返回分页信息
}
//添加宿舍信息
@Override
public int addDormitory(Dormitory dormitory) {
return dormitoryDao.addDormitory(dormitory);
}
/**
* 宿
* @return 宿
*/
@Override
public List<Dormitory> getAll() {
List<Dormitory> dormitoryList = dormitoryDao.getAll(); // 调用 DAO 层获取所有宿舍信息
return dormitoryList; // 返回宿舍信息列表
}
//通过id删除宿舍信息
@Override
public int deleteDormitory(Integer d_id) {
return dormitoryDao.deleteDormitory(d_id);
}
/**
* 宿
* @param dormitory 宿
* @return
*/
@Override
public int addDormitory(Dormitory dormitory) {
return dormitoryDao.addDormitory(dormitory); // 调用 DAO 层的添加宿舍方法
}
//修改宿舍信息
@Override
public int updateDormitory(Dormitory dormitory) {
return dormitoryDao.updateDormitory(dormitory);
}
/**
* 宿ID宿
* @param d_id 宿ID
* @return
*/
@Override
public int deleteDormitory(Integer d_id) {
return dormitoryDao.deleteDormitory(d_id); // 调用 DAO 层删除宿舍信息的方法
}
@Override
public Dormitory findDormitoryById (Integer d_id){
Dormitory d = dormitoryDao.findDormitoryById(d_id);
return d;
}
//查询宿舍人员信息
@Override
public List<Dormitory> findDormitoryStudent(Dormitory dormitory) {
List<Dormitory> d = dormitoryDao.findDormitoryStudent(dormitory);
return d;
}
/**
* 宿
* @param dormitory 宿
* @return
*/
@Override
public int updateDormitory(Dormitory dormitory) {
return dormitoryDao.updateDormitory(dormitory); // 调用 DAO 层修改宿舍信息的方法
}
/**
* 宿ID宿
* @param d_id 宿ID
* @return 宿
*/
@Override
public Dormitory findDormitoryById(Integer d_id) {
Dormitory d = dormitoryDao.findDormitoryById(d_id); // 调用 DAO 层根据宿舍ID查询宿舍信息
return d; // 返回宿舍对象
}
/**
* 宿
* @param dormitory 宿
* @return 宿
*/
@Override
public List<Dormitory> findDormitoryStudent(Dormitory dormitory) {
List<Dormitory> d = dormitoryDao.findDormitoryStudent(dormitory); // 调用 DAO 层查询宿舍人员信息的方法
return d; // 返回宿舍学生信息列表
}
}

@ -1,77 +1,90 @@
package com.itheima.service.impl;
import com.itheima.dao.StudentCleanDao;
import com.itheima.po.PageInfo;
import com.itheima.po.StudentClean;
import com.itheima.service.StudentCleanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.StudentCleanDao; // 导入StudentCleanDao接口用于数据访问操作
import com.itheima.po.PageInfo; // 导入PageInfo类用于封装分页信息
import com.itheima.po.StudentClean; // 导入StudentClean类用于表示学生宿舍卫生记录
import com.itheima.service.StudentCleanService; // 导入StudentCleanService接口该类实现该接口
import org.springframework.beans.factory.annotation.Autowired; // 导入自动注入的注解
import org.springframework.stereotype.Service; // 导入Service注解标识这是一个Service类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import java.util.List;
import java.util.List; // 导入List类用于存储多个学生宿舍卫生记录对象
/**
* @program: dormitorySystem
* @description:
* @description:
* @author: Joyrocky
* @create: 2019-04-25 12:16
**/
@Service("studentCleanService")
@Transactional
@Service("studentCleanService") // 标注该类为一个Spring服务组件名称为studentCleanService
@Transactional // 启用事务管理,确保该类中数据库操作的原子性
public class StudentCleanServiceImpl implements StudentCleanService {
// classDao
// 自动注入StudentCleanDaoDAO层用于与数据库交互
@Autowired
private StudentCleanDao studentCleanDao;
//分页查询
// 分页查询学生宿舍卫生记录的方法
@Override
public PageInfo<StudentClean> findPageInfo(Integer s_studentid, String s_name, Integer s_dormitoryid, Integer pageIndex, Integer pageSize) {
// 创建PageInfo对象用于存储分页信息
PageInfo<StudentClean> pi = new PageInfo<StudentClean>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = studentCleanDao.totalCount(s_studentid,s_name,s_dormitoryid);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示宿舍信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<StudentClean> studentCleanList = studentCleanDao.getStudentCleanList(s_studentid,s_name,s_dormitoryid,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(studentCleanList);
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的总记录数
Integer totalCount = studentCleanDao.totalCount(s_studentid, s_name, s_dormitoryid);
// 如果总记录数大于0进行分页查询
if (totalCount > 0) {
pi.setTotalCount(totalCount); // 设置总记录数
// 计算当前页的起始位置,并查询当前页的学生宿舍卫生记录列表
// currentPage = (pageIndex - 1) * pageSize
List<StudentClean> studentCleanList = studentCleanDao.getStudentCleanList(
s_studentid, s_name, s_dormitoryid,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()
);
pi.setList(studentCleanList); // 设置当前页的学生宿舍卫生记录列表
}
return pi;
return pi; // 返回包含分页信息的PageInfo对象
}
// 获取所有学生宿舍卫生记录的方法
@Override
public List<StudentClean> getAll(){
public List<StudentClean> getAll() {
// 调用DAO层获取所有学生宿舍卫生记录并返回列表
List<StudentClean> studentCleanList = studentCleanDao.getAll();
return studentCleanList;
return studentCleanList; // 返回学生宿舍卫生记录列表
}
//添加宿舍卫生信息
// 添加学生宿舍卫生记录的方法
@Override
public int addStudentClean(StudentClean studentclean) {
// 调用DAO层的addStudentClean方法添加新的学生宿舍卫生记录并返回受影响的行数
return studentCleanDao.addStudentClean(studentclean);
}
//通过id删除宿舍卫生信息
// 通过ID删除学生宿舍卫生记录的方法
@Override
public int deleteStudentClean(Integer g_id) {
// 调用DAO层的deleteStudentClean方法删除指定ID的学生宿舍卫生记录并返回受影响的行数
return studentCleanDao.deleteStudentClean(g_id);
}
//修改宿舍卫生信息
// 修改学生宿舍卫生记录的方法
@Override
public int updateStudentClean(StudentClean studentclean) {
// 调用DAO层的updateStudentClean方法更新学生宿舍卫生记录并返回受影响的行数
return studentCleanDao.updateStudentClean(studentclean);
}
// 根据ID查询学生宿舍卫生记录的方法
@Override
public StudentClean findStudentCleanById (Integer g_id){
public StudentClean findStudentCleanById(Integer g_id) {
// 调用DAO层的findStudentCleanById方法根据ID查询学生宿舍卫生记录
StudentClean d = studentCleanDao.findStudentCleanById(g_id);
return d;
return d; // 返回查询到的学生宿舍卫生记录
}
}

@ -1,72 +1,117 @@
package com.itheima.service.impl;
import com.itheima.dao.StudentDao; // 导入StudentDao接口用于数据访问操作
import com.itheima.po.PageInfo; // 导入PageInfo类用于封装分页信息
import com.itheima.po.Student; // 导入Student类用于表示学生对象
import com.itheima.service.StudentService; // 导入StudentService接口该类实现该接口
import org.springframework.beans.factory.annotation.Autowired; // 导入自动注入的注解
import org.springframework.stereotype.Service; // 导入Service注解标识这是一个Service类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import com.itheima.dao.StudentDao;
import com.itheima.po.PageInfo;
import com.itheima.po.Student;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.List; // 导入List类用于存储多个学生对象
/**
* Service
*/
@Service("studentService")
@Transactional
@Service("studentService") // 标注该类为一个Spring管理的服务组件名称为studentService
@Transactional // 启用事务管理,确保该类中的数据库操作要么全部成功,要么全部回滚,保证数据一致性和完整性
public class StudentServiceImpl implements StudentService {
// 注入studentDao
@Autowired
private StudentDao studentDao;
// 自动注入StudentDaoDAO层用于与数据库交互
@Autowired
private StudentDao studentDao;
/**
*
* @param s_name
* @param s_studentid ID
* @param s_classid ID
* @param s_classname
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
@Override
public PageInfo<Student> findPageInfo(String s_name, Integer s_studentid, Integer s_classid,
String s_classname, Integer pageIndex, Integer pageSize) {
// 创建PageInfo对象用于封装分页信息
PageInfo<Student> pi = new PageInfo<Student>();
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的总记录数
Integer totalCount = studentDao.totalCount(s_name, s_studentid, s_classid, s_classname);
// 如果总记录数大于0进行分页查询
if (totalCount > 0) {
pi.setTotalCount(totalCount); // 设置总记录数
// 根据页码和每页大小计算出查询的起始位置,并获取当前页的学生列表
// currentPage = (pageIndex - 1) * pageSize当前页码减去1乘以每页记录数得到查询的起始位置
List<Student> studentList = studentDao.getStudentList(
s_name, s_studentid, s_classid, s_classname,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()
);
pi.setList(studentList); // 设置当前页的学生列表
}
//分页查询
@Override
public PageInfo<Student> findPageInfo(String s_name, Integer s_studentid,Integer s_classid,
String s_classname, Integer pageIndex, Integer pageSize) {
PageInfo<Student> pi = new PageInfo<Student>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = studentDao.totalCount(s_name,s_studentid,s_classid,s_classname);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示学生信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<Student> studentList = studentDao.getStudentList(s_name,s_studentid,s_classid,s_classname,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(studentList);
}
return pi;
}
return pi; // 返回封装了分页信息的PageInfo对象
}
@Override
public List<Student> getAll(){
List<Student> studentList = studentDao.getAll();
return studentList;
}
/**
*
* @return
*/
@Override
public List<Student> getAll() {
// 调用DAO层的getAll方法获取所有学生信息
List<Student> studentList = studentDao.getAll();
return studentList; // 返回所有学生的列表
}
//通过id删除学生信息
@Override
public int deleteStudent(Integer s_id) {
return studentDao.deleteStudent(s_id);
}
//添加学生信息
@Override
public int addStudent(Student student) {
return studentDao.addStudent(student);
}
//修改学生信息
@Override
public int updateStudent(Student student) { return studentDao.updateStudent(student); }
/**
* ID
* @param s_id ID
* @return 1
*/
@Override
public int deleteStudent(Integer s_id) {
// 调用DAO层的deleteStudent方法删除指定ID的学生记录
return studentDao.deleteStudent(s_id);
}
@Override
public Student findStudentById (Integer s_id){
Student s = studentDao.findStudentById(s_id);
return s;
}
/**
*
* @param student
* @return 1
*/
@Override
public int addStudent(Student student) {
// 调用DAO层的addStudent方法添加新的学生记录
return studentDao.addStudent(student);
}
/**
*
* @param student
* @return 1
*/
@Override
public int updateStudent(Student student) {
// 调用DAO层的updateStudent方法更新指定学生的信息
return studentDao.updateStudent(student);
}
/**
* ID
* @param s_id ID
* @return ID
*/
@Override
public Student findStudentById(Integer s_id) {
// 调用DAO层的findStudentById方法根据学生ID查询学生信息
Student s = studentDao.findStudentById(s_id);
return s; // 返回查询到的学生对象
}
}

@ -1,58 +1,79 @@
package com.itheima.service.impl;
import com.itheima.dao.VisitorDao;
import com.itheima.po.PageInfo;
import com.itheima.po.Visitor;
import com.itheima.service.VisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.VisitorDao; // 导入VisitorDao接口用于数据访问操作
import com.itheima.po.PageInfo; // 导入PageInfo类用于封装分页信息
import com.itheima.po.Visitor; // 导入Visitor类用于表示访客对象
import com.itheima.service.VisitorService; // 导入VisitorService接口该类实现该接口
import org.springframework.beans.factory.annotation.Autowired; // 导入自动注入的注解
import org.springframework.stereotype.Service; // 导入Service注解标识这是一个Service类
import org.springframework.transaction.annotation.Transactional; // 导入事务管理注解
import java.util.List;
import java.util.List; // 导入List类用于存储多个访客对象
/**
* @program: dormitorySystem
* @description: 访
* @author: Joyrocky
* @create: 2019-05-14 12:39
**/
@Service("visitorService")
@Transactional
* 访Service
*/
@Service("visitorService") // 标注该类为一个Spring管理的服务组件名称为visitorService
@Transactional // 启用事务管理,确保该类中的数据库操作要么全部成功,要么全部回滚,保证数据一致性和完整性
public class VisitorServiceImpl implements VisitorService {
// 注入studentDao
// 自动注入VisitorDaoDAO层用于与数据库交互
@Autowired
private VisitorDao visitorDao;
//分页查询
/**
* 访
* @param v_name 访
* @param v_phone 访
* @param pageIndex
* @param pageSize
* @return PageInfo
*/
@Override
public PageInfo<Visitor> findPageInfo(String v_name, Integer v_phone , Integer pageIndex, Integer pageSize) {
public PageInfo<Visitor> findPageInfo(String v_name, Integer v_phone, Integer pageIndex, Integer pageSize) {
// 创建PageInfo对象用于封装分页信息
PageInfo<Visitor> pi = new PageInfo<Visitor>();
pi.setPageIndex(pageIndex);
pi.setPageSize(pageSize);
//获取总条数
Integer totalCount = visitorDao.totalCount(v_name,v_phone);
if (totalCount>0){
pi.setTotalCount(totalCount);
//每一页显示学生信息数
//currentPage = (pageIndex-1)*pageSize 当前页码数减1*最大条数=开始行数
List<Visitor> visitorList = visitorDao.getVisitorList(v_name,v_phone,
(pi.getPageIndex()-1)*pi.getPageSize(),pi.getPageSize());
pi.setList(visitorList);
pi.setPageIndex(pageIndex); // 设置当前页码
pi.setPageSize(pageSize); // 设置每页显示的记录数
// 获取符合条件的总记录数
Integer totalCount = visitorDao.totalCount(v_name, v_phone);
// 如果总记录数大于0进行分页查询
if (totalCount > 0) {
pi.setTotalCount(totalCount); // 设置总记录数
// 根据页码和每页大小计算出查询的起始位置,并获取当前页的访客列表
// currentPage = (pageIndex - 1) * pageSize当前页码减去1乘以每页记录数得到查询的起始位置
List<Visitor> visitorList = visitorDao.getVisitorList(
v_name, v_phone,
(pi.getPageIndex() - 1) * pi.getPageSize(), pi.getPageSize()
);
pi.setList(visitorList); // 设置当前页的访客列表
}
return pi;
return pi; // 返回封装了分页信息的PageInfo对象
}
/**
* 访
* @return 访
*/
@Override
public List<Visitor> getAll(){
public List<Visitor> getAll() {
// 调用DAO层的getAll方法获取所有访客信息
List<Visitor> visitorList = visitorDao.getAll();
return visitorList;
return visitorList; // 返回所有访客的列表
}
//添加学生信息
/**
* 访
* @param visitor 访访
* @return 1
*/
@Override
public int addVisitor(Visitor visitor) {
public int addVisitor(Visitor visitor) {
// 调用DAO层的addVisitor方法添加新的访客记录
return visitorDao.addVisitor(visitor);
}
}

@ -1,65 +1,71 @@
package com.itheima.util;
import java.security.MessageDigest;
import java.security.MessageDigest; // 导入MessageDigest类用于进行MD5加密操作
/**
* @program: Student_dorm_System
* @description: MD5
* @description: MD5
* @author: Joyrocky
* @create: 2019-04-13 13:04
**/
public class MD5Util {
// 将字节数组转换为16进制的字符串
private static String byteArrayToHexString(byte b[]) {
StringBuffer resultSb = new StringBuffer();
for (int i = 0; i < b.length; i++)
resultSb.append(byteToHexString(b[i]));
StringBuffer resultSb = new StringBuffer(); // 用于存储转换后的字符串
for (int i = 0; i < b.length; i++) // 遍历字节数组
resultSb.append(byteToHexString(b[i])); // 将每个字节转换为16进制并添加到结果中
return resultSb.toString();
return resultSb.toString(); // 返回转换后的16进制字符串
}
// 将单个字节转换为16进制的字符串表示
private static String byteToHexString(byte b) {
int n = b;
if (n < 0)
n += 256;
int d1 = n / 16;
int d2 = n % 16;
return hexDigits[d1] + hexDigits[d2];
int n = b; // 将byte类型转换为int类型以便操作
if (n < 0) // 如果字节为负数,则调整为正数
n += 256; // 加256是为了将负值转换为正数
int d1 = n / 16; // 获取16进制的高位十六进制的第一个数字
int d2 = n % 16; // 获取16进制的低位十六进制的第二个数字
return hexDigits[d1] + hexDigits[d2]; // 将高位和低位的16进制字符拼接成字符串返回
}
/**
* MD5
* MD5
*
* @param origin
* @param charsetname
* @return
* @param origin
* @param charsetname UTF-8
* @return MD5
*/
private static String MD5Encode(String origin, String charsetname) {
String resultString = null;
String resultString = null; // 用于存储加密后的结果字符串
try {
resultString = new String(origin);
MessageDigest md = MessageDigest.getInstance("MD5");
if (charsetname == null || "".equals(charsetname))
resultString = byteArrayToHexString(md.digest(resultString.getBytes()));
resultString = new String(origin); // 将原始字符串转换为新的字符串对象
MessageDigest md = MessageDigest.getInstance("MD5"); // 获取MD5加密算法的MessageDigest实例
if (charsetname == null || "".equals(charsetname)) // 如果字符集为空
resultString = byteArrayToHexString(md.digest(resultString.getBytes())); // 使用默认字符集进行加密
else
resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname)));
resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); // 使用指定字符集进行加密
} catch (Exception exception) {
// 异常捕获部分,这里没有处理异常,可以在实际使用时添加日志或者其他处理方式
}
return resultString.toUpperCase();
return resultString.toUpperCase(); // 返回加密后的MD5字符串并转换为大写
}
/**
* MD5使UTF-8
*
* @param origin
* @return MD5
*/
public static String MD5EncodeUtf8(String origin) {
//盐值Salt加密
//origin = origin + PropertiesUtil.getProperty("password.salt", "");
return MD5Encode(origin, "utf-8");
// 盐值Salt加密可以在此处为原始字符串添加盐值增强安全性具体的盐值配置可以在Properties文件中配置
// origin = origin + PropertiesUtil.getProperty("password.salt", "");
return MD5Encode(origin, "utf-8"); // 调用MD5Encode方法使用UTF-8字符集进行加密
}
// 定义16进制的字符数组用于字节到16进制的转换
private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
}

@ -1,52 +1,64 @@
package com.itheima.util;
package com.itheima.util; // 定义该类属于com.itheima.util包
/**
* @program: dormitorySystem
* @description:
* @description:
* @author: Joyrocky
* @create: 2019-04-28 23:10
**/
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils; // 导入Apache Commons Lang库中的StringUtils工具类用于处理字符串
import org.slf4j.Logger; // 导入SLF4J日志库中的Logger类
import org.slf4j.LoggerFactory; // 导入SLF4J日志库中的LoggerFactory类
import java.io.IOException; // 导入IOException用于处理IO异常
import java.io.InputStreamReader; // 导入InputStreamReader用于将字节流转换为字符流
import java.util.Properties; // 导入Properties类用于读取和操作属性文件
public class PropertiesUtil {
private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);
private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class); // 创建一个Logger对象用于记录日志
private static Properties props;
private static Properties props; // 声明一个静态的Properties对象用于存储加载的属性文件内容
// 静态代码块,用于加载配置文件
static {
String fileName = "mmall.properties";
props = new Properties();
String fileName = "mmall.properties"; // 设置要加载的配置文件名称
props = new Properties(); // 实例化Properties对象
try {
props.load(new InputStreamReader(PropertiesUtil.class.getClassLoader().getResourceAsStream(fileName),"UTF-8"));
} catch (IOException e) {
logger.error("配置文件读取异常",e);
// 使用InputStreamReader将配置文件位于类路径下加载到Properties对象中并指定字符集为UTF-8
props.load(new InputStreamReader(PropertiesUtil.class.getClassLoader().getResourceAsStream(fileName), "UTF-8"));
} catch (IOException e) { // 捕获IO异常
logger.error("配置文件读取异常", e); // 记录读取配置文件异常的日志
}
}
/**
*
*
* @param key
* @return null
*/
public static String getProperty(String key){
String value = props.getProperty(key.trim());
if(StringUtils.isBlank(value)){
return null;
String value = props.getProperty(key.trim()); // 获取配置文件中指定键对应的值,去除键值的前后空格
if(StringUtils.isBlank(value)){ // 判断获取到的值是否为空或仅包含空白字符
return null; // 如果为空则返回null
}
return value.trim();
return value.trim(); // 如果值不为空,则去除值的前后空格并返回
}
public static String getProperty(String key,String defaultValue){
String value = props.getProperty(key.trim());
if(StringUtils.isBlank(value)){
value = defaultValue;
/**
*
*
* @param key
* @param defaultValue
* @return
*/
public static String getProperty(String key, String defaultValue){
String value = props.getProperty(key.trim()); // 获取配置文件中指定键对应的值,去除键值的前后空格
if(StringUtils.isBlank(value)){ // 判断获取到的值是否为空或仅包含空白字符
value = defaultValue; // 如果值为空,则使用默认值
}
return value.trim();
return value.trim(); // 返回最终的值,去除前后空格
}
}

@ -1,9 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 定义 XML 文件的版本和编码格式,这里指定使用 UTF-8 编码。 -->
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<!-- 声明这个配置文件遵循 MyBatis 的 DTD (Document Type Definition),用于验证 XML 文件的结构和规则。 -->
<configuration>
<!-- 配置文件的根元素,所有的 MyBatis 配置信息都包含在这里面。 -->
<!-- 别名定义 -->
<typeAliases>
<package name="com.itheima.po" />
</typeAliases>
</configuration>
<typeAliases>
<!-- typeAliases 元素用于定义 Java 类型的别名,方便在 MyBatis 的映射文件中使用简短的类名。 -->
<package name="com.itheima.po" />
<!-- 指定一个 Java 包,用来扫描该包下的所有 POJO 类,并为每个类自动生成别名。 -->
<!-- 例如,如果包中有一个类 `User`,那么 MyBatis 会自动为它生成别名 `User`,可以在映射文件中直接使用 `User` 作为类型。 -->
</typeAliases>
</configuration>
<!-- 结束配置文件的根元素 -->

@ -1,31 +1,58 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<!--
声明当前文件使用 Spring 框架的 XML 配置格式,并指定各个 XML 命名空间xmlns以及对应的 XSD 文件xsi:schemaLocation。这些配置决定了文件的验证规则和使用的功能。
- `xmlns` 定义了 XML 文件的命名空间Spring 通过命名空间来识别不同的配置模块。
- `xsi:schemaLocation` 定义了每个命名空间对应的 XSD 文件地址,用于验证配置文件的结构。
-->
<!-- 配置包扫描器,扫描@Controller注解的类 -->
<context:component-scan base-package="com.itheima.controller" />
<context:component-scan base-package="com.itheima.controller" />
<!--
<context:component-scan> 元素用于配置 Spring 扫描指定包及其子包中的类,自动识别并注册为 Spring 容器中的 Bean。
这里指定扫描 `com.itheima.controller` 包下的类Spring 会自动扫描并注册标注了 `@Controller` 注解的类,便于实现控制器功能。
-->
<!-- 加载注解驱动 -->
<mvc:annotation-driven />
<mvc:annotation-driven />
<!--
<mvc:annotation-driven> 配置启用 Spring MVC 的注解驱动功能。
该配置启用之后Spring MVC 会支持如 `@Controller`、`@RequestMapping`、`@ResponseBody` 等注解功能。
-->
<!--配置静态资源的访问映射,此配置中的文件,将不被前端控制器拦截 -->
<mvc:resources location="/js/" mapping="/js/**"/>
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="/fonts/" mapping="/fonts/**"/>
<mvc:resources location="/images/" mapping="/images/**"/>
<mvc:resources location="/lib/" mapping="/lib/**"/>
<mvc:resources location="/layui_exts/" mapping="/layui_exts/**"/>
<!-- 配置静态资源的访问映射,此配置中的文件,将不被前端控制器拦截 -->
<mvc:resources location="/js/" mapping="/js/**"/>
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="/fonts/" mapping="/fonts/**"/>
<mvc:resources location="/images/" mapping="/images/**"/>
<mvc:resources location="/lib/" mapping="/lib/**"/>
<mvc:resources location="/layui_exts/" mapping="/layui_exts/**"/>
<!--
<mvc:resources> 元素用于配置静态资源(如 JavaScript、CSS、图片等的访问路径映射。
这些静态资源不会经过 Spring MVC 的前端控制器拦截,直接通过对应的 URL 路径进行访问。
每个 `<mvc:resources>` 配置指定一个静态资源的根路径(`location`),和相应的 URL 映射(`mapping`)。
例如:`/js/**` 映射到 `/js/` 目录下的所有文件。
-->
<!-- 配置视图解析器 -->
<bean class=
"org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<!--
<bean> 元素定义了一个 Spring Bean这里配置了 `InternalResourceViewResolver`,该类用于解析视图名称并找到相应的 JSP 文件。
- `prefix` 配置了 JSP 文件的前缀路径(即 JSP 文件所在的目录),这里是 `/WEB-INF/jsp/`,表示所有 JSP 文件都放在该目录下。
- `suffix` 配置了 JSP 文件的后缀,这里设置为 `.jsp`,表示视图名称解析后会拼接成 JSP 文件路径。
-->
</beans>
<!-- 结束 Spring 配置文件 -->

@ -1,16 +1,36 @@
/* 定义字体图标的字体文件 */
@font-face {
/* 定义字体家族名称为 'iconfont' */
font-family: 'iconfont';
/* 指定字体文件路径,使用 eot 格式IE6-IE8 支持) */
src: url('../fonts/iconfont.eot');
src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/iconfont.woff') format('woff'),
url('../fonts/iconfont.ttf') format('truetype'),
url('../fonts/iconfont.svg#iconfont') format('svg');
/* eotwofftruetype svg
*/
src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE Fix for eot 文件 */
url('../fonts/iconfont.woff') format('woff'), /* WOFF 格式,用于大多数现代浏览器 */
url('../fonts/iconfont.ttf') format('truetype'), /* TTF 格式,用于某些旧版浏览器 */
url('../fonts/iconfont.svg#iconfont') format('svg'); /* SVG 格式,用于移动设备和一些现代浏览器 */
}
/* 配置图标字体的样式 */
.iconfont{
font-family:"iconfont" !important;
font-size:16px;font-style:normal;
/* 设置字体家族为 'iconfont',确保所有使用该类的元素应用自定义图标字体 */
font-family: "iconfont" !important;
/* 设置字体大小为 16px可以根据需求调整大小 */
font-size: 16px;
/* 设置字体样式为正常,确保图标显示清晰 */
font-style: normal;
/* 启用 Webkit 浏览器的字体平滑效果,使得字体显示更加柔和 */
-webkit-font-smoothing: antialiased;
/* 设置文本描边宽度,防止在某些浏览器中显示模糊的图标 */
-webkit-text-stroke-width: 0.2px;
/* 启用 Firefox OS X 上的字体平滑效果,使字体更加清晰 */
-moz-osx-font-smoothing: grayscale;
}

@ -1,66 +1,466 @@
@charset "utf-8";
/* CSS Document */
*{font-size:9pt;border:0;margin:0;padding:0;}
body{font-family:'微软雅黑'; margin:0 auto;min-width:980px;}
ul{display:block;margin:0;padding:0;list-style:none;}
li{display:block;margin:0;padding:0;list-style: none;}
img{border:0;}
dl,dt,dd,span{margin:0;padding:0;display:block;}
a,a:focus{text-decoration:none;color:#000;outline:none;blr:expression(this.onFocus=this.blur());}
a:hover{color:#00a4ac;text-decoration:none;}
table{border-collapse:collapse;border-spacing: 0;}
cite{font-style:normal;}
h2{font-weight:normal;}
/*cloud*/
#mainBody {width:100%;height:100%;position:absolute;z-index:-1;}
.cloud {position:absolute;top:0px;left:0px;width:100%;height:100%;background:url(../images/cloud.png) no-repeat;z-index:1;opacity:0.5;}
#cloud2 {z-index:2;}
/*login*/
.logintop{height:47px; position:absolute; top:0; background:url(../images/loginbg1.png) repeat-x;z-index:100; width:100%;}
.logintop span{color:#fff; line-height:47px; background:url(../images/loginsj.png) no-repeat 21px 18px; text-indent:44px; color:#afc5d2; float:left;}
.logintop ul{float:right; padding-right:30px;}
.logintop ul li{float:left; margin-left:20px; line-height:47px;}
.logintop ul li a{color:#afc5d2;}
.logintop ul li a:hover{color:#fff;}
.loginbody{background:url(../images/loginbg3.png) no-repeat center center; width:100%; height:585px; overflow:hidden; position:absolute; top:47px;}
.systemlogo{background:url(../images/loginlogo.png) no-repeat center;width:100%; height:71px; margin-top:75px;}
.loginbox{width:692px; height:336px; background:url(../images/logininfo.png) no-repeat; margin-top:30px;}
.loginbox ul{margin-top:88px; margin-left:285px;}
.loginbox ul li{margin-bottom:25px;}
.loginbox ul li label{color:#687f92; padding-left:25px;}
.loginbox ul li label a{color:#687f92;}
.loginbox ul li label a:hover{color:#3d96c9;}
.loginbox ul li label input{margin-right:5px;}
.loginbox,.loginbox1,.loginbox2,.loginbox3,.loginbox4{width:692px; height:373px;margin-top:30px;}
.loginuser{width:299px; height:48px; background:url(../images/loginuser.png) no-repeat; border:none; line-height:48px; padding-left:44px; font-size:14px; font-weight:bold;}
.loginpwd{width:299px; height:48px; background:url(../images/loginpassword.png) no-repeat; border:none;line-height:48px; padding-left:44px; font-size:14px; color:#90a2bc;}
.loginbtn{width:111px;height:35px; background:url(../images/buttonbg.png) repeat-x; font-size:14px; font-weight:bold; color:#fff;cursor:pointer; line-height:35px;}
.loginbm{height:50px; line-height:50px; text-align:center; background:url(../images/loginbg2.png) repeat-x;position:absolute; bottom:0; width:100%; color:#0b3a58;}
.loginbm a{font-weight:bold;color:#0b3a58;}
.loginbm a:hover{color:#fff;}
.loginbox1{background:url(../images/logininfo1.png) no-repeat;}
.loginbox1 ul li{margin-bottom:16px;}
.loginbox2{background:url(../images/logininfo2.png) no-repeat;}
.loginbox2 ul li{margin-bottom:16px;}
.loginbox3{background:url(../images/logininfo3.png) no-repeat;}
.loginbox3 ul li{margin-bottom:16px;}
.yzm{width:341px; height:46px; background:url(../images/yzmbg.png) no-repeat; padding-bottom:5px;}
.yzm span{display:block; float:left;width:227px; height:46px;}
.yzm span input{background:none; border:none; width:183px; height:46px; line-height:46px;padding-left:44px;font-size:14px; color:#cee4f1;}
.yzm cite{float:right; width:114px; height:46px; line-height:46px; font-size:18px; color:#fff; text-align:center;}
.loginbody1{background:url(../images/loginbg4.png) no-repeat center center; width:100%; height:585px; overflow:hidden; position:absolute; top:47px;}
.systemlogo{width:100%; height:71px; margin-top:120px; text-align:center;}
.loginbox0{width:810px;margin-top:0px;height:252px;}
.loginlist{width:810px; overflow:hidden;}
.loginlist{margin-top:110px;}
.loginlist li{float:left; margin-left:3px; margin-right:3px;}
.loginlist li a{ display:block;width:196px; height:252px; background:url(../images/lbg.png) no-repeat; text-align:center; padding-top:25px; cursor:pointer;}
.loginlist li a:hover{background:url(../images/lbg1.png) no-repeat;}
.loginlist li a p{font-size:16px; color:#fff; padding-top:10px;}
@charset "utf-8"; /* 指定字符编码为 UTF-8 */
/* 通用样式 */
* {
font-size: 9pt; /* 设置所有元素的字体大小为9pt */
border: 0; /* 去掉所有元素的边框 */
margin: 0; /* 去掉所有元素的外边距 */
padding: 0; /* 去掉所有元素的内边距 */
}
body {
font-family: '微软雅黑'; /* 设置body的字体为微软雅黑 */
margin: 0 auto; /* 将body的外边距设置为自动从而实现水平居中 */
min-width: 980px; /* 设置body的最小宽度为980px */
}
ul {
display: block; /* 将ul设置为块级元素 */
margin: 0; /* 去掉ul的外边距 */
padding: 0; /* 去掉ul的内边距 */
list-style: none; /* 去掉ul的默认列表样式无点的列表 */
}
li {
display: block; /* 将li设置为块级元素 */
margin: 0; /* 去掉li的外边距 */
padding: 0; /* 去掉li的内边距 */
list-style: none; /* 去掉li的默认列表样式 */
}
img {
border: 0; /* 去掉图片的边框 */
}
dl, dt, dd, span {
margin: 0; /* 去掉dl, dt, dd, span的外边距 */
padding: 0; /* 去掉dl, dt, dd, span的内边距 */
display: block; /* 将这些元素设置为块级元素 */
}
a, a:focus {
text-decoration: none; /* 去掉链接的下划线 */
color: #000; /* 设置链接的文字颜色为黑色 */
outline: none; /* 去掉链接的聚焦时轮廓 */
blr: expression(this.onFocus=this.blur()); /* 兼容IE去掉聚焦时的蓝色框已废弃建议不再使用 */
}
a:hover {
color: #00a4ac; /* 设置鼠标悬停时,链接的文字颜色为 #00a4ac浅蓝色 */
text-decoration: none; /* 鼠标悬停时去掉链接的下划线 */
}
table {
border-collapse: collapse; /* 设置表格的边框合并为一个单一的边框 */
border-spacing: 0; /* 去掉表格单元格之间的间距 */
}
cite {
font-style: normal; /* 取消cite标签的斜体样式 */
}
h2 {
font-weight: normal; /* 设置h2标题的字体粗细为正常 */
}
/* 背景云朵部分样式 */
#mainBody {
width: 100%; /* 设置#mainBody的宽度为100% */
height: 100%; /* 设置#mainBody的高度为100% */
position: absolute; /* 设置#mainBody为绝对定位 */
z-index: -1; /* 设置#mainBody的z-index为-1确保它在页面其他内容的下面 */
}
.cloud {
position: absolute; /* 设置.cloud为绝对定位 */
top: 0px; /* 设置.cloud的顶部距离为0 */
left: 0px; /* 设置.cloud的左侧距离为0 */
width: 100%; /* 设置.cloud的宽度为100% */
height: 100%; /* 设置.cloud的高度为100% */
background: url(../images/cloud.png) no-repeat; /* 设置背景图为云朵图片,不重复显示 */
z-index: 1; /* 设置.cloud的z-index为1确保它在#mainBody之上 */
opacity: 0.5; /* 设置.cloud的透明度为0.5 */
}
#cloud2 {
z-index: 2; /* 设置#cloud2的z-index为2确保它在.cloud元素之上 */
}
/* 顶部登录栏 */
.logintop {
height: 47px; /* 设置顶部条的高度为47px */
position: absolute; /* 使用绝对定位 */
top: 0; /* 距离顶部为0固定在页面顶端 */
background: url(../images/loginbg1.png) repeat-x; /* 背景图片,横向平铺 */
z-index: 100; /* 层级较高,确保其位于其他内容上面 */
width: 100%; /* 宽度为100%,覆盖整个页面宽度 */
}
/* 登录栏中的文字样式 */
.logintop span {
color: #fff; /* 文字颜色为白色 */
line-height: 47px; /* 行高为47px使文字垂直居中 */
background: url(../images/loginsj.png) no-repeat 21px 18px; /* 设置背景图片,调整位置 */
text-indent: 44px; /* 文字缩进,避免文字与图片重叠 */
color: #afc5d2; /* 文字颜色 */
float: left; /* 向左浮动 */
}
/* 登录栏右侧的导航链接样式 */
.logintop ul {
float: right; /* 向右浮动 */
padding-right: 30px; /* 右侧内边距 */
}
/* 导航链接列表项的样式 */
.logintop ul li {
float: left; /* 向左浮动 */
margin-left: 20px; /* 左侧间距 */
line-height: 47px; /* 行高为47px确保与顶部对齐 */
}
/* 导航链接的样式 */
.logintop ul li a {
color: #afc5d2; /* 设置链接文字颜色 */
}
/* 导航链接鼠标悬停时的样式 */
.logintop ul li a:hover {
color: #fff; /* 悬停时文字颜色变为白色 */
}
/* 登录页面主体样式 */
.loginbody {
background: url(../images/loginbg3.png) no-repeat center center; /* 设置背景图片,并且居中显示 */
width: 100%; /* 宽度为100% */
height: 585px; /* 高度为585px */
overflow: hidden; /* 隐藏超出的内容 */
position: absolute; /* 使用绝对定位 */
top: 47px; /* 距离顶部47px避免与顶部导航栏重叠 */
}
/* 系统logo的样式 */
.systemlogo {
background: url(../images/loginlogo.png) no-repeat center; /* 设置logo背景居中显示 */
width: 100%; /* 宽度为100% */
height: 71px; /* 高度为71px */
margin-top: 75px; /* 上边距为75px调整位置 */
}
/* 登录框的基本样式 */
.loginbox {
width: 692px; /* 宽度为692px */
height: 336px; /* 高度为336px */
background: url(../images/logininfo.png) no-repeat; /* 设置背景图片 */
margin-top: 30px; /* 上边距为30px */
}
/* 登录框内表单内容的样式 */
.loginbox ul {
margin-top: 88px; /* 上边距为88px */
margin-left: 285px; /* 左边距为285px */
}
/* 表单项的样式 */
.loginbox ul li {
margin-bottom: 25px; /* 每个表单项之间的底部间距 */
}
/* 表单项标签的样式 */
.loginbox ul li label {
color: #687f92; /* 标签文字颜色 */
padding-left: 25px; /* 左内边距25px */
}
/* 标签链接的样式 */
.loginbox ul li label a {
color: #687f92; /* 设置链接文字颜色 */
}
/* 标签链接的悬停样式 */
.loginbox ul li label a:hover {
color: #3d96c9; /* 悬停时文字颜色变为蓝色 */
}
/* 输入框的样式 */
.loginbox ul li label input {
margin-right: 5px; /* 输入框右侧的间距 */
}
/* 其他登录框的样式(不同背景图片) */
.loginbox,.loginbox1,.loginbox2,.loginbox3,.loginbox4 {
width: 692px; /* 宽度为692px */
height: 373px; /* 高度为373px */
margin-top: 30px; /* 上边距为30px */
}
/* 用户名输入框的样式 */
.loginuser {
width: 299px; /* 宽度为299px */
height: 48px; /* 高度为48px */
background: url(../images/loginuser.png) no-repeat; /* 背景图 */
border: none; /* 无边框 */
line-height: 48px; /* 行高与高度相同,保证文字垂直居中 */
padding-left: 44px; /* 左内边距44px */
font-size: 14px; /* 字体大小为14px */
font-weight: bold; /* 字体加粗 */
}
/* 密码输入框的样式 */
.loginpwd {
width: 299px; /* 宽度为299px */
height: 48px; /* 高度为48px */
background: url(../images/loginpassword.png) no-repeat; /* 背景图 */
border: none; /* 无边框 */
line-height: 48px; /* 行高与高度相同,保证文字垂直居中 */
padding-left: 44px; /* 左内边距44px */
font-size: 14px; /* 字体大小为14px */
color: #90a2bc; /* 字体颜色 */
}
/* 登录按钮的样式 */
.loginbtn {
width: 111px; /* 宽度为111px */
height: 35px; /* 高度为35px */
background: url(../images/buttonbg.png) repeat-x; /* 按钮背景图横向平铺 */
font-size: 14px; /* 字体大小为14px */
font-weight: bold; /* 字体加粗 */
color: #fff; /* 字体颜色为白色 */
cursor: pointer; /* 鼠标指针变为点击状态 */
line-height: 35px; /* 行高与高度相同,确保文字垂直居中 */
}
/* 底部版权栏的样式 */
.loginbm {
height: 50px; /* 高度为50px */
line-height: 50px; /* 行高为50px确保文字垂直居中 */
text-align: center; /* 文本居中对齐 */
background: url(../images/loginbg2.png) repeat-x; /* 底部背景图横向平铺 */
position: absolute; /* 使用绝对定位 */
bottom: 0; /* 固定在底部 */
width: 100%; /* 宽度为100% */
color: #0b3a58; /* 文字颜色 */
}
/* 底部链接的样式 */
.loginbm a {
font-weight: bold; /* 字体加粗 */
color: #0b3a58; /* 链接颜色 */
}
/* 底部链接的悬停样式 */
.loginbm a:hover {
color: #fff; /* 悬停时链接颜色变为白色 */
}
/* 其他登录框(不同背景) */
.loginbox1 {
background: url(../images/logininfo1.png) no-repeat; /* 背景图 */
}
.loginbox1 ul li {
margin-bottom: 16px; /* 每个表单项之间的底部间距 */
}
.loginbox2 {
background: url(../images/logininfo2.png) no-repeat; /* 背景图 */
}
.loginbox2 ul li {
margin-bottom: 16px; /* 每个表单项之间的底部间距 */
}
.loginbox3 {
background: url(../images/logininfo3.png) no-repeat; /* 背景图 */
}
.loginbox3 ul li {
margin-bottom: 16px; /* 每个表单项之间的底部间距 */
}
/* 验证码输入框的样式 */
.yzm {
width: 341px; /* 宽度为341px */
height: 46px; /* 高度为46px */
background: url(../images/yzmbg.png) no-repeat; /* 背景图 */
padding-bottom: 5px; /* 底部内边距5px */
}
/* 验证码输入框的文本框样式 */
.yzm span {
display: block; /* 块级元素 */
float: left; /* 向左浮动 */
width: 227px; /* 宽度为227px */
height: 46px; /* 高度为46px */
}
/* 验证码输入框的文本框输入样式 */
.yzm span input {
background: none; /* 背景为透明 */
border: none; /* 无边框 */
width: 227px; /* 宽度为227px */
height: 46px; /* 高度为46px */
line-height: 46px; /* 行高与高度相同,确保文字垂直居中 */
font-size: 16px; /* 字体大小为16px */
color: #afc5d2; /* 文字颜色 */
padding-left: 10px; /* 左内边距10px */
}
/* 验证码图像的样式 */
.yzm img {
float: left; /* 图像向左浮动 */
margin-left: 10px; /* 左侧间距10px */
width: 85px; /* 图像宽度为85px */
height: 46px; /* 图像高度为46px */
}
/* 验证码刷新按钮的样式 */
.yzm a {
display: block; /* 设置为块级元素 */
width: 85px; /* 宽度为85px */
height: 46px; /* 高度为46px */
background: url(../images/yzmrefresh.png) no-repeat center; /* 背景图居中 */
cursor: pointer; /* 鼠标指针变为点击状态 */
}
/* 提交按钮的样式 */
.submitbtn {
width: 300px; /* 宽度为300px */
height: 40px; /* 高度为40px */
background: #3d96c9; /* 背景色为蓝色 */
color: #fff; /* 文字颜色为白色 */
font-size: 16px; /* 字体大小为16px */
font-weight: bold; /* 字体加粗 */
text-align: center; /* 文字居中对齐 */
line-height: 40px; /* 行高为40px确保文字垂直居中 */
border: none; /* 无边框 */
cursor: pointer; /* 鼠标指针变为点击状态 */
}
/* 提交按钮的悬停效果 */
.submitbtn:hover {
background: #2a7da6; /* 悬停时背景色变为更深的蓝色 */
}
/* 错误提示消息的样式 */
.error-msg {
color: #e74c3c; /* 错误信息颜色为红色 */
font-size: 14px; /* 字体大小为14px */
margin-top: 10px; /* 上边距为10px */
text-align: center; /* 文本居中对齐 */
}
/* 成功提示消息的样式 */
.success-msg {
color: #2ecc71; /* 成功信息颜色为绿色 */
font-size: 14px; /* 字体大小为14px */
margin-top: 10px; /* 上边距为10px */
text-align: center; /* 文本居中对齐 */
}
/* 错误信息框的样式 */
.error-box {
background: url(../images/errorbox.png) no-repeat; /* 背景为错误框的图像 */
width: 350px; /* 宽度为350px */
height: 120px; /* 高度为120px */
margin: 20px auto; /* 上下边距为20px水平居中 */
padding: 15px; /* 内边距为15px */
color: #fff; /* 文字颜色为白色 */
font-size: 14px; /* 字体大小为14px */
}
/* 错误框内的关闭按钮样式 */
.error-box .close-btn {
float: right; /* 右浮动 */
background: url(../images/close.png) no-repeat center; /* 关闭按钮的背景图 */
width: 20px; /* 宽度为20px */
height: 20px; /* 高度为20px */
cursor: pointer; /* 鼠标指针变为点击状态 */
}
/* 错误框内的错误信息样式 */
.error-box .error-info {
margin-top: 10px; /* 上边距为10px */
font-size: 16px; /* 字体大小为16px */
color: #ff0000; /* 错误信息为红色 */
}
/* 成功框的样式 */
.success-box {
background: url(../images/successbox.png) no-repeat; /* 背景为成功框的图像 */
width: 350px; /* 宽度为350px */
height: 120px; /* 高度为120px */
margin: 20px auto; /* 上下边距为20px水平居中 */
padding: 15px; /* 内边距为15px */
color: #fff; /* 文字颜色为白色 */
font-size: 14px; /* 字体大小为14px */
}
/* 成功框内的成功信息样式 */
.success-box .success-info {
margin-top: 10px; /* 上边距为10px */
font-size: 16px; /* 字体大小为16px */
color: #2ecc71; /* 成功信息为绿色 */
}
/* 取消按钮的样式 */
.cancel-btn {
width: 300px; /* 宽度为300px */
height: 40px; /* 高度为40px */
background: #e74c3c; /* 背景色为红色 */
color: #fff; /* 文字颜色为白色 */
font-size: 16px; /* 字体大小为16px */
font-weight: bold; /* 字体加粗 */
text-align: center; /* 文字居中对齐 */
line-height: 40px; /* 行高为40px确保文字垂直居中 */
border: none; /* 无边框 */
cursor: pointer; /* 鼠标指针变为点击状态 */
}
/* 取消按钮的悬停效果 */
.cancel-btn:hover {
background: #c0392b; /* 悬停时背景色变为更深的红色 */
}
/* 隐藏的表单项 */
.hidden {
display: none; /* 隐藏该元素 */
}
/* 表单项的标签样式 */
label {
font-size: 14px; /* 字体大小为14px */
color: #687f92; /* 标签文字颜色 */
}
/* 链接的样式 */
a {
text-decoration: none; /* 去掉链接下划线 */
color: #3d96c9; /* 链接颜色 */
}
/* 链接悬停时的样式 */
a:hover {
color: #2a7da6; /* 悬停时链接颜色变为深蓝色 */
}
/* 警告框的样式 */
.alert-box {
background: #f39c12; /* 背景色为橙色 */
color: #fff; /* 文字颜色为白色 */
font-size: 14px; /* 字体大小为14px */
padding: 15px; /* 内边距为15px */
margin: 20px 0; /* 上下边距为20px */
border-radius: 5px; /* 圆角边框 */
}
/* 提示框的样式 */
.tip-box {
background: #f1c40f; /* 背景色为黄色 */
color: #fff; /* 文字颜色为白色 */
font-size: 14px; /* 字体大小为14px */
padding: 15px; /* 内边距为15px */
margin: 20px 0; /* 上下边距为20px */
border-radius: 5px; /* 圆角边框 */
}

@ -1,54 +1,72 @@
/*分页按钮样式*/
.page-go-form{
float: right;
margin-right: 40px;
width: 200px;
}
.page-bar{
width: 600px;
height: 30px;
float: right;
}
.page-num-ul{
width: 250px;
height: 30px;
padding-left: 100px;
float: left;
font-size: 14px;
}
.pg_a{
margin: 0 5px;
}
.pg_a:hover{
color: #00a4ac;
margin: 0 5px;
}
#inputPage{
width: 50px;
}
.page-btn{
margin: 0 3px;
width: 50px;
cursor: pointer;
color: #ffffff;
background-color: #009688;
}
.page-btn:hover{
opacity: 0.7;
cursor: pointer;
background-color: #009688;
}
#f_auto{
margin: 0 auto;
margin-top: 40px;
width: 400px;
}
#btn_on{
width: 260px;
margin-left: 45px;
}
.f_sp{
letter-spacing: 16px;
/* 分页按钮容器的样式 */
.page-go-form {
float: right; /* 右浮动,使容器靠右显示 */
margin-right: 40px; /* 右边距为40px */
width: 200px; /* 宽度为200px */
}
/* 分页栏的容器样式 */
.page-bar {
width: 600px; /* 宽度为600px */
height: 30px; /* 高度为30px */
float: right; /* 右浮动,使分页栏靠右显示 */
}
/* 分页数字的容器样式 */
.page-num-ul {
width: 250px; /* 宽度为250px */
height: 30px; /* 高度为30px */
padding-left: 100px; /* 左边距为100px用于调整位置 */
float: left; /* 左浮动,使其在分页栏中靠左显示 */
font-size: 14px; /* 字体大小为14px */
}
/* 分页链接(数字)的样式 */
.pg_a {
margin: 0 5px; /* 设置左右边距为5px避免元素之间重叠 */
}
/* 分页链接(数字)鼠标悬停时的样式 */
.pg_a:hover {
color: #00a4ac; /* 鼠标悬停时,文字颜色变为蓝绿色 */
margin: 0 5px; /* 鼠标悬停时保持左右边距为5px */
}
/* 输入框的样式,用于直接输入页码 */
#inputPage {
width: 50px; /* 宽度为50px */
}
/* 分页按钮的样式 */
.page-btn {
margin: 0 3px; /* 左右边距为3px避免按钮之间太紧 */
width: 50px; /* 宽度为50px */
cursor: pointer; /* 鼠标指针变为点击状态 */
color: #ffffff; /* 文字颜色为白色 */
background-color: #009688; /* 背景颜色为深青色 */
}
/* 分页按钮鼠标悬停时的样式 */
.page-btn:hover {
opacity: 0.7; /* 鼠标悬停时按钮的透明度降低至0.7 */
cursor: pointer; /* 鼠标指针变为点击状态 */
background-color: #009688; /* 背景颜色保持不变 */
}
/* 自动分页按钮的容器样式 */
#f_auto {
margin: 0 auto; /* 水平居中 */
margin-top: 40px; /* 上边距为40px */
width: 400px; /* 宽度为400px */
}
/* "立即跳转"按钮的样式 */
#btn_on {
width: 260px; /* 宽度为260px */
margin-left: 45px; /* 左边距为45px */
}
/* 设置特定文本的字母间距 */
.f_sp {
letter-spacing: 16px; /* 设置字母间距为16px */
}

@ -1,118 +1,136 @@
/* 全局样式:去除所有元素的外边距和内边距 */
*{
margin: 0;
padding: 0;
margin: 0; /* 去除外边距 */
padding: 0; /* 去除内边距 */
}
/* .header样式设置页头背景图、宽度和高度 */
.header{
background: url("../images/bti.jpg")no-repeat;
width: 100%;
height: 200px;
background: url("../images/bti.jpg") no-repeat; /* 背景图,且不重复 */
width: 100%; /* 宽度为100% */
height: 200px; /* 高度为200px */
}
/* .body样式设置页面主体背景图宽度、高度和上边距 */
.body{
background: url("../images/timg-1.jpg");
width: 100%;
height: 650px;
margin-top: -100px;
background: url("../images/timg-1.jpg"); /* 背景图 */
width: 100%; /* 宽度为100% */
height: 650px; /* 高度为650px */
margin-top: -100px; /* 设置上边距为负值向上偏移100px */
}
/* .panel样式设置面板的宽度、高度、位置、背景和边框 */
.panel{
width: 350px;
height: 420px;
position: relative;
left: 800px;
top: 60px;
background-color: #FFFFFF;
border: 1px solid #dff0d8;
width: 350px; /* 宽度为350px */
height: 420px; /* 高度为420px */
position: relative; /* 相对定位,用于后续定位子元素 */
left: 800px; /* 左边距为800px将面板向右移动 */
top: 60px; /* 上边距为60px将面板向下移动 */
background-color: #FFFFFF; /* 背景色为白色 */
border: 1px solid #dff0d8; /* 边框为1px实线颜色为淡绿色 */
}
/* .top样式设置面板顶部部分的高度和边框 */
.top{
height:60px;
border-bottom:1px solid #dff0d8;
height: 60px; /* 高度为60px */
border-bottom: 1px solid #dff0d8; /* 底部边框为1px实线颜色为淡绿色 */
}
/* .top p样式设置标题文本的对齐方式、字体大小、颜色和内边距 */
.top>p{
text-align: center;
padding-top: 15px;
/*margin: 20px 0;*/
font-size: 25px;
color: #f57421;
text-align: center; /* 文本居中对齐 */
padding-top: 15px; /* 顶部内边距为15px */
/*margin: 20px 0;*/ /* 注释掉的代码,可能用于调整上下边距 */
font-size: 25px; /* 字体大小为25px */
color: #f57421; /* 字体颜色为橙色 */
}
/* .middle样式设置面板中间部分的高度、边距和底部边框 */
.middle{
position: relative;
height: 290px;
margin: 10px 0;
/*background-color: red;*/
border-bottom:1px solid #dff0d8;
position: relative; /* 相对定位,用于定位子元素 */
height: 290px; /* 高度为290px */
margin: 10px 0; /* 上下边距为10px */
/*background-color: red;*/ /* 注释掉的代码,可能用于调试背景色 */
border-bottom: 1px solid #dff0d8; /* 底部边框为1px实线颜色为淡绿色 */
}
/* .middle > form > input样式设置输入框的高度、宽度、边距和边框 */
.middle>form>input{
height: 40px;
width: 290px;
margin: 20px 30px;
border: 1px solid #e0e0e0;
height: 40px; /* 高度为40px */
width: 290px; /* 宽度为290px */
margin: 20px 30px; /* 上下边距为20px左右边距为30px */
border: 1px solid #e0e0e0; /* 边框为1px实线颜色为浅灰色 */
}
/* .middle > form > input:last-child样式设置最后一个输入框的背景色、字体大小和字体颜色 */
.middle>form>input:last-child{
background-color: #f57421;
font-size: 18px;
color: #FFFFFF;
background-color: #f57421; /* 背景色为橙色 */
font-size: 18px; /* 字体大小为18px */
color: #FFFFFF; /* 字体颜色为白色 */
}
/* .middle > form > input:last-child:hover样式设置最后一个输入框鼠标悬停时的效果 */
.middle>form>input:last-child:hover{
background-color: #f57421;
opacity: 0.7;
cursor: pointer;
font-size: 18px;
background-color: #f57421; /* 背景色保持为橙色 */
opacity: 0.7; /* 透明度为0.7 */
cursor: pointer; /* 鼠标指针变为手型 */
font-size: 18px; /* 字体大小保持为18px */
}
/* .middle > form > .s1样式设置第一个图标的大小、位置和背景图 */
.middle>form>.s1{
height: 40px;
width: 40px;
position: absolute;
left: 35px;
top: 40px;
background: url("../images/J1.PNG") no-repeat;
height: 40px; /* 高度为40px */
width: 40px; /* 宽度为40px */
position: absolute; /* 绝对定位 */
left: 35px; /* 距离左侧35px */
top: 40px; /* 距离顶部40px */
background: url("../images/J1.PNG") no-repeat; /* 背景图 */
}
/* .middle > form > .s2样式设置第二个图标的大小、位置和背景图 */
.middle>form>.s2{
height: 40px;
width: 40px;
position: absolute;
left: 35px;
top: 120px;
background: url("../images/J2.PNG") no-repeat;
height: 40px; /* 高度为40px */
width: 40px; /* 宽度为40px */
position: absolute; /* 绝对定位 */
left: 35px; /* 距离左侧35px */
top: 120px; /* 距离顶部120px */
background: url("../images/J2.PNG") no-repeat; /* 背景图 */
}
/* .middle > form > .erro样式设置错误提示文本的颜色、字体大小和左边距 */
.middle>form>.erro{
color: red;
font-size: 14px;
margin-left:10px;
color: red; /* 文本颜色为红色 */
font-size: 14px; /* 字体大小为14px */
margin-left: 10px; /* 左边距为10px */
}
/* .tail > a样式设置尾部链接的浮动、字体大小、内边距和颜色 */
.tail>a{
float: right;
font-size: 12px;
padding: 10px;
text-decoration:none;
color: black;
float: right; /* 右浮动,使链接靠右显示 */
font-size: 12px; /* 字体大小为12px */
padding: 10px; /* 内边距为10px */
text-decoration: none; /* 去除文本装饰 */
color: black; /* 字体颜色为黑色 */
}
/* .tail > a:hover样式设置链接鼠标悬停时的颜色变化 */
.tail>a:hover{
color: red;
color: red; /* 鼠标悬停时,字体颜色变为红色 */
}
/* .middle > form > .iputs:hover样式设置输入框悬停时的边框颜色变化 */
.middle>form>.iputs:hover{
border:1px solid red;
border: 1px solid red; /* 鼠标悬停时,输入框边框颜色变为红色 */
}
/* .footer样式设置页脚的上边距 */
.footer{
margin-top: 20px;
margin-top: 20px; /* 上边距为20px */
}
/* .footer > span样式设置页脚文本的字体大小、位置和左边距 */
.footer>span{
font-size: 15px;
position: relative;
left: 45%;
}
font-size: 15px; /* 字体大小为15px */
position: relative; /* 相对定位,用于精确调整位置 */
left: 45%; /* 左边距为45%,使其水平居中 */
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,2 +1,84 @@
/** layui-v2.4.5 MIT License By https://www.layui.com */
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
/* 隐藏并设置特定位置的元素 */
html #layuicss-skincodecss {
display: none; /* 隐藏该元素 */
position: absolute; /* 绝对定位 */
width: 1989px; /* 设置元素的宽度 */
}
/* 设置layui代码块标题样式 */
.layui-code-h3, .layui-code-view {
position: relative; /* 设置相对定位 */
font-size: 12px; /* 设置字体大小 */
}
/* 设置layui代码视图块的样式 */
.layui-code-view {
display: block; /* 使元素成为块级元素 */
margin: 10px 0; /* 设置上下边距为10px */
padding: 0; /* 去除内边距 */
border: 1px solid #e2e2e2; /* 设置1px的灰色边框 */
border-left-width: 6px; /* 左边框宽度为6px */
background-color: #F2F2F2; /* 设置背景色为浅灰色 */
color: #333; /* 设置字体颜色为深灰色 */
font-family: Courier New; /* 设置字体为等宽字体 */
}
/* 设置layui代码标题的样式 */
.layui-code-h3 {
padding: 0 10px; /* 左右内边距为10px */
height: 32px; /* 设置高度为32px */
line-height: 32px; /* 设置行高与高度相同,使标题垂直居中 */
border-bottom: 1px solid #e2e2e2; /* 设置底部边框 */
}
/* 设置代码标题中的链接样式 */
.layui-code-h3 a {
position: absolute; /* 绝对定位 */
right: 10px; /* 距离右侧10px */
top: 0; /* 距离顶部0px */
color: #999; /* 设置颜色为浅灰色 */
}
/* 设置代码视图块中的有序列表样式 */
.layui-code-view .layui-code-ol {
position: relative; /* 设置相对定位 */
overflow: auto; /* 超出部分可滚动 */
}
/* 设置有序列表中每一项的样式 */
.layui-code-view .layui-code-ol li {
position: relative; /* 设置相对定位 */
margin-left: 45px; /* 设置左边距为45px缩进代码 */
line-height: 20px; /* 设置行高为20px */
padding: 0 5px; /* 设置左右内边距为5px */
border-left: 1px solid #e2e2e2; /* 设置左边框 */
list-style-type: decimal-leading-zero; /* 设置列表项的数字编号前面加零 */
*list-style-type: decimal; /* 兼容IE的老版本设置数字编号 */
background-color: #fff; /* 设置背景色为白色 */
}
/* 设置代码块中预格式化文本的样式 */
.layui-code-view pre {
margin: 0; /* 去除默认的外边距 */
}
/* 设置代码视图块中记事本样式的代码块 */
.layui-code-notepad {
border: 1px solid #0C0C0C; /* 设置1px的黑色边框 */
border-left-color: #3F3F3F; /* 设置左边框为深灰色 */
background-color: #0C0C0C; /* 设置背景色为深灰色 */
color: #C2BE9E; /* 设置字体颜色为淡黄色 */
}
/* 去掉记事本代码块标题的底部边框 */
.layui-code-notepad .layui-code-h3 {
border-bottom: none; /* 去除底部边框 */
}
/* 设置记事本代码块中有序列表项的样式 */
.layui-code-notepad .layui-code-ol li {
background-color: #3F3F3F; /* 设置背景色为深灰色 */
border-left: none; /* 去除左边框 */
}

Loading…
Cancel
Save