hehai
mzh820631607 4 years ago
parent e691bb63ba
commit 07639b6008
  1. 7
      src/main/java/com/msdw/tms/api/StudentControllerApi.java
  2. 32
      src/main/java/com/msdw/tms/controller/StudentController.java
  3. 9
      src/main/java/com/msdw/tms/dao/StudentDao.java
  4. 33
      src/main/java/com/msdw/tms/entity/StudentEntity.java
  5. 15
      src/main/java/com/msdw/tms/entity/vo/StudentVo.java
  6. 8
      src/main/java/com/msdw/tms/service/StudentService.java
  7. 12
      src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java
  8. 2
      src/main/resources/mapper/tms/ExperimentalStudentDao.xml
  9. 5
      src/main/resources/mapper/tms/StudentDao.xml

@ -0,0 +1,7 @@
package com.msdw.tms.api;
import io.swagger.annotations.Api;
@Api(value = "学生管理", tags = "学生管理")
public interface StudentControllerApi {
}

@ -0,0 +1,32 @@
package com.msdw.tms.controller;
import com.msdw.tms.api.StudentControllerApi;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.UserInfoEntity;
import com.msdw.tms.entity.vo.StudentVo;
import com.msdw.tms.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 学生管理
*/
@RestController
@RequestMapping("/tms/student")
public class StudentController implements StudentControllerApi{
@Autowired
private StudentService studentService;
@PostMapping("addStudent")
public R addStudent(StudentVo studentVo){
UserInfoEntity userInfoList = studentVo.getUserInfoList();
userInfoList.setUniqueIdentificationAccount(String.valueOf(System.currentTimeMillis()));
// studentService.addStudent(studentVo,userInfoList);
return R.ok();
}
}

@ -0,0 +1,9 @@
package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.StudentEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StudentDao extends BaseMapper<StudentEntity> {
}

@ -0,0 +1,33 @@
package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@TableName("tms_student")
@Accessors(chain = true)
public class StudentEntity {
// 学生主键id
@TableId(type = IdType.AUTO)
private Integer studentId;
// 绑定学校Id
private Integer schoolId;
//绑定用户Id
private Integer userId;
//学号
private String studentIdNumber;
//绑定专业Id
private Integer professionalId;
//绑定年级Id
private Integer gradeId;
//绑定班级Id、
private Integer classId;
//绑定角色Id
private Integer roleId;
//是否删除(0未删除,1已删除)
private Integer isdel;
}

@ -0,0 +1,15 @@
package com.msdw.tms.entity.vo;
import com.msdw.tms.entity.StudentEntity;
import com.msdw.tms.entity.UserInfoEntity;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
public class StudentVo extends StudentEntity {
private UserInfoEntity userInfoList;
}

@ -0,0 +1,8 @@
package com.msdw.tms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.entity.StudentEntity;
public interface StudentService extends IService<StudentEntity>{
}

@ -0,0 +1,12 @@
package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.dao.StudentDao;
import com.msdw.tms.entity.StudentEntity;
import com.msdw.tms.service.StudentService;
import org.springframework.stereotype.Service;
@Service("studentService")
public class StudentServiceImpl extends ServiceImpl<StudentDao,StudentEntity> implements StudentService {
}

@ -7,6 +7,6 @@
</select>
<insert id="saveCode" parameterType="com.msdw.tms.entity.ExperimentalStudentEntity">
INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{id},#{userId})
INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{projectId},#{userId})
</insert>
</mapper>

@ -0,0 +1,5 @@
<?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.msdw.tms.dao.StudentDao">
</mapper>
Loading…
Cancel
Save