🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
🍅 文末获取源码联系👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
目录
1.技术选型
2.数据库表结构
3.开发工具
4.功能
4.1【角色】
4.2【前台功能模块】
4.3【后台功能模块】
5.项目演示截图
5.1 首页
5.2 火车信息
5.3 火车预订
5.4 预订订单
5.5 个人中心
5.6 后台登录
5.7 车票预订管理
5.8 火车信息管理
5.9 用户车票退票管理
6.数据库文件设计
7.核心代码
7.1 车票预订Controller
7.2 车票预定Service
7.3 车票预定ServiceImpl
7.4 车票预定DAO
8.参考文档
1.技术选型
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
2.数据库表结构
15张
3.开发工具
idea、navicat
4.功能
4.1【角色】
管理员、用户
4.2【前台功能模块】
- 登录注册
- 首页
- 火车信息
- 公告资讯
- 个人中心
- 后台管理
4.3【后台功能模块】
- 登录
- 首页
- 个人中心
- 用户管理
- 火车类型管理
- 火车信息管理
- 车票预订管理
- 车票退票管理
- 系统管理
5.项目演示截图
5.1 首页
5.2 火车信息
5.3 火车预订
5.4 预订订单
5.5 个人中心
5.6 后台登录
5.7 车票预订管理
5.8 火车信息管理
5.9 用户车票退票管理
6.数据库文件设计
CREATE TABLE `aboutus` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`title` varchar(200) NOT NULL COMMENT '标题',`subtitle` varchar(200) DEFAULT NULL COMMENT '副标题',`content` longtext NOT NULL COMMENT '内容',`picture1` longtext COMMENT '图片1',`picture2` longtext COMMENT '图片2',`picture3` longtext COMMENT '图片3',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='关于我们';CREATE TABLE `bupiaoxinxi` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`bupiaobianhao` varchar(200) DEFAULT NULL COMMENT '补票编号',`bupiaoshijian` datetime DEFAULT NULL COMMENT '补票时间',`checihao` varchar(200) DEFAULT NULL COMMENT '车次号',`chepiaojiage` varchar(200) DEFAULT NULL COMMENT '车票价格',`shangchedian` varchar(200) DEFAULT NULL COMMENT '上车点',`xiachedian` varchar(200) DEFAULT NULL COMMENT '下车点',`bupiaobeizhu` longtext COMMENT '补票备注',`yonghuzhanghao` varchar(200) DEFAULT NULL COMMENT '用户账号',`yonghuxingming` varchar(200) DEFAULT NULL COMMENT '用户姓名',`sfsh` varchar(200) DEFAULT '待审核' COMMENT '是否审核',`shhf` longtext COMMENT '审核回复',`ispay` varchar(200) DEFAULT '未支付' COMMENT '是否支付',PRIMARY KEY (`id`),UNIQUE KEY `bupiaobianhao` (`bupiaobianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8 COMMENT='补票信息';CREATE TABLE `chepiaotuipiao` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`tuipiaobianhao` varchar(200) DEFAULT NULL COMMENT '退票编号',`chexuhao` varchar(200) DEFAULT NULL COMMENT '车序号',`huocheleixing` varchar(200) DEFAULT NULL COMMENT '火车类型',`checihao` varchar(200) DEFAULT NULL COMMENT '车次号',`qidianzhan` varchar(200) NOT NULL COMMENT '起点站',`zhongdianzhan` varchar(200) NOT NULL COMMENT '终点站',`kaicheshijian` datetime NOT NULL COMMENT '开车时间',`daozhanshijian` datetime NOT NULL COMMENT '到站时间',`chepiaoleixing` varchar(200) DEFAULT NULL COMMENT '车票类型',`zuoweileixing` varchar(200) DEFAULT NULL COMMENT '座位类型',`chepiaojiage` int(11) NOT NULL COMMENT '车票价格',`tuipiaoshijian` datetime DEFAULT NULL COMMENT '退票时间',`tuipiaobeizhu` longtext COMMENT '退票备注',`yonghuzhanghao` varchar(200) DEFAULT NULL COMMENT '用户账号',`yonghuxingming` varchar(200) DEFAULT NULL COMMENT '用户姓名',`sfsh` varchar(200) DEFAULT '待审核' COMMENT '是否审核',`shhf` longtext COMMENT '审核回复',PRIMARY KEY (`id`),UNIQUE KEY `tuipiaobianhao` (`tuipiaobianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='车票退票';CREATE TABLE `chepiaoyuding` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`yudingbianhao` varchar(200) DEFAULT NULL COMMENT '预订编号',`chexuhao` varchar(200) DEFAULT NULL COMMENT '车序号',`huocheleixing` varchar(200) DEFAULT NULL COMMENT '火车类型',`checihao` varchar(200) DEFAULT NULL COMMENT '车次号',`qidianzhan` varchar(200) NOT NULL COMMENT '起点站',`zhongdianzhan` varchar(200) NOT NULL COMMENT '终点站',`kaicheshijian` datetime NOT NULL COMMENT '开车时间',`daozhanshijian` datetime NOT NULL COMMENT '到站时间',`chepiaoleixing` varchar(200) DEFAULT NULL COMMENT '车票类型',`zuoweileixing` varchar(200) DEFAULT NULL COMMENT '座位类型',`chepiaojiage` int(11) NOT NULL COMMENT '车票价格',`chepiaoshu` int(11) NOT NULL COMMENT '车票',`yudingshijian` datetime DEFAULT NULL COMMENT '预订时间',`yudingbeizhu` longtext COMMENT '预订备注',`yonghuzhanghao` varchar(200) DEFAULT NULL COMMENT '用户账号',`yonghuxingming` varchar(200) DEFAULT NULL COMMENT '用户姓名',`sfsh` varchar(200) DEFAULT '待审核' COMMENT '是否审核',`shhf` longtext COMMENT '审核回复',`ispay` varchar(200) DEFAULT '未支付' COMMENT '是否支付',PRIMARY KEY (`id`),UNIQUE KEY `yudingbianhao` (`yudingbianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COMMENT='车票预订';CREATE TABLE `config` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`name` varchar(100) NOT NULL COMMENT '配置参数名称',`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';CREATE TABLE `discusshuochexinxi` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`refid` bigint(20) NOT NULL COMMENT '关联表id',`userid` bigint(20) NOT NULL COMMENT '用户id',`avatarurl` longtext COMMENT '头像',`nickname` varchar(200) DEFAULT NULL COMMENT '用户名',`content` longtext NOT NULL COMMENT '评论内容',`reply` longtext COMMENT '回复内容',PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='火车信息评论表';CREATE TABLE `huocheleixing` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`huocheleixing` varchar(200) DEFAULT NULL COMMENT '火车类型',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='火车类型';CREATE TABLE `news` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`title` varchar(200) NOT NULL COMMENT '标题',`introduction` longtext COMMENT '简介',`picture` longtext NOT NULL COMMENT '图片',`content` longtext NOT NULL COMMENT '内容',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=99 DEFAULT CHARSET=utf8 COMMENT='公告资讯';CREATE TABLE `storeup` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`userid` bigint(20) NOT NULL COMMENT '用户id',`refid` bigint(20) DEFAULT NULL COMMENT '商品id',`tablename` varchar(200) DEFAULT NULL COMMENT '表名',`name` varchar(200) NOT NULL COMMENT '名称',`picture` longtext NOT NULL COMMENT '图片',`type` varchar(200) DEFAULT '1' COMMENT '类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注)',`inteltype` varchar(200) DEFAULT NULL COMMENT '推荐类型',`remark` varchar(200) DEFAULT NULL COMMENT '备注',PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏表';CREATE TABLE `systemintro` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`title` varchar(200) NOT NULL COMMENT '标题',`subtitle` varchar(200) DEFAULT NULL COMMENT '副标题',`content` longtext NOT NULL COMMENT '内容',`picture1` longtext COMMENT '图片1',`picture2` longtext COMMENT '图片2',`picture3` longtext COMMENT '图片3',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='关于我们';CREATE TABLE `users` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`username` varchar(100) NOT NULL COMMENT '用户名',`password` varchar(100) NOT NULL COMMENT '密码',`role` varchar(100) DEFAULT '管理员' COMMENT '角色',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户表';CREATE TABLE `xiachexinxi` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`xiachebianhao` varchar(200) DEFAULT NULL COMMENT '下车编号',`xiachezhandian` varchar(200) DEFAULT NULL COMMENT '下车站点',`xiacheshijian` datetime DEFAULT NULL COMMENT '下车时间',`xiachebeizhu` longtext COMMENT '下车备注',`yonghuzhanghao` varchar(200) DEFAULT NULL COMMENT '用户账号',`yonghuxingming` varchar(200) DEFAULT NULL COMMENT '用户姓名',PRIMARY KEY (`id`),UNIQUE KEY `xiachebianhao` (`xiachebianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 COMMENT='下车信息';CREATE TABLE `yonghu` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`yonghuzhanghao` varchar(200) NOT NULL COMMENT '用户账号',`mima` varchar(200) NOT NULL COMMENT '密码',`yonghuxingming` varchar(200) NOT NULL COMMENT '用户姓名',`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',`yonghudianhua` varchar(200) DEFAULT NULL COMMENT '用户电话',`touxiang` longtext COMMENT '头像',PRIMARY KEY (`id`),UNIQUE KEY `yonghuzhanghao` (`yonghuzhanghao`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='用户';
7.核心代码
7.1 车票预订Controller
package com.controller;/*** 车票预订* 后端接口* @author 计算机编程-吉哥*/
@RestController
@RequestMapping("/chepiaoyuding")
public class ChepiaoyudingController {@Autowiredprivate ChepiaoyudingService chepiaoyudingService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,ChepiaoyudingEntity chepiaoyuding,HttpServletRequest request){String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {chepiaoyuding.setYonghuzhanghao((String)request.getSession().getAttribute("username"));}EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();PageUtils page = chepiaoyudingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chepiaoyuding), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,ChepiaoyudingEntity chepiaoyuding, HttpServletRequest request){EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();PageUtils page = chepiaoyudingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chepiaoyuding), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( ChepiaoyudingEntity chepiaoyuding){EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();ew.allEq(MPUtil.allEQMapPre( chepiaoyuding, "chepiaoyuding")); return R.ok().put("data", chepiaoyudingService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(ChepiaoyudingEntity chepiaoyuding){EntityWrapper< ChepiaoyudingEntity> ew = new EntityWrapper< ChepiaoyudingEntity>();ew.allEq(MPUtil.allEQMapPre( chepiaoyuding, "chepiaoyuding")); ChepiaoyudingView chepiaoyudingView = chepiaoyudingService.selectView(ew);return R.ok("查询车票预订成功").put("data", chepiaoyudingView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){ChepiaoyudingEntity chepiaoyuding = chepiaoyudingService.selectById(id);return R.ok().put("data", chepiaoyuding);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){ChepiaoyudingEntity chepiaoyuding = chepiaoyudingService.selectById(id);return R.ok().put("data", chepiaoyuding);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody ChepiaoyudingEntity chepiaoyuding, HttpServletRequest request){chepiaoyuding.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(chepiaoyuding);chepiaoyudingService.insert(chepiaoyuding);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody ChepiaoyudingEntity chepiaoyuding, HttpServletRequest request){chepiaoyuding.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(chepiaoyuding);chepiaoyudingService.insert(chepiaoyuding);return R.ok();}/*** 修改*/@RequestMapping("/update")@Transactionalpublic R update(@RequestBody ChepiaoyudingEntity chepiaoyuding, HttpServletRequest request){//ValidatorUtils.validateEntity(chepiaoyuding);chepiaoyudingService.updateById(chepiaoyuding);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){chepiaoyudingService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<ChepiaoyudingEntity> wrapper = new EntityWrapper<ChepiaoyudingEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {wrapper.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));}int count = chepiaoyudingService.selectCount(wrapper);return R.ok().put("count", count);}/*** (按值统计)*/@RequestMapping("/value/{xColumnName}/{yColumnName}")public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {Map<String, Object> params = new HashMap<String, Object>();params.put("xColumn", xColumnName);params.put("yColumn", yColumnName);EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));}List<Map<String, Object>> result = chepiaoyudingService.selectValue(params, ew);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");for(Map<String, Object> m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put("data", result);}/*** (按值统计)时间统计类型*/@RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {Map<String, Object> params = new HashMap<String, Object>();params.put("xColumn", xColumnName);params.put("yColumn", yColumnName);params.put("timeStatType", timeStatType);EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));}List<Map<String, Object>> result = chepiaoyudingService.selectTimeStatValue(params, ew);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");for(Map<String, Object> m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put("data", result);}/*** 分组统计*/@RequestMapping("/group/{columnName}")public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {Map<String, Object> params = new HashMap<String, Object>();params.put("column", columnName);EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {ew.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));}List<Map<String, Object>> result = chepiaoyudingService.selectGroup(params, ew);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");for(Map<String, Object> m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put("data", result);}/*** 总数量*/@RequestMapping("/count")public R count(@RequestParam Map<String, Object> params,ChepiaoyudingEntity chepiaoyuding, HttpServletRequest request){String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {chepiaoyuding.setYonghuzhanghao((String)request.getSession().getAttribute("username"));}EntityWrapper<ChepiaoyudingEntity> ew = new EntityWrapper<ChepiaoyudingEntity>();int count = chepiaoyudingService.selectCount(MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chepiaoyuding), params), params));return R.ok().put("data", count);}}
7.2 车票预定Service
package com.service;/*** 车票预订** @author 计算机编程-吉哥*/
public interface ChepiaoyudingService extends IService<ChepiaoyudingEntity> {PageUtils queryPage(Map<String, Object> params);List<ChepiaoyudingVO> selectListVO(Wrapper<ChepiaoyudingEntity> wrapper);ChepiaoyudingVO selectVO(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<ChepiaoyudingView> selectListView(Wrapper<ChepiaoyudingEntity> wrapper);ChepiaoyudingView selectView(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);PageUtils queryPage(Map<String, Object> params,Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectValue(Map<String, Object> params,Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params,Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectGroup(Map<String, Object> params,Wrapper<ChepiaoyudingEntity> wrapper);}
7.3 车票预定ServiceImpl
package com.service.impl;import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;import com.dao.ChepiaoyudingDao;
import com.entity.ChepiaoyudingEntity;
import com.service.ChepiaoyudingService;
import com.entity.vo.ChepiaoyudingVO;
import com.entity.view.ChepiaoyudingView;@Service("chepiaoyudingService")
public class ChepiaoyudingServiceImpl extends ServiceImpl<ChepiaoyudingDao, ChepiaoyudingEntity> implements ChepiaoyudingService {@Overridepublic PageUtils queryPage(Map<String, Object> params) {Page<ChepiaoyudingEntity> page = this.selectPage(new Query<ChepiaoyudingEntity>(params).getPage(),new EntityWrapper<ChepiaoyudingEntity>());return new PageUtils(page);}@Overridepublic PageUtils queryPage(Map<String, Object> params, Wrapper<ChepiaoyudingEntity> wrapper) {Page<ChepiaoyudingView> page =new Query<ChepiaoyudingView>(params).getPage();page.setRecords(baseMapper.selectListView(page,wrapper));PageUtils pageUtil = new PageUtils(page);return pageUtil;}@Overridepublic List<ChepiaoyudingVO> selectListVO(Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectListVO(wrapper);}@Overridepublic ChepiaoyudingVO selectVO(Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectVO(wrapper);}@Overridepublic List<ChepiaoyudingView> selectListView(Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectListView(wrapper);}@Overridepublic ChepiaoyudingView selectView(Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectView(wrapper);}@Overridepublic List<Map<String, Object>> selectValue(Map<String, Object> params, Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectValue(params, wrapper);}@Overridepublic List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params, Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectTimeStatValue(params, wrapper);}@Overridepublic List<Map<String, Object>> selectGroup(Map<String, Object> params, Wrapper<ChepiaoyudingEntity> wrapper) {return baseMapper.selectGroup(params, wrapper);}}
7.4 车票预定DAO
package com.dao;/*** 车票预订* * @author 计算机编程-吉哥*/
public interface ChepiaoyudingDao extends BaseMapper<ChepiaoyudingEntity> {List<ChepiaoyudingVO> selectListVO(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);ChepiaoyudingVO selectVO(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<ChepiaoyudingView> selectListView(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<ChepiaoyudingView> selectListView(Pagination page,@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);ChepiaoyudingView selectView(@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectValue(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectTimeStatValue(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);List<Map<String, Object>> selectGroup(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<ChepiaoyudingEntity> wrapper);}
8.参考文档
你可能还有感兴趣的项目👇🏻👇🏻👇🏻
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论