From 5c4fd76611d360cff6c69f42d4411a56d0e5b31a Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Fri, 25 Sep 2020 09:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExperimentalTeachingControllerApi.java | 27 +++++++ .../tms/api/PersonalFileControllerApi.java | 1 + .../ExperimentalTeachingController.java | 76 +++++++++++++++++++ .../msdw/tms/dao/ExperimentalTeachingDao.java | 20 +++++ src/main/java/com/msdw/tms/dao/UserDao.java | 1 + .../entity/ExperimentalTeachingEntity.java | 2 + .../vo/ExperimentalTeachingEntityVO.java | 29 +++++++ .../service/ExperimentalTeachingService.java | 20 +++++ .../impl/ExperimentalTeachingServiceImpl.java | 48 ++++++++++++ .../mapper/tms/ExperimentalTeachingDao.xml | 47 ++++++++++++ src/main/resources/mapper/tms/UserDao.xml | 4 +- 11 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java create mode 100644 src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java create mode 100644 src/main/java/com/msdw/tms/dao/ExperimentalTeachingDao.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingEntityVO.java create mode 100644 src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java create mode 100644 src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java create mode 100644 src/main/resources/mapper/tms/ExperimentalTeachingDao.xml diff --git a/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java b/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java new file mode 100644 index 0000000..bd99e85 --- /dev/null +++ b/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java @@ -0,0 +1,27 @@ +package com.msdw.tms.api; + +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value = "实验教学",tags = "实验教学") +public interface ExperimentalTeachingControllerApi { + + @ApiOperation(value = "实验教学列表",notes = "实验教学列表查询") + R list(@ApiParam(name = "page", value = "页码", required = true) Integer page, + @ApiParam(name = "size", value = "每页显示的数据条数", required = true) Integer size, + ExperimentalTeachingEntityVO request); + + @ApiOperation(value = "添加实验教学",notes = "添加实验教学") + R save(ExperimentalTeachingEntity experimentalTeachingEntity); + + @ApiOperation(value = "修改用户个人档案",notes = "修改用户个人档案") + R update(ExperimentalTeachingEntity experimentalTeachingEntity); + + @ApiOperation(value = "删除用户个人档案",notes = "删除用户个人档案") + R delete(Long[] ids); +} diff --git a/src/main/java/com/msdw/tms/api/PersonalFileControllerApi.java b/src/main/java/com/msdw/tms/api/PersonalFileControllerApi.java index 4d1d2f4..a67d2cd 100644 --- a/src/main/java/com/msdw/tms/api/PersonalFileControllerApi.java +++ b/src/main/java/com/msdw/tms/api/PersonalFileControllerApi.java @@ -14,6 +14,7 @@ public interface PersonalFileControllerApi { @ApiOperation(value = "添加用户个人档案",notes = "添加用户个人档案") R save(PersonalFileEntity personalFileEntity); + @ApiOperation(value = "修改用户个人档案",notes = "修改用户个人档案") R update(PersonalFileEntity personalFileEntity); diff --git a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java new file mode 100644 index 0000000..ab0962c --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java @@ -0,0 +1,76 @@ +package com.msdw.tms.controller; + +import com.msdw.tms.api.ExperimentalTeachingControllerApi; +import com.msdw.tms.api.UserControllerApi; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.UserEntityVo; +import com.msdw.tms.service.ExperimentalTeachingService; +import com.msdw.tms.service.UserService; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("tms/exp") +public class ExperimentalTeachingController implements ExperimentalTeachingControllerApi { + + @Autowired + private ExperimentalTeachingService experimentalTeachingService; + + + /** + * 列表 + */ +// @GetMapping("/page") +// public R list(@RequestParam Map params){ +// PageUtils page = experimentalTeachingService.queryPage(params); +// return R.ok().put("page", page); +// } + + /** + * 查询 + */ + @GetMapping("/list") + public R list(@RequestParam Integer page, + @RequestParam Integer size, + ExperimentalTeachingEntityVO request){ + PageUtils list = experimentalTeachingService.queryExperimentalTeaching(page,size,request); + return R.ok().put("list",list); + } + /** + * 保存 + */ + @PostMapping("/save") + public R save(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity){ + experimentalTeachingService.save(experimentalTeachingEntity); + return R.ok(); + } + + /** + * 修改 + */ + @PutMapping("/update") + public R update(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity){ + experimentalTeachingService.updateById(experimentalTeachingEntity); + + return R.ok(); + } + + /** + * 删除 + */ + @DeleteMapping("/delete") + public R delete(@RequestBody Long[] ids){ + experimentalTeachingService.removeByIds(Arrays.asList(ids)); + + return R.ok(); + } +} diff --git a/src/main/java/com/msdw/tms/dao/ExperimentalTeachingDao.java b/src/main/java/com/msdw/tms/dao/ExperimentalTeachingDao.java new file mode 100644 index 0000000..acb6dfe --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/ExperimentalTeachingDao.java @@ -0,0 +1,20 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.UserEntityVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ExperimentalTeachingDao extends BaseMapper { + + IPage queryExperimentalTeaching(Page page1,@Param("exp") ExperimentalTeachingEntityVO request); +} diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index c615395..129bf2b 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -1,6 +1,7 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/msdw/tms/entity/ExperimentalTeachingEntity.java b/src/main/java/com/msdw/tms/entity/ExperimentalTeachingEntity.java index 2ec27ac..c6f3795 100644 --- a/src/main/java/com/msdw/tms/entity/ExperimentalTeachingEntity.java +++ b/src/main/java/com/msdw/tms/entity/ExperimentalTeachingEntity.java @@ -45,6 +45,8 @@ public class ExperimentalTeachingEntity { private Integer isCode; //绑定用户Id private Integer userId; + //创建时间 + private String creationTime; //实验倒计时 private String surplusTime; } diff --git a/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingEntityVO.java b/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingEntityVO.java new file mode 100644 index 0000000..4272702 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingEntityVO.java @@ -0,0 +1,29 @@ +package com.msdw.tms.entity.vo; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 实验教学实体 + * + * @author Ning + */ +@Data +public class ExperimentalTeachingEntityVO { + + //发布类型 + private Integer type; + //启动时间 + private String startTime; + //结束时间 + private String stopTime; + //月份 + private Integer month; + //搜索内容 + private String searchContent; + //状态 + private Integer status; + +} diff --git a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java new file mode 100644 index 0000000..6bff1aa --- /dev/null +++ b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java @@ -0,0 +1,20 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.UserEntityVo; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +public interface ExperimentalTeachingService extends IService { + + PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO request); + +// PageUtils queryPage(Map params); + +} diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java new file mode 100644 index 0000000..b7b050d --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java @@ -0,0 +1,48 @@ +package com.msdw.tms.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.common.utils.Constant; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.Query; +import com.msdw.tms.dao.ExperimentalTeachingDao; +import com.msdw.tms.dao.UserDao; +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.ProjectRecordVo; +import com.msdw.tms.entity.vo.UserEntityVo; +import com.msdw.tms.service.ExperimentalTeachingService; +import com.msdw.tms.service.UserService; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service("experimentalTeachingService") +public class ExperimentalTeachingServiceImpl extends ServiceImpl implements ExperimentalTeachingService { + + +// @Override +// public PageUtils queryPage(Map params) { +// +// IPage page = this.page( +// new Query().getPage(params), +// new QueryWrapper() +// ); +// return new PageUtils(page); +// } + + @Override + public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO request) { + Page page1 = new Page<>(page, size); + ExperimentalTeachingDao userDao = this.getBaseMapper(); +// PageUtils vo = userDao.queryExperimentalTeaching(page1,request); + IPage list = userDao.queryExperimentalTeaching(page1, request); + PageUtils pageUtils = new PageUtils(list); + return pageUtils; + } +} diff --git a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml new file mode 100644 index 0000000..534e444 --- /dev/null +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -0,0 +1,47 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index d81c90e..75e6767 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -3,7 +3,7 @@ - SELECT userName, sex, @@ -33,6 +33,4 @@ AND c.isdel = #{isdel} AND s.isdel = #{isdel} - - \ No newline at end of file