news 2026/6/3 13:47:52

员工信息查询(含分页查询)

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
员工信息查询(含分页查询)

分页查询:原始方法

用@RequestParam可以为属性设置默认值

@Service public class EmpServiceimpl implements EmpService { @Autowired private EmpMapper empMapper; @Override public PageResult page(Integer page, Integer pageSize) { //1.调用mapper查询总记录数 Long total = empMapper.count(); //2.调用mapper查询结果列表 List<Emp> rows = empMapper.list((page - 1) * pageSize, pageSize); //3.封装结果 PageResult return new PageResult(total,rows); }
public interface EmpMapper { @Select("select count(*) from emp e left join dept d on e.dept_id = d.id") public Long count(); /* * 这里的d.name封装不到Emp对象中,所以需要使用别名解决 * */ @Select("select e.*,d.name deptName from emp e left join dept d on e.dept_id = d.id " + "order by e.update_time desc limit #{start},#{pageSize}") public List<Emp> list(Integer start, Integer pageSize);
public class EmpController { @Autowired private EmpService empService; /* * 分页查询 * */ @GetMapping public Result page(@RequestParam(defaultValue = "1") Integer page, @RequestParam (defaultValue = "10") Integer pageSize){ log.info("分页查询:{},{}",page,pageSize); PageResult pageResult = empService.page(page,pageSize); return Result.success(pageResult); }
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/2 23:58:03

三步打造个性化AI助手:Claude Code终端美化实战指南

三步打造个性化AI助手&#xff1a;Claude Code终端美化实战指南 【免费下载链接】claude-code Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex c…

作者头像 李华
网站建设 2026/6/1 10:49:27

Kotaemon是否需要微调模型?答案可能出乎你意料

Kotaemon是否需要微调模型&#xff1f;答案可能出乎你意料 在企业纷纷拥抱大语言模型的今天&#xff0c;一个看似简单却极具现实意义的问题浮出水面&#xff1a;我们真的需要对每一个应用场景都去微调模型吗&#xff1f; 许多团队一开始都会选择这条路——收集数据、清洗标注…

作者头像 李华
网站建设 2026/6/2 21:29:59

MatAnyone视频抠像:智能AI技术让专业级人像分离触手可及

还在为视频剪辑中繁琐的抠像步骤而烦恼吗&#xff1f;想象一下&#xff0c;只需简单几步就能从复杂背景中精准分离人像&#xff0c;无需绿幕&#xff0c;无需专业设备。MatAnyone正是这样一个革命性的AI视频处理工具&#xff0c;它通过先进的记忆传播机制&#xff0c;让视频人像…

作者头像 李华
网站建设 2026/6/1 2:06:59

Windows 11系统终极精简指南:从原理到实践的全方位解析

Windows 11系统终极精简指南&#xff1a;从原理到实践的全方位解析 【免费下载链接】tiny11builder Scripts to build a trimmed-down Windows 11 image. 项目地址: https://gitcode.com/GitHub_Trending/ti/tiny11builder 在数字化工作环境中&#xff0c;系统性能直接影…

作者头像 李华
网站建设 2026/6/2 23:37:21

连锁咖啡店如何用AI实现真正无限续杯?

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容&#xff1a; 开发一个智能咖啡续杯系统&#xff0c;包含以下功能&#xff1a;1.通过重量传感器实时监测咖啡余量&#xff1b;2.基于顾客消费习惯预测续杯需求&#xff1b;3.集成会员系统实现个性…

作者头像 李华
网站建设 2026/6/2 22:32:36

CustomTkinter终极指南:5分钟创建现代化Python桌面应用

CustomTkinter终极指南&#xff1a;5分钟创建现代化Python桌面应用 【免费下载链接】CustomTkinter A modern and customizable python UI-library based on Tkinter 项目地址: https://gitcode.com/gh_mirrors/cu/CustomTkinter CustomTkinter是一个基于Python Tkinter…

作者头像 李华