Переглянути джерело

奖项,著作,论文等相关接口

Signed-off-by: guoWenHao <2532478980@qq.com>
guoWenHao 9 місяців тому
батько
коміт
e8a3e04c4d
23 змінених файлів з 698 додано та 14 видалено
  1. 22 0
      teacher-pojo/src/main/java/com/example/dto/ThesisDTO.java
  2. 22 0
      teacher-pojo/src/main/java/com/example/dto/WorkDTO.java
  3. 30 0
      teacher-pojo/src/main/java/com/example/entity/Thesis.java
  4. 30 0
      teacher-pojo/src/main/java/com/example/entity/Work.java
  5. 27 0
      teacher-pojo/src/main/java/com/example/vo/AwardsVO.java
  6. 30 0
      teacher-pojo/src/main/java/com/example/vo/ThesisVO.java
  7. 30 0
      teacher-pojo/src/main/java/com/example/vo/WorkVO.java
  8. 1 0
      teacher-serve/src/main/java/com/example/config/WebMvcConfiguration.java
  9. 32 7
      teacher-serve/src/main/java/com/example/controller/teacher/AwardsController.java
  10. 52 0
      teacher-serve/src/main/java/com/example/controller/teacher/ThesisController.java
  11. 54 0
      teacher-serve/src/main/java/com/example/controller/teacher/WorkController.java
  12. 23 4
      teacher-serve/src/main/java/com/example/mapper/AwardsMapper.java
  13. 22 0
      teacher-serve/src/main/java/com/example/mapper/ThesisMapper.java
  14. 44 0
      teacher-serve/src/main/java/com/example/mapper/WorkMapper.java
  15. 8 1
      teacher-serve/src/main/java/com/example/service/AwardsService.java
  16. 14 0
      teacher-serve/src/main/java/com/example/service/ThesisService.java
  17. 15 0
      teacher-serve/src/main/java/com/example/service/WorkService.java
  18. 43 2
      teacher-serve/src/main/java/com/example/service/impl/AwardsServiceImpl.java
  19. 49 0
      teacher-serve/src/main/java/com/example/service/impl/ThesisServiceImpl.java
  20. 73 0
      teacher-serve/src/main/java/com/example/service/impl/WorkServiceImpl.java
  21. 22 0
      teacher-serve/src/main/resources/mapper/AwardsMapper.xml
  22. 27 0
      teacher-serve/src/main/resources/mapper/ThesisMapper.xml
  23. 28 0
      teacher-serve/src/main/resources/mapper/WorkMapper.xml

+ 22 - 0
teacher-pojo/src/main/java/com/example/dto/ThesisDTO.java

@@ -0,0 +1,22 @@
+package com.example.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+public class ThesisDTO implements Serializable {
+
+    private String name;
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
+    private LocalDate date;
+
+    private String website;
+
+    private String image;
+
+    private String file;
+}

+ 22 - 0
teacher-pojo/src/main/java/com/example/dto/WorkDTO.java

@@ -0,0 +1,22 @@
+package com.example.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+public class WorkDTO implements Serializable {
+
+    private String name;
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
+    private LocalDate date;
+
+    private String press;
+
+    private String image;
+
+    private String file;
+}

+ 30 - 0
teacher-pojo/src/main/java/com/example/entity/Thesis.java

@@ -0,0 +1,30 @@
+package com.example.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class Thesis implements Serializable {
+
+    private Long id;
+
+    private Long teacherId;
+
+    private String name;
+
+    private LocalDate date;
+
+    private String image;
+
+    private String website;
+
+    private String file;
+}

+ 30 - 0
teacher-pojo/src/main/java/com/example/entity/Work.java

@@ -0,0 +1,30 @@
+package com.example.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class Work implements Serializable {
+
+    private Long id;
+
+    private Long teacherId;
+
+    private String name;
+
+    private LocalDate date;
+
+    private String image;
+
+    private String press;
+
+    private String file;
+}

+ 27 - 0
teacher-pojo/src/main/java/com/example/vo/AwardsVO.java

@@ -0,0 +1,27 @@
+package com.example.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class AwardsVO implements Serializable {
+
+    private Long id;
+
+    private Long teacherId;
+
+    private String name;
+
+    private LocalDate date;
+
+    private String image;
+}

+ 30 - 0
teacher-pojo/src/main/java/com/example/vo/ThesisVO.java

@@ -0,0 +1,30 @@
+package com.example.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ThesisVO implements Serializable {
+
+    private Long id;
+
+    private Long teacherId;
+
+    private String name;
+
+    private LocalDate date;
+
+    private String image;
+
+    private String website;
+
+    private String file;
+}

