9 files modified
16 files added
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import org.springblade.modules.examination.vo.ExaminationVO; |
| | | import org.springblade.modules.examination.service.IExaminationService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/examination") |
| | | @Api(value = "", tags = "接口") |
| | | public class ExaminationController extends BladeController { |
| | | |
| | | private final IExaminationService examinationService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入examination") |
| | | public R<Examination> detail(Examination examination) { |
| | | Examination detail = examinationService.getOne(Condition.getQueryWrapper(examination)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入examination") |
| | | public R<IPage<Examination>> list(Examination examination, Query query) { |
| | | IPage<Examination> pages = examinationService.page(Condition.getPage(query), Condition.getQueryWrapper(examination)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入examination") |
| | | public R<IPage<ExaminationVO>> page(ExaminationVO examination, Query query) { |
| | | IPage<ExaminationVO> pages = examinationService.selectExaminationPage(Condition.getPage(query), examination); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入examination") |
| | | public R save(@Valid @RequestBody Examination examination) { |
| | | return R.status(examinationService.save(examination)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入examination") |
| | | public R update(@Valid @RequestBody Examination examination) { |
| | | return R.status(examinationService.updateById(examination)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入examination") |
| | | public R submit(@Valid @RequestBody Examination examination) { |
| | | return R.status(examinationService.saveOrUpdate(examination)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(examinationService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 成绩查询 |
| | | * @param cardid |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectExaminationInfo") |
| | | public R selectExaminationInfo(String cardid) { |
| | | return R.data(examinationService.selectExaminationInfo(cardid)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.dto; |
| | | |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ExaminationDTO extends Examination { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @TableName("sys_examination") |
| | | @ApiModel(value = "Examination对象", description = "Examination对象") |
| | | public class Examination implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String rname; |
| | | /** |
| | | * 考试开始时间 |
| | | */ |
| | | @ApiModelProperty(value = "考试开始时间") |
| | | private String examinationbegintime; |
| | | /** |
| | | * 考试地点 |
| | | */ |
| | | @ApiModelProperty(value = "考试地点") |
| | | private String examinationaddress; |
| | | /** |
| | | * 考试类别 |
| | | */ |
| | | @ApiModelProperty(value = "考试类别") |
| | | private String examinationtype; |
| | | /** |
| | | * 考试成绩 |
| | | */ |
| | | @ApiModelProperty(value = "考试成绩") |
| | | private String examinationc; |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String cardid; |
| | | /** |
| | | * 考试结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "考试结束时间") |
| | | private String examinationendtime; |
| | | private Integer id; |
| | | |
| | | private String stat; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.mapper; |
| | | |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import org.springblade.modules.examination.vo.ExaminationVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | public interface ExaminationMapper extends BaseMapper<Examination> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param examination |
| | | * @return |
| | | */ |
| | | List<ExaminationVO> selectExaminationPage(IPage page, ExaminationVO examination); |
| | | List<Map<Object,String>> selectExaminationInfo(String cardid); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.examination.mapper.ExaminationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="examinationResultMap" type="org.springblade.modules.examination.entity.Examination"> |
| | | <id column="id" property="id"/> |
| | | <result column="rname" property="rname"/> |
| | | <result column="examinationbegintime" property="examinationbegintime"/> |
| | | <result column="examinationaddress" property="examinationaddress"/> |
| | | <result column="examinationtype" property="examinationtype"/> |
| | | <result column="examinationc" property="examinationc"/> |
| | | <result column="cardid" property="cardid"/> |
| | | <result column="examinationendtime" property="examinationendtime"/> |
| | | <result column="stat" property="stat"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectExaminationPage" resultMap="examinationResultMap"> |
| | | select * from sys_examination where is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectExaminationInfo" resultType="java.util.HashMap"> |
| | | select * from sys_examination where cardid=#{cardid} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.service; |
| | | |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import org.springblade.modules.examination.vo.ExaminationVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | public interface IExaminationService extends IService<Examination> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param examination |
| | | * @return |
| | | */ |
| | | IPage<ExaminationVO> selectExaminationPage(IPage<ExaminationVO> page, ExaminationVO examination); |
| | | List<Map<Object,String>> selectExaminationInfo(String cardid); |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.service.impl; |
| | | |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import org.springblade.modules.examination.vo.ExaminationVO; |
| | | import org.springblade.modules.examination.mapper.ExaminationMapper; |
| | | import org.springblade.modules.examination.service.IExaminationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Service |
| | | public class ExaminationServiceImpl extends ServiceImpl<ExaminationMapper, Examination> implements IExaminationService { |
| | | |
| | | @Override |
| | | public IPage<ExaminationVO> selectExaminationPage(IPage<ExaminationVO> page, ExaminationVO examination) { |
| | | return page.setRecords(baseMapper.selectExaminationPage(page, examination)); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, String>> selectExaminationInfo(String cardid) { |
| | | return baseMapper.selectExaminationInfo(cardid); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.examination.vo; |
| | | |
| | | import org.springblade.modules.examination.entity.Examination; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "ExaminationVO对象", description = "ExaminationVO对象") |
| | | public class ExaminationVO extends Examination { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "租户ID") |
| | | @TableField("tenantId") |
| | | private String tenantid; |
| | | private String company; |
| | | |
| | | |
| | | } |
| | |
| | | <result column="score" property="score"/> |
| | | <result column="time" property="time"/> |
| | | <result column="tenantId" property="tenantid"/> |
| | | <result column="company" property="company"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 出资人信息 |
| | | * @param creditcode |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectShareholderInfo") |
| | | public R selectShareholderInfo(String creditcode) { |
| | | return R.data(shareholderService.selectShareholderInfo(creditcode)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | List<ShareholderVO> selectShareholderPage(IPage page, ShareholderVO shareholder); |
| | | |
| | | List<Map<Object,String>> selectShareholderInfo(String creditcode); |
| | | } |
| | |
| | | <result column="capitalTime" property="capitaltime"/> |
| | | <result column="cardid" property="cardid"/> |
| | | <result column="cell" property="cell"/> |
| | | <result column="creditCode" property="creditcode"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | select * from sys_shareholder |
| | | </select> |
| | | |
| | | |
| | | <select id="selectShareholderInfo" resultType="java.util.HashMap"> |
| | | select * from sys_shareholder where creditCode=#{creditcode} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | IPage<ShareholderVO> selectShareholderPage(IPage<ShareholderVO> page, ShareholderVO shareholder); |
| | | |
| | | List<Map<Object,String>> selectShareholderInfo(String creditcode); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | |
| | | return page.setRecords(baseMapper.selectShareholderPage(page, shareholder)); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, String>> selectShareholderInfo(String creditcode) { |
| | | return baseMapper.selectShareholderInfo(creditcode); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private String rtime; |
| | | private String hold; |
| | | |
| | | |
| | | } |
| | |
| | | <result column="address" property="address"/> |
| | | <result column="registered" property="registered"/> |
| | | <result column="rtime" property="rtime"/> |
| | | <result column="hold" property="hold"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectUserPage" resultMap="userResultMap"> |
| | |
| | | <if test="user.status!=null and user.status != ''"> |
| | | and status = #{user.status} |
| | | </if> |
| | | <if test="user.hold!=null and user.hold != ''"> |
| | | and hold = #{user.hold} |
| | | </if> |
| | | <if test="deptIdList!=null and deptIdList.size>0"> |
| | | and id in ( |
| | | SELECT |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.train.entity.Train; |
| | | import org.springblade.modules.train.vo.TrainVO; |
| | | import org.springblade.modules.train.service.ITrainService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/train") |
| | | @Api(value = "", tags = "接口") |
| | | public class TrainController extends BladeController { |
| | | |
| | | private final ITrainService trainService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入train") |
| | | public R<Train> detail(Train train) { |
| | | Train detail = trainService.getOne(Condition.getQueryWrapper(train)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入train") |
| | | public R<IPage<Train>> list(Train train, Query query) { |
| | | IPage<Train> pages = trainService.page(Condition.getPage(query), Condition.getQueryWrapper(train)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入train") |
| | | public R<IPage<TrainVO>> page(TrainVO train, Query query) { |
| | | IPage<TrainVO> pages = trainService.selectTrainPage(Condition.getPage(query), train); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入train") |
| | | public R save(@Valid @RequestBody Train train) { |
| | | return R.status(trainService.save(train)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入train") |
| | | public R update(@Valid @RequestBody Train train) { |
| | | return R.status(trainService.updateById(train)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入train") |
| | | public R submit(@Valid @RequestBody Train train) { |
| | | return R.status(trainService.saveOrUpdate(train)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(trainService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 培训查询 |
| | | * @param cardid |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectTrainInfo") |
| | | public R selectTrainInfo(String cardid) { |
| | | return R.data(trainService.selectTrainInfo(cardid)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.dto; |
| | | |
| | | import org.springblade.modules.train.entity.Train; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class TrainDTO extends Train { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @TableName("sys_train") |
| | | @ApiModel(value = "Train对象", description = "Train对象") |
| | | public class Train implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String rname; |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | @ApiModelProperty(value = "年龄") |
| | | private Integer age; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String countenance; |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String cardid; |
| | | /** |
| | | * 培训机构 |
| | | */ |
| | | @ApiModelProperty(value = "培训机构") |
| | | private String train; |
| | | /** |
| | | * 培训时间 |
| | | */ |
| | | @ApiModelProperty(value = "培训时间") |
| | | private LocalDateTime traintime; |
| | | /** |
| | | * 培训地点 |
| | | */ |
| | | @ApiModelProperty(value = "培训地点") |
| | | private String trainaddrss; |
| | | /** |
| | | * 培训内容 |
| | | */ |
| | | @ApiModelProperty(value = "培训内容") |
| | | private String traincontent; |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.mapper; |
| | | |
| | | import org.springblade.modules.train.entity.Train; |
| | | import org.springblade.modules.train.vo.TrainVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | public interface TrainMapper extends BaseMapper<Train> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param train |
| | | * @return |
| | | */ |
| | | List<TrainVO> selectTrainPage(IPage page, TrainVO train); |
| | | List<Map<Object,String>> selectTrainInfo(String cardid); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.train.mapper.TrainMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="trainResultMap" type="org.springblade.modules.train.entity.Train"> |
| | | <id column="id" property="id"/> |
| | | <result column="rname" property="rname"/> |
| | | <result column="age" property="age"/> |
| | | <result column="sex" property="sex"/> |
| | | <result column="nation" property="nation"/> |
| | | <result column="countenance" property="countenance"/> |
| | | <result column="education" property="education"/> |
| | | <result column="cardid" property="cardid"/> |
| | | <result column="train" property="train"/> |
| | | <result column="traintime" property="traintime"/> |
| | | <result column="trainaddrss" property="trainaddrss"/> |
| | | <result column="traincontent" property="traincontent"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectTrainPage" resultMap="trainResultMap"> |
| | | select * from sys_train where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectTrainInfo" resultType="java.util.HashMap"> |
| | | select * from sys_train where cardid=#{cardid} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.service; |
| | | |
| | | import org.springblade.modules.train.entity.Train; |
| | | import org.springblade.modules.train.vo.TrainVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | public interface ITrainService extends IService<Train> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param train |
| | | * @return |
| | | */ |
| | | IPage<TrainVO> selectTrainPage(IPage<TrainVO> page, TrainVO train); |
| | | List<Map<Object,String>> selectTrainInfo(String cardid); |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.service.impl; |
| | | |
| | | import org.springblade.modules.train.entity.Train; |
| | | import org.springblade.modules.train.vo.TrainVO; |
| | | import org.springblade.modules.train.mapper.TrainMapper; |
| | | import org.springblade.modules.train.service.ITrainService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Service |
| | | public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements ITrainService { |
| | | |
| | | @Override |
| | | public IPage<TrainVO> selectTrainPage(IPage<TrainVO> page, TrainVO train) { |
| | | return page.setRecords(baseMapper.selectTrainPage(page, train)); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, String>> selectTrainInfo(String cardid) { |
| | | return baseMapper.selectTrainInfo(cardid); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.train.vo; |
| | | |
| | | import org.springblade.modules.train.entity.Train; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "TrainVO对象", description = "TrainVO对象") |
| | | public class TrainVO extends Train { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |