|
|
@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
// 指定该类所属的包为 com.service.impl
|
|
|
|
|
|
|
|
package com.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导入自定义工具类 StringUtil,可用于字符串处理相关操作
|
|
|
|
|
|
|
|
import com.utils.StringUtil;
|
|
|
|
|
|
|
|
// 导入服务接口 DictionaryService,可能用于字典数据的服务操作
|
|
|
|
|
|
|
|
import com.service.DictionaryService;
|
|
|
|
|
|
|
|
// 导入自定义工具类 ClazzDiff,也许用于类差异比较等操作
|
|
|
|
|
|
|
|
import com.utils.ClazzDiff;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 BeanUtils 类,用于 Bean 属性复制等操作
|
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 Autowired 注解,用于自动注入依赖的 Bean
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 Service 注解,将该类标记为服务层组件
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
// 导入 Java 反射机制中的 Field 类,用于操作类的字段
|
|
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
|
|
|
// 导入 Java 集合框架中的常用类,用于处理集合数据
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
// 导入 MyBatis-Plus 的 Page 类,用于分页查询操作
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
|
|
|
|
|
// 导入 MyBatis-Plus 的 ServiceImpl 类,作为服务实现类的基类
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 Transactional 注解,用于开启事务管理
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
// 导入自定义的 PageUtils 类,用于处理分页结果
|
|
|
|
|
|
|
|
import com.utils.PageUtils;
|
|
|
|
|
|
|
|
// 导入自定义的 Query 类,用于构建查询条件和分页信息
|
|
|
|
|
|
|
|
import com.utils.Query;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 ContextLoader 类,用于获取 Web 应用上下文
|
|
|
|
|
|
|
|
import org.springframework.web.context.ContextLoader;
|
|
|
|
|
|
|
|
// 导入 Servlet 上下文接口,用于与 Servlet 容器交互
|
|
|
|
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
|
|
|
|
// 导入 HTTP 请求对象类,用于处理 HTTP 请求
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 Nullable 注解,表明参数或返回值可以为 null
|
|
|
|
|
|
|
|
import org.springframework.lang.Nullable;
|
|
|
|
|
|
|
|
// 导入 Spring 框架的 Assert 类,用于进行断言检查
|
|
|
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
// 导入教练预约申请的数据访问对象接口
|
|
|
|
|
|
|
|
import com.dao.JiaolianYuyueDao;
|
|
|
|
|
|
|
|
// 导入教练预约申请的实体类
|
|
|
|
|
|
|
|
import com.entity.JiaolianYuyueEntity;
|
|
|
|
|
|
|
|
// 导入教练预约申请的服务接口
|
|
|
|
|
|
|
|
import com.service.JiaolianYuyueService;
|
|
|
|
|
|
|
|
// 导入教练预约申请的视图类
|
|
|
|
|
|
|
|
import com.entity.view.JiaolianYuyueView;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用 Service 注解将该类标记为 Spring 服务组件,名称为 jiaolianYuyueService
|
|
|
|
|
|
|
|
@Service("jiaolianYuyueService")
|
|
|
|
|
|
|
|
// 使用 Transactional 注解开启事务管理
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
// 定义教练预约申请服务实现类,继承自 MyBatis-Plus 的 ServiceImpl 类,并实现 JiaolianYuyueService 接口
|
|
|
|
|
|
|
|
public class JiaolianYuyueServiceImpl extends ServiceImpl<JiaolianYuyueDao, JiaolianYuyueEntity> implements JiaolianYuyueService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重写 JiaolianYuyueService 接口中的 queryPage 方法
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
// 实现分页查询教练预约申请数据的方法,接收一个包含查询参数的 Map 对象
|
|
|
|
|
|
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
|
|
|
|
|
|
// 根据传入的查询参数创建一个 JiaolianYuyueView 类型的分页对象
|
|
|
|
|
|
|
|
Page<JiaolianYuyueView> page = new Query<JiaolianYuyueView>(params).getPage();
|
|
|
|
|
|
|
|
// 调用数据访问对象的方法查询分页列表数据,并设置到分页对象中
|
|
|
|
|
|
|
|
page.setRecords(baseMapper.selectListView(page, params));
|
|
|
|
|
|
|
|
// 根据分页对象创建 PageUtils 对象并返回
|
|
|
|
|
|
|
|
return new PageUtils(page);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|