+ 30 - 0
teacher-pojo/src/main/java/com/example/vo/WorkVO.java

@@ -0,0 +1,30 @@
+package com.example.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class WorkVO implements Serializable {
+
+    private Long id;
+
+    private Long teacherId;
+
+    private String name;
+
+    private LocalDate date;
+
+    private String image;
+
+    private String press;
+
+    private String file;
+}

+ 1 - 0
teacher-serve/src/main/java/com/example/config/WebMvcConfiguration.java

@@ -40,6 +40,7 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
         log.info("开始注册自定义拦截器...");
         registry.addInterceptor(jwtTokenAdminInterceptor)
                 .addPathPatterns("/teacher/**")
+                .addPathPatterns("/user/password")
                 .excludePathPatterns("/open/**")
                 .excludePathPatterns("/user/download");
 

+ 32 - 7
teacher-serve/src/main/java/com/example/controller/teacher/AwardsController.java

@@ -3,14 +3,15 @@ package com.example.controller.teacher;
 import com.example.dto.AwardsDTO;
 import com.example.result.Result;
 import com.example.service.AwardsService;
+import com.example.service.TeacherService;
+import com.example.vo.AwardsVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import static org.apache.coyote.http11.Constants.a;
 
 @RestController
 @Slf4j
@@ -22,9 +23,33 @@ public class AwardsController {
 
     @PostMapping
     @ApiOperation(value = "老师获奖上传")
-    public Result uploadAwards(@RequestBody AwardsDTO awardsDTO,Integer awardsNum){
-       log.info("获奖上传,{}",awardsDTO);
-       awardsService.uploadAwards(awardsDTO,awardsNum);
+    public Result uploadAwards(@RequestBody AwardsDTO awardsDTO) {
+        log.info("获奖上传,{}", awardsDTO);
+        awardsService.uploadAwards(awardsDTO);
         return Result.success();
     }
+
+    @PutMapping("/{id}")
+    @ApiOperation(value = "修改指定奖项")
+    public Result updateAwards(@RequestBody AwardsDTO awardsDTO, @PathVariable Long id) {
+        log.info("修改指定奖项:{}", id);
+        awardsService.updateAwards(awardsDTO, id);
+        return Result.success();
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation(value = "获取指定奖项详细信息")
+    public Result<AwardsVO> getById(@PathVariable Long id) {
+        log.info("获取指定奖项详细信息:{}", id);
+        AwardsVO awardsVO = awardsService.getById(id);
+        return Result.success(awardsVO);
+    }
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除指定奖项")
+    public Result deleteById(@PathVariable Long id){
+        log.info("删除指定奖项:{}",id);
+        awardsService.deleteById(id);
+        return Result.success();
+    }
+
 }

+ 52 - 0
teacher-serve/src/main/java/com/example/controller/teacher/ThesisController.java

@@ -0,0 +1,52 @@
+package com.example.controller.teacher;
+
+import com.example.dto.AwardsDTO;
+import com.example.dto.ThesisDTO;
+import com.example.result.Result;
+import com.example.service.ThesisService;
+import com.example.vo.AwardsVO;
+import com.example.vo.ThesisVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Slf4j
+@Api(tags = "老师获奖相关接口")
+@RequestMapping("/teacher/thesis")
+public class ThesisController {
+
+    @Autowired
+    private ThesisService thesisService;
+
+    @PostMapping
+    @ApiOperation(value = "老师论文上传")
+    public Result uploadThesis(@RequestBody ThesisDTO thesisDTO) {
+        log.info("论文上传,{}", thesisDTO);
+        thesisService.uploadThesis(thesisDTO);
+        return Result.success();
+    }
+    @PutMapping("/{id}")
+    @ApiOperation(value = "修改指定奖项")
+    public Result updateAwards(@RequestBody ThesisDTO thesisDTO, @PathVariable Long id) {
+        log.info("修改指定奖项:{}", id);
+        thesisService.updateThesis(thesisDTO, id);
+        return Result.success();
+    }
+    @GetMapping("/{id}")
+    @ApiOperation(value = "获取指定奖项详细信息")
+    public Result<ThesisVO> getById(@PathVariable Long id) {
+        log.info("获取指定奖项详细信息:{}", id);
+        ThesisVO thesisVO = thesisService.getById(id);
+        return Result.success(thesisVO);
+    }
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除指定奖项")
+    public Result deleteById(@PathVariable Long id){
+        log.info("删除指定奖项:{}",id);
+        thesisService.deleteById(id);
+        return Result.success();
+    }
+}

+ 54 - 0
teacher-serve/src/main/java/com/example/controller/teacher/WorkController.java

@@ -0,0 +1,54 @@
+package com.example.controller.teacher;
+
+import com.example.dto.AwardsDTO;
+import com.example.dto.WorkDTO;
+import com.example.result.Result;
+import com.example.service.WorkService;
+import com.example.vo.AwardsVO;
+import com.example.vo.WorkVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Slf4j
+@Api(tags = "老师著作相关接口")
+@RequestMapping("/teacher/work")
+public class WorkController {
+    @Autowired
+    private WorkService workService;
+
+    @PostMapping
+    @ApiOperation(value = "老师著作上传")
+    public Result uploadWork(@RequestBody WorkDTO workDTO) {
+        log.info("著作上传,{}", workDTO);
+        workService.uploadWork(workDTO);
+        return Result.success();
+    }
+
+    @PutMapping("/{id}")
+    @ApiOperation(value = "修改指定著作")
+    public Result updateWork(@RequestBody WorkDTO workDTO, @PathVariable Long id) {
+        log.info("修改指定著作:{}", id);
+        workService.updateWork(workDTO, id);
+        return Result.success();
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation(value = "获取指定著作详细信息")
+    public Result<WorkVO> getById(@PathVariable Long id) {
+        log.info("获取指定著作详细信息:{}", id);
+        WorkVO workVO = workService.getById(id);
+        return Result.success(workVO);
+    }
+
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除指定著作")
+    public Result deleteById(@PathVariable Long id){
+        log.info("删除指定著作:{}",id);
+        workService.deleteById(id);
+        return Result.success();
+    }
+}

+ 23 - 4
teacher-serve/src/main/java/com/example/mapper/AwardsMapper.java

@@ -1,10 +1,7 @@
 package com.example.mapper;
 
 import com.example.entity.Awards;
-import org.apache.ibatis.annotations.Insert;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Update;
+import org.apache.ibatis.annotations.*;
 
 @Mapper
 public interface AwardsMapper {
@@ -23,4 +20,26 @@ public interface AwardsMapper {
      */
     @Update("update teacherteam_system.teacher set awards_num = awards_num+1 where id = #{id}")
     void addAwardsNum(@Param("id") Long id);
+
+    /**
+     * 修改指定奖项
+     * @param awards
+     */
+    void updateAwards(Awards awards);
+
+    /**
+     * 查询指定奖项
+     *
+     * @param id
+     * @return
+     */
+    @Select("select * from teacherteam_system.awards where id = #{id}")
+    Awards getById(Long id);
+
+    /**
+     * 删除指定奖项
+     * @param id
+     */
+    @Delete("delete from teacherteam_system.awards where id = #{id}")
+    void deleteById(Long id);
 }

+ 22 - 0
teacher-serve/src/main/java/com/example/mapper/ThesisMapper.java

@@ -0,0 +1,22 @@
+package com.example.mapper;
+
+import com.example.entity.Thesis;
+import org.apache.ibatis.annotations.*;
+
+@Mapper
+public interface ThesisMapper {
+    @Insert("insert into teacherteam_system.thesis(teacher_id, name, date, image,website,file)" +
+            "values (#{teacherId},#{name},#{date},#{image},#{website},#{file});")
+    void uploadThesis(Thesis thesis);
+
+    @Update("update teacherteam_system.teacher set thesis_num = teacher.thesis_num+1 where id = #{id}")
+    void addThesisNum(Long id);
+
+    void updateThesis(Thesis thesis);
+
+    @Select("select * from teacherteam_system.thesis where id = #{id}")
+    Thesis getById(Long id);
+
+    @Delete("delete from teacherteam_system.thesis where id = #{id}")
+    void deleteById(Long id);
+}

+ 44 - 0
teacher-serve/src/main/java/com/example/mapper/WorkMapper.java

@@ -0,0 +1,44 @@
+package com.example.mapper;
+
+import com.example.entity.Work;
+import org.apache.ibatis.annotations.*;
+
+@Mapper
+public interface WorkMapper {
+    /**
+     * 老师著作上传
+     * @param work
+     */
+    @Insert("insert into teacherteam_system.work(teacher_id, name, date, image,press,file)" +
+            "values (#{teacherId},#{name},#{date},#{image},#{press},#{file});")
+    void uploadWork(Work work);
+
+    /**
+     * 老师著作数量增加
+     * @param id
+     */
+    @Update("update teacherteam_system.teacher set work_num = teacher.work_num+1 where id = #{id}")
+    void addWorkNum(Long id);
+
+    /**
+     * 老师著作修改
+     * @param work
+     */
+    void updateWork(Work work);
+
+    /**
+     * 指定著作查询
+     *
+     * @param id
+     * @return
+     */
+    @Select("select * from teacherteam_system.work where id = #{id}")
+    Work getById(Long id);
+
+    /**
+     * 删除指定著作
+     * @param id
+     */
+    @Delete("delete from teacherteam_system.work where id = #{id}")
+    void deleteById(Long id);
+}

+ 8 - 1
teacher-serve/src/main/java/com/example/service/AwardsService.java

@@ -1,11 +1,18 @@
 package com.example.service;
 
 import com.example.dto.AwardsDTO;
+import com.example.vo.AwardsVO;
 
 public interface AwardsService {
     /**
      * 老师获奖上传
      * @param awardsDTO
      */
-    void uploadAwards(AwardsDTO awardsDTO,Integer awardsNum);
+    void uploadAwards(AwardsDTO awardsDTO);
+
+    void updateAwards(AwardsDTO awardsDTO, Long id);
+
+    AwardsVO getById(Long id);
+
+    void deleteById(Long id);
 }

+ 14 - 0
teacher-serve/src/main/java/com/example/service/ThesisService.java

@@ -0,0 +1,14 @@
+package com.example.service;
+
+import com.example.dto.ThesisDTO;
+import com.example.vo.ThesisVO;
+
+public interface ThesisService {
+    void uploadThesis(ThesisDTO thesisDTO);
+
+    void updateThesis(ThesisDTO thesisDTO, Long id);
+
+    ThesisVO getById(Long id);
+
+    void deleteById(Long id);
+}

+ 15 - 0
teacher-serve/src/main/java/com/example/service/WorkService.java

@@ -0,0 +1,15 @@
+package com.example.service;
+
+import com.example.dto.AwardsDTO;
+import com.example.dto.WorkDTO;
+import com.example.vo.WorkVO;
+
+public interface WorkService {
+    void uploadWork(WorkDTO workDTO);
+
+    void updateWork(WorkDTO workDTO, Long id);
+
+    WorkVO getById(Long id);
+
+    void deleteById(Long id);
+}

+ 43 - 2
teacher-serve/src/main/java/com/example/service/impl/AwardsServiceImpl.java

@@ -7,6 +7,7 @@ import com.example.entity.Teacher;
 import com.example.mapper.AwardsMapper;
 import com.example.mapper.TeacherMapper;
 import com.example.service.AwardsService;
+import com.example.vo.AwardsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -25,13 +26,53 @@ public class AwardsServiceImpl implements AwardsService {
      * @param awardsDTO
      */
     @Override
-    public void uploadAwards(AwardsDTO awardsDTO, Integer awardsNum) {
+    public void uploadAwards(AwardsDTO awardsDTO) {
         Awards awards = new Awards();
         BeanUtils.copyProperties(awardsDTO, awards);
-        Long id=BaseContext.getCurrentId();
+        Long id = BaseContext.getCurrentId();
         awards.setTeacherId(id);
         awardsMapper.uploadAwards(awards);
         awardsMapper.addAwardsNum(id);
 
     }
+
+    /**
+     * 老师奖项修改
+     *
+     * @param awardsDTO
+     * @param id
+     */
+    @Override
+    public void updateAwards(AwardsDTO awardsDTO, Long id) {
+        Awards awards = new Awards();
+        BeanUtils.copyProperties(awardsDTO, awards);
+        awards.setId(id);
+        awardsMapper.updateAwards(awards);
+    }
+
+    /**
+     * 获取指定奖项详细信息
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public AwardsVO getById(Long id) {
+
+        AwardsVO awardsVO = new AwardsVO();
+        Awards awards = awardsMapper.getById(id);
+        BeanUtils.copyProperties(awards,awardsVO);
+        return awardsVO;
+    }
+
+    /**
+     * 删除指定奖项
+     *
+     * @param id
+     */
+    @Override
+    public void deleteById(Long id) {
+        awardsMapper.deleteById(id);
+    }
+
 }

+ 49 - 0
teacher-serve/src/main/java/com/example/service/impl/ThesisServiceImpl.java

@@ -0,0 +1,49 @@
+package com.example.service.impl;
+
+import com.example.context.BaseContext;
+import com.example.dto.ThesisDTO;
+import com.example.entity.Awards;
+import com.example.entity.Thesis;
+import com.example.mapper.ThesisMapper;
+import com.example.service.ThesisService;
+import com.example.vo.ThesisVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ThesisServiceImpl implements ThesisService {
+
+    @Autowired
+    private ThesisMapper thesisMapper;
+    @Override
+    public void uploadThesis(ThesisDTO thesisDTO) {
+        Thesis thesis = new Thesis();
+        BeanUtils.copyProperties(thesisDTO, thesis);
+        Long id= BaseContext.getCurrentId();
+        thesis.setTeacherId(id);
+        thesisMapper.uploadThesis(thesis);
+        thesisMapper.addThesisNum(id);
+    }
+
+    @Override
+    public void updateThesis(ThesisDTO thesisDTO, Long id) {
+        Thesis thesis=new Thesis();
+        BeanUtils.copyProperties(thesisDTO,thesis);
+        thesis.setId(id);
+        thesisMapper.updateThesis(thesis);
+    }
+
+    @Override
+    public ThesisVO getById(Long id) {
+        ThesisVO thesisVO=new ThesisVO();
+        Thesis thesis=thesisMapper.getById(id);
+        BeanUtils.copyProperties(thesis,thesisVO);
+        return thesisVO;
+    }
+
+    @Override
+    public void deleteById(Long id) {
+        thesisMapper.deleteById(id);
+    }
+}

+ 73 - 0
teacher-serve/src/main/java/com/example/service/impl/WorkServiceImpl.java

@@ -0,0 +1,73 @@
+package com.example.service.impl;
+
+import com.example.context.BaseContext;
+import com.example.dto.AwardsDTO;
+import com.example.dto.WorkDTO;
+import com.example.entity.Awards;
+import com.example.entity.Work;
+import com.example.mapper.WorkMapper;
+import com.example.service.WorkService;
+import com.example.vo.WorkVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class WorkServiceImpl implements WorkService {
+
+    @Autowired
+    private WorkMapper workMapper;
+
+    /**
+     * 老师著作上传
+     *
+     * @param workDTO
+     */
+    @Override
+    public void uploadWork(WorkDTO workDTO) {
+        Work work = new Work();
+        BeanUtils.copyProperties(workDTO, work);
+        Long id = BaseContext.getCurrentId();
+        work.setTeacherId(id);
+        workMapper.uploadWork(work);
+        workMapper.addWorkNum(id);
+    }
+
+    /**
+     * 老师著作修改
+     *
+     * @param workDTO
+     * @param id
+     */
+    @Override
+    public void updateWork(WorkDTO workDTO, Long id) {
+        Work work = new Work();
+        BeanUtils.copyProperties(workDTO, work);
+        work.setId(id);
+        workMapper.updateWork(work);
+    }
+
+    /**
+     * 指定著作查询
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public WorkVO getById(Long id) {
+        WorkVO workVO = new WorkVO();
+        Work work = workMapper.getById(id);
+        BeanUtils.copyProperties(work,workVO);
+        return workVO;
+    }
+
+    /**
+     * 指定著作删除
+     *
+     * @param id
+     */
+    @Override
+    public void deleteById(Long id) {
+        workMapper.deleteById(id);
+    }
+}

+ 22 - 0
teacher-serve/src/main/resources/mapper/AwardsMapper.xml

@@ -0,0 +1,22 @@
+<?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="com.example.mapper.AwardsMapper">
+
+
+    <update id="updateAwards">
+        update teacherteam_system.awards
+        <set>
+            <if test="name != null">
+                name =#{name},
+            </if>
+            <if test="date != null">
+                date =#{date},
+            </if>
+            <if test="image != null">
+                image =#{image}
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+</mapper>

+ 27 - 0
teacher-serve/src/main/resources/mapper/ThesisMapper.xml

@@ -0,0 +1,27 @@
+<?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="com.example.mapper.ThesisMapper">
+
+    <update id="updateThesis">
+        update teacherteam_system.thesis
+        <set>
+            <if test="name != null">
+                name =#{name},
+            </if>
+            <if test="date != null">
+                date =#{date},
+            </if>
+            <if test="image != null">
+                image =#{image},
+            </if>
+            <if test="website != null">
+                website =#{website},
+            </if>
+            <if test="file != null">
+                file =#{file}
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+</mapper>

+ 28 - 0
teacher-serve/src/main/resources/mapper/WorkMapper.xml

@@ -0,0 +1,28 @@
+<?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="com.example.mapper.WorkMapper">
+
+
+    <update id="updateWork">
+        update teacherteam_system.work
+        <set>
+            <if test="name != null">
+                name =#{name},
+            </if>
+            <if test="date != null">
+                date =#{date},
+            </if>
+            <if test="image != null">
+                image =#{image},
+            </if>
+            <if test="press != null">
+                press =#{press},
+            </if>
+            <if test="file != null">
+                file =#{file}
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+</mapper>