实验记录、实验报告、用户个人中心

hehai
pd 4 years ago
parent 7d699304f2
commit 4c8c065dd4
  1. 5
      pom.xml
  2. 22
      src/main/java/com/msdw/tms/api/PersonalFileControllerApi.java
  3. 12
      src/main/java/com/msdw/tms/api/ProjectControllerApi.java
  4. 31
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  5. 17
      src/main/java/com/msdw/tms/api/UserControllerApi.java
  6. 57
      src/main/java/com/msdw/tms/common/utils/Constant.java
  7. 17
      src/main/java/com/msdw/tms/common/utils/date/DateUtils.java
  8. 73
      src/main/java/com/msdw/tms/controller/PersonalFileController.java
  9. 20
      src/main/java/com/msdw/tms/controller/ProjectController.java
  10. 61
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  11. 81
      src/main/java/com/msdw/tms/controller/UserController.java
  12. 15
      src/main/java/com/msdw/tms/dao/PersonalFileDao.java
  13. 6
      src/main/java/com/msdw/tms/dao/ProjectDao.java
  14. 16
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  15. 15
      src/main/java/com/msdw/tms/dao/UserDao.java
  16. 43
      src/main/java/com/msdw/tms/entity/PersonalFileEntity.java
  17. 9
      src/main/java/com/msdw/tms/entity/ProjectEntity.java
  18. 8
      src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java
  19. 36
      src/main/java/com/msdw/tms/entity/UserEntity.java
  20. 41
      src/main/java/com/msdw/tms/entity/request/ProjectRecordImportRequest.java
  21. 28
      src/main/java/com/msdw/tms/entity/vo/PersonalFileVo.java
  22. 9
      src/main/java/com/msdw/tms/entity/vo/ProjectEntityVo.java
  23. 59
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  24. 13
      src/main/java/com/msdw/tms/feign/UserEntityFeignService.java
  25. 12
      src/main/java/com/msdw/tms/service/PersonalFileService.java
  26. 13
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  27. 4
      src/main/java/com/msdw/tms/service/ProjectService.java
  28. 16
      src/main/java/com/msdw/tms/service/UserService.java
  29. 24
      src/main/java/com/msdw/tms/service/impl/PersonalFileServiceImpl.java
  30. 84
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  31. 37
      src/main/java/com/msdw/tms/service/impl/ProjectServiceImpl.java
  32. 39
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  33. 5
      src/main/resources/application.yml
  34. BIN
      src/main/resources/excel-template/实验报告导出.xlsx
  35. BIN
      src/main/resources/excel-template/实验报告导出模板.xlsx
  36. 32
      src/main/resources/mapper/tms/PersonalFileDao.xml
  37. 10
      src/main/resources/mapper/tms/ProjectDao.xml
  38. 94
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  39. 38
      src/main/resources/mapper/tms/UserDao.xml

@ -95,6 +95,11 @@
<artifactId>aliyun-sdk-oss</artifactId> <artifactId>aliyun-sdk-oss</artifactId>
<version>2.8.2</version> <version>2.8.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.2.3.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>

@ -0,0 +1,22 @@
package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.PersonalFileEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(value = "个人档案管理",tags = "个人档案管理")
public interface PersonalFileControllerApi {
@ApiOperation(value = "用户的全部档案",notes = "用户的全部档案")
R list(Integer userid);
@ApiOperation(value = "添加用户个人档案",notes = "添加用户个人档案")
R save(PersonalFileEntity personalFileEntity);
@ApiOperation(value = "修改用户个人档案",notes = "修改用户个人档案")
R update(PersonalFileEntity personalFileEntity);
@ApiOperation(value = "删除用户个人档案",notes = "删除用户个人档案")
R delete(Long[] ids);
}

@ -0,0 +1,12 @@
package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(value = "用户_实验学习",tags = "用户_实验学习")
public interface ProjectControllerApi {
@ApiOperation(value = "用户_实验学习实验项目",notes = "用户_实验学习实验项目")
R list(Integer userid);
}

@ -0,0 +1,31 @@
package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ProjectRecordEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletResponse;
@Api(value = "实验报告",tags = "实验报告")
public interface ProjectRcordControllerApi {
@ApiOperation(value = "服务端实验报告",notes = "服务端实验报告")
R list( Integer page, Integer size,Integer month,String startTime,String endTime,
Integer recordState,String condition);
@ApiOperation(value = "用户端实验记录",notes = "用户端实验记录")
R queryUserRecord(Integer page,Integer size,Integer userid);
@ApiOperation(value = "个人实验概览",notes = "个人实验概览")
R getUserScore(Integer userid);
@ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出")
void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception;
@ApiOperation(value = "修改实验报告分数",notes = "修改实验报告分数")
R update(ProjectRecordEntity projectRecord);
@ApiOperation(value = "删除实验报告",notes = "删除实验报告")
R delete(Integer[] recordids);
}

@ -0,0 +1,17 @@
package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.UserEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(value = "用户个人中心",tags = "用户个人中心信息展示,信息修改")
public interface UserControllerApi {
@ApiOperation(value = "个人中心信息展示",notes = "个人中心信息展示")
R userInfo(Integer id);
@ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改")
R update(UserEntity userEntity);
}

@ -342,19 +342,25 @@ public class Constant {
} }
} }
public enum Submit{
SUBMIT (1,"已提交"), /**
NOT_SUBMIT (0,"未提交"); * 项目是否提交
*/
public enum Submit {
SUBMIT(1, "已提交"),
NOT_SUBMIT(0, "未提交");
private Integer type; private Integer type;
private String desc; private String desc;
Submit(Integer type, String desc){ Submit(Integer type, String desc) {
this.type = type; this.type = type;
this.desc = desc; this.desc = desc;
}; }
;
public Integer getType() { public Integer getType() {
return type; return type;
@ -373,18 +379,33 @@ public class Constant {
} }
} }
public enum Ascription {
SYSTEM(1, "系统内置"),
USER(0, "用户自建");
private Integer type;
private String desc;
Ascription(Integer type, String desc) {
this.type = type;
this.desc = desc;
};
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getDesc() {
return desc;
}
// public static void main(String[] args) { public void setDesc(String desc) {
// String answer = "A"; this.desc = desc;
//// System.out.println(answer.length());//3 }
//// System.out.println(answer.charAt(2));//E }
//
// String str = "";
// for (int i = 0; i < answer.length(); i++) {
// char c = answer.charAt(i);
// str += c + ",";
// }
// str = str.substring(0, str.length() - 1);
// System.out.println(str);
// }
} }

@ -0,0 +1,17 @@
package com.msdw.tms.common.utils.date;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
public class DateUtils {
public static String handleTime(Date date) {
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime();
return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); // 当前日期和时间
}
}

@ -0,0 +1,73 @@
package com.msdw.tms.controller;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.PersonalFileEntity;
import com.msdw.tms.entity.vo.PersonalFileVo;
import com.msdw.tms.service.PersonalFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
@RestController
@RequestMapping("tms/personalFile")
public class PersonalFileController {
@Autowired
private PersonalFileService personalFileService;
/**
* 列表
*/
@GetMapping("/list/{userId}")
public R list(@PathVariable("userId") Integer userid){
List<PersonalFileVo> personalFileVos = personalFileService.queryPage(userid);
return R.ok().put("data", personalFileVos);
}
/**
* 信息
*/
@GetMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
PersonalFileEntity personalFileEntity = personalFileService.getById(id);
return R.ok().put("growthChangeHistory", personalFileEntity);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody PersonalFileEntity personalFileEntity){
personalFileService.save(personalFileEntity);
return R.ok();
}
/**
* 修改
*/
@PutMapping("/update")
public R update(@RequestBody PersonalFileEntity personalFileEntity){
personalFileService.updateById(personalFileEntity);
return R.ok();
}
/**
* 删除
*/
@DeleteMapping("/delete")
public R delete(@RequestBody Long[] ids){
personalFileService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -28,18 +29,29 @@ public class ProjectController {
/** /**
* 列表 * 列表
*/ */
@RequestMapping("/list") @GetMapping("/list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestParam Map<String, Object> params){
PageUtils page = projectService.queryPage(params); PageUtils page = projectService.queryPage(params);
return R.ok().put("page", page); return R.ok().put("page", page);
} }
/**
* 用户端-实验项目
* @param userId
* @return
*/
@GetMapping("/projects/info/{userid}")
public R list(@PathVariable("userid") Integer userId){
HashMap<Integer, ProjectEntity> result = projectService.list(userId);
return R.ok().put("data", result);
}
/** /**
* 信息 * 信息
*/ */
@RequestMapping("/info/{projectid}") @GetMapping("/info/{projectid}")
public R info(@PathVariable("projectid") Integer projectid){ public R info(@PathVariable("projectid") Integer projectid){
ProjectEntity project = projectService.getById(projectid); ProjectEntity project = projectService.getById(projectid);
@ -59,7 +71,7 @@ public class ProjectController {
/** /**
* 修改 * 修改
*/ */
@RequestMapping("/update") @PutMapping("/update")
public R update(@RequestBody ProjectEntity project){ public R update(@RequestBody ProjectEntity project){
projectService.updateById(project); projectService.updateById(project);
@ -69,7 +81,7 @@ public class ProjectController {
/** /**
* 删除 * 删除
*/ */
@RequestMapping("/delete") @DeleteMapping("/delete")
public R delete(@RequestBody Integer[] projectids){ public R delete(@RequestBody Integer[] projectids){
projectService.removeByIds(Arrays.asList(projectids)); projectService.removeByIds(Arrays.asList(projectids));

@ -1,15 +1,17 @@
package com.msdw.tms.controller; package com.msdw.tms.controller;
import com.msdw.tms.api.ProjectRcordControllerApi;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ProjectRecordService; import com.msdw.tms.service.ProjectRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map;
/** /**
* *
@ -20,25 +22,58 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping("fictitious/projectrecord") @RequestMapping("fictitious/projectrecord")
public class ProjectRecordController { public class ProjectRecordController implements ProjectRcordControllerApi {
@Autowired @Autowired
private ProjectRecordService projectRecordService; private ProjectRecordService projectRecordService;
/** /**
* 列表 * 服务端实验报告
*/ */
@RequestMapping("/list") @GetMapping("/schoolRecord")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month,@RequestParam String startTime,@RequestParam String endTime,
PageUtils page = projectRecordService.queryPage(params); @RequestParam Integer recordState,@RequestParam String condition ){
ProjectRecordVo recordVo = new ProjectRecordVo();
if(!StringUtils.isEmpty(month)) {
recordVo.setMonth(month);
}if(!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime);
}if(!StringUtils.isEmpty(endTime)) {
recordVo.setEndTime(endTime);
}if(!StringUtils.isEmpty(recordState)) {
recordVo.setRecordstate(recordState);
}if(!StringUtils.isEmpty(condition)){
recordVo.setCondition(condition);
}
PageUtils page1 = projectRecordService.querySchoolRecord(page,size,recordVo);
return R.ok().put("page", page1);
}
return R.ok().put("page", page); @GetMapping("/user/record")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){
PageUtils page1 = projectRecordService.queryPage(page,size,userid);
return R.ok().put("data", page1);
}
@GetMapping("/user/score/{userId}")
public R getUserScore(@PathVariable("userId") Integer userid){
ProjectRecordVo projectRecord = projectRecordService.queryUserScore(userid);
return R.ok().put("data", projectRecord);
} }
@GetMapping("/user/exportProjectRecord")
public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{
projectRecordService.exportProjectRecord(response,userId);
}
/** /**
* 信息 * 信息
*/ */
@RequestMapping("/info/{recordid}") @GetMapping("/info/{recordid}")
public R info(@PathVariable("recordid") Integer recordid){ public R info(@PathVariable("recordid") Integer recordid){
ProjectRecordEntity projectRecord = projectRecordService.getById(recordid); ProjectRecordEntity projectRecord = projectRecordService.getById(recordid);
@ -58,17 +93,17 @@ public class ProjectRecordController {
/** /**
* 修改 * 修改
*/ */
@RequestMapping("/update") @PutMapping("/update")
public R update(@RequestBody ProjectRecordEntity projectRecord){ public R update(@RequestBody ProjectRecordEntity projectRecord){
projectRecordService.updateById(projectRecord); boolean result = projectRecordService.updateUserRecord(projectRecord);
return R.ok(); return R.ok().put("data",result);
} }
/** /**
* 删除 * 删除
*/ */
@RequestMapping("/delete") @DeleteMapping("/delete")
public R delete(@RequestBody Integer[] recordids){ public R delete(@RequestBody Integer[] recordids){
projectRecordService.removeByIds(Arrays.asList(recordids)); projectRecordService.removeByIds(Arrays.asList(recordids));

@ -0,0 +1,81 @@
package com.msdw.tms.controller;
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.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
@RestController
@RequestMapping("tms/user")
public class UserController implements UserControllerApi {
@Autowired
private UserService userService;
/**
* 列表
*/
@GetMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = userService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@GetMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
UserEntity userEntity = userService.getById(id);
return R.ok().put("growthChangeHistory", userEntity);
}
@GetMapping("/userinfo/{id}")
public R userInfo(@PathVariable("id") Integer id){
UserEntityVo userEntityVo = userService.queryUserId(id);
return R.ok().put("data",userEntityVo);
}
/**
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody UserEntity userEntity){
userService.save(userEntity);
return R.ok();
}
/**
* 修改
*/
@PutMapping("/update")
public R update(@RequestBody UserEntity userEntity){
userService.updateById(userEntity);
return R.ok();
}
/**
* 删除
*/
@DeleteMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,15 @@
package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.PersonalFileEntity;
import com.msdw.tms.entity.vo.PersonalFileVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PersonalFileDao extends BaseMapper<PersonalFileEntity> {
List<PersonalFileVo> getPersonalfiles(PersonalFileEntity PersonalFileEntity);
}

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.ProjectEntity; import com.msdw.tms.entity.ProjectEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* *
* *
@ -14,4 +16,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ProjectDao extends BaseMapper<ProjectEntity> { public interface ProjectDao extends BaseMapper<ProjectEntity> {
public List<ProjectEntity> getByUserId(ProjectEntity projectEntity);
public List<ProjectEntity> querySystem(ProjectEntity projectEntity);
} }

@ -1,8 +1,14 @@
package com.msdw.tms.dao; package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* *
@ -14,4 +20,14 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> { public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<ProjectRecordVo> getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity);
List<ProjectRecordVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity);
ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel);
IPage<ProjectRecordVo> getBySchoolRecord(Page page,@Param("pro") ProjectRecordVo projectRecord);
boolean updateUserRecord(ProjectRecordEntity projectRecord);
} }

@ -0,0 +1,15 @@
package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserDao extends BaseMapper<UserEntity> {
UserEntityVo getByUserId(UserEntity userEntity);
}

@ -0,0 +1,43 @@
package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName("hr_personal_file")
public class PersonalFileEntity implements Serializable {
/**
* 个人档案id
*/
@TableId
private Integer personalfileid;
/**
* 个人职业id(1学生 2老师)
*/
private Integer personalcareerid;
/**
* 学校id
*/
private Integer schoolid;
/**
* 绑定学科id
*/
private Integer disciplineid;
/**
* 绑定专业类id
*/
private Integer professionalclassid;
/**
* 绑定专业id
*/
private Integer professionalid;
/**
* 绑定专业id
*/
private Integer userid;
}

@ -3,6 +3,7 @@ package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -14,9 +15,10 @@ import java.util.Date;
* @email * @email
* @date 2020-08-19 16:07:02 * @date 2020-08-19 16:07:02
*/ */
@Accessors(chain = true)
@Data @Data
@TableName("tms_project") @TableName("tms_project")
public class ProjectEntity implements Serializable { public class ProjectEntity implements Serializable, Comparable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -66,4 +68,9 @@ public class ProjectEntity implements Serializable {
*/ */
private Integer isdel; private Integer isdel;
@Override
public int compareTo(Object o) {
ProjectEntity projectEntity = (ProjectEntity) o;
return this.projectid - projectEntity.projectid;
}
} }

@ -1,8 +1,10 @@
package com.msdw.tms.entity; package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -15,6 +17,7 @@ import java.util.Date;
* @date 2020-08-19 16:07:02 * @date 2020-08-19 16:07:02
*/ */
@Data @Data
@Accessors(chain = true)
@TableName("tms_project_record") @TableName("tms_project_record")
public class ProjectRecordEntity implements Serializable { public class ProjectRecordEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -48,6 +51,10 @@ public class ProjectRecordEntity implements Serializable {
* 结束时间 * 结束时间
*/ */
private Date endtime; private Date endtime;
/**
* 耗时
*/
private Integer timeSum;
/** /**
* 提交时间 * 提交时间
*/ */
@ -55,6 +62,7 @@ public class ProjectRecordEntity implements Serializable {
/** /**
* 删除(0未删除 1已删除) * 删除(0未删除 1已删除)
*/ */
@TableLogic(value = "0",delval = "1")
private Integer isdel; private Integer isdel;
} }

@ -1,13 +1,19 @@
package com.msdw.tms.entity; package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Data @Data
@TableName("hr_user_info")
public class UserEntity { public class UserEntity {
//用户id //用户id
private Integer userId; @TableId
private Integer userid;
//用户姓名 //用户姓名
private String userName; private String username;
//用户账号 //用户账号
private String account; private String account;
//用户密码 //用户密码
@ -15,34 +21,36 @@ public class UserEntity {
//国家 //国家
private String countries; private String countries;
//绑定省份id //绑定省份id
private Integer provinceId; private Integer provinceid;
//绑定城市id //绑定城市id
private Integer cityId; private Integer cityid;
//创建时间 //创建时间
private String creationTime; private String creationtime;
//登陆次数 //登陆次数
private Integer logInNumber; private Integer loginnumber;
//性别 //性别
private Integer sex; private Integer sex;
//证件类型(1、身份证) //证件类型(1、身份证)
private Integer documentType; private Integer documenttype;
//身份证 //身份证
private String IDNumber; private String idnumber;
//教育程度(1、研究数及以上) //教育程度(1、研究数及以上)
private Integer educationDegree; private Integer educationdegree;
//电话 //电话
private String phone; private String phone;
//微信账号 //微信账号
private String WeChatID; private String wechatid;
//出生日期 //出生日期
private String dateBirth; private String datebirth;
//邮箱 //邮箱
private String email; private String email;
//学校id //学校id
private Integer schoolId; private Integer schoolid;
//唯一标示性账号 //唯一标示性账号
private String uniqueIdentificationAccount; private String uniqueidentificationaccount;
//用户头像路径 //用户头像路径
private String userAvatars; private String useravatars;
//是否删除
private Integer isdel;
} }

@ -0,0 +1,41 @@
package com.msdw.tms.entity.request;
import com.msdw.tms.common.utils.poi.ExcelAttribute;
import lombok.Data;
@Data
public class ProjectRecordImportRequest {
/**
* 实验项目名称
*/
@ExcelAttribute(sort = 0)
private String projectName;
/**
* 状态
*/
@ExcelAttribute(sort = 1)
private String userRecordstate;
private Integer recordstate;
/**
* 得分
*/
@ExcelAttribute(sort = 2)
private Integer score;
/**
* 耗时
*/
@ExcelAttribute(sort = 3)
private Integer timeSum;
/**
* 起始时间
*/
@ExcelAttribute(sort = 4)
private String startTime;
/**
* 结束时间
*/
@ExcelAttribute(sort = 5)
private String endTime;
}

@ -0,0 +1,28 @@
package com.msdw.tms.entity.vo;
import com.msdw.tms.entity.PersonalFileEntity;
import lombok.Data;
import java.io.Serializable;
@Data
public class PersonalFileVo extends PersonalFileEntity implements Serializable {
/**
* 学校名称
*/
private String schoolName;
/**
* 学科名称
*/
private String disciplineName;
/**
* 专业类名称
*/
private String professionalClassName;
/**
* 专业名称
*/
private String professionalName;
}

@ -1,9 +0,0 @@
package com.msdw.tms.entity.vo;
import java.io.Serializable;
public class ProjectEntityVo implements Serializable {
private Integer RoleId;
}

@ -0,0 +1,59 @@
package com.msdw.tms.entity.vo;
import com.msdw.tms.entity.ProjectRecordEntity;
import lombok.Data;
import java.io.Serializable;
@Data
public class ProjectRecordVo extends ProjectRecordEntity implements Serializable {
/**
* 实验项目名称
*/
private String projectName;
/**
* 学校名称
*/
private String SchoolName;
/**
* 用户名称
*/
private String userName;
/**
* 实验次数
*/
private Integer experimentNumber;
/**
* 总耗时
*/
private Integer totalTime;
/**
* 平均分
*/
private double avgScore;
/**
* 几个月
*/
private Integer month;
/**
* 查询条件
*/
private String condition;
/**
* 开始时间
*/
private String startTime;
/**
* 结束时间
*/
private String endTime;
/**
* 完成数量
*/
private Integer complete;
/**
* 待评分
*/
private Integer tobescored;
}

@ -0,0 +1,13 @@
package com.msdw.tms.feign;
import org.springframework.cloud.openfeign.FeignClient;
import com.msdw.tms.common.utils.R;
import org.springframework.web.bind.annotation.RequestMapping;
@FeignClient
public interface UserEntityFeignService {
@RequestMapping("userInfo/queryUserInfo")
public R getUser();
}

@ -0,0 +1,12 @@
package com.msdw.tms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.entity.PersonalFileEntity;
import com.msdw.tms.entity.vo.PersonalFileVo;
import java.util.List;
public interface PersonalFileService extends IService<PersonalFileEntity> {
List<PersonalFileVo> queryPage(Integer userid);
}

@ -3,8 +3,9 @@ package com.msdw.tms.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import java.util.Map; import javax.servlet.http.HttpServletResponse;
/** /**
* *
@ -15,6 +16,14 @@ import java.util.Map;
*/ */
public interface ProjectRecordService extends IService<ProjectRecordEntity> { public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Integer page,Integer size,Integer userid);
ProjectRecordVo queryUserScore(Integer userId);
void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception;
PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord);
boolean updateUserRecord(ProjectRecordEntity projectRecord);
} }

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.ProjectEntity; import com.msdw.tms.entity.ProjectEntity;
import java.util.List; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -18,6 +18,6 @@ public interface ProjectService extends IService<ProjectEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
public List<ProjectEntity> list(Integer page, Integer size,ProjectEntity project); HashMap<Integer, ProjectEntity> list(Integer userId);
} }

@ -0,0 +1,16 @@
package com.msdw.tms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import java.util.Map;
public interface UserService extends IService<UserEntity> {
PageUtils queryPage(Map<String, Object> params);
UserEntityVo queryUserId(Integer userId);
}

@ -0,0 +1,24 @@
package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.dao.PersonalFileDao;
import com.msdw.tms.entity.PersonalFileEntity;
import com.msdw.tms.entity.vo.PersonalFileVo;
import com.msdw.tms.service.PersonalFileService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("personalFileService")
public class PersonalFileServiceImpl extends ServiceImpl<PersonalFileDao,PersonalFileEntity> implements PersonalFileService {
@Override
public List<PersonalFileVo> queryPage(Integer userid) {
PersonalFileDao baseMapper = this.getBaseMapper();
PersonalFileEntity entity = new PersonalFileEntity();
entity.setUserid(userid);
List<PersonalFileVo> personalfiles = baseMapper.getPersonalfiles(entity);
return personalfiles;
}
}

@ -1,29 +1,95 @@
package com.msdw.tms.service.impl; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.PageUtils;
import com.msdw.tms.common.utils.Query; import com.msdw.tms.common.utils.poi.ExcelExportUtil;
import com.msdw.tms.dao.ProjectRecordDao; import com.msdw.tms.dao.ProjectRecordDao;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.request.ProjectRecordImportRequest;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ProjectRecordService; import com.msdw.tms.service.ProjectRecordService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.util.List;
import java.util.stream.Collectors;
@Service("projectRecordService") @Service("projectRecordService")
public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, ProjectRecordEntity> implements ProjectRecordService { public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, ProjectRecordEntity> implements ProjectRecordService {
@Autowired
private ProjectRecordDao baseMapper;
@Override
public PageUtils queryPage(Integer page,Integer size,Integer userid) {
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userid).setIsdel(Constant.IsDel.NOT_DEL.getType());
//分页对象
Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord);
PageUtils questionsPage = new PageUtils(projectRecordVos);
return questionsPage;
}
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public ProjectRecordVo queryUserScore(Integer userId) {
IPage<ProjectRecordEntity> page = this.page(
new Query<ProjectRecordEntity>().getPage(params),
new QueryWrapper<ProjectRecordEntity>()
);
return new PageUtils(page); Integer isdel = Constant.IsDel.NOT_DEL.getType();
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId ,isdel);
return projectRecordVo;
} }
@Override
public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{
//获取数据
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());
List<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord);
List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> {
ProjectRecordImportRequest request = new ProjectRecordImportRequest();
BeanUtils.copyProperties(project, request);
request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分");
return request;
}).collect(Collectors.toList());
//2.加载模板流数据
org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/实验报告导出模板.xlsx");
FileInputStream fis = new FileInputStream(resource.getFile());
//3、通过工具类下载文件
new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.STARTING_ROW, Constant.STYLE_INDEX).
export(response, fis, importRequests, "实验报告导出.xlsx");
}
@Override
public PageUtils querySchoolRecord(Integer page, Integer size, ProjectRecordVo projectRecord) {
//分页对象
Page<T> page1 = new Page<>(page, size);
projectRecord.setIsdel(Constant.IsDel.NOT_DEL.getType());
IPage<ProjectRecordVo> schoolRecord = this.baseMapper.getBySchoolRecord(page1, projectRecord);
PageUtils pageUtils = new PageUtils(schoolRecord);
return pageUtils;
}
@Override
public boolean updateUserRecord(ProjectRecordEntity projectRecord) {
boolean result = this.baseMapper.updateUserRecord(projectRecord);
return result;
}
} }

@ -11,13 +11,13 @@ import com.msdw.tms.entity.ProjectEntity;
import com.msdw.tms.service.ProjectService; import com.msdw.tms.service.ProjectService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.*;
import java.util.Map;
@Service("projectService") @Service("projectService")
public class ProjectServiceImpl extends ServiceImpl<ProjectDao, ProjectEntity> implements ProjectService { public class ProjectServiceImpl extends ServiceImpl<ProjectDao, ProjectEntity> implements ProjectService {
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
IPage<ProjectEntity> page = this.page( IPage<ProjectEntity> page = this.page(
@ -30,23 +30,30 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectDao, ProjectEntity> i
} }
@Override @Override
public List<ProjectEntity> list(Integer page, Integer size,ProjectEntity project) { public HashMap<Integer, ProjectEntity> list(Integer userId) {
//请求包装类 ProjectDao baseMapper = this.getBaseMapper();
QueryWrapper<ProjectEntity> queryWrapper = new QueryWrapper<>();
Integer userid = project.getUserid(); ProjectEntity project = new ProjectEntity().setUserid(userId)
queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) .setAscription(Constant.Ascription.SYSTEM.getType())
.eq("projectState", Constant.Submit.SUBMIT.getType()) .setProjectstate(Constant.Submit.SUBMIT.getType())
.eq("userId",userid); .setIsdel(Constant.IsDel.NOT_DEL.getType());
queryWrapper.select("projectId","projectName").groupBy("projectId"); List<ProjectEntity> projects = new ArrayList<>();
List<ProjectEntity> user_projects = baseMapper.getByUserId(project);
List<ProjectEntity> sys_projects = baseMapper.querySystem(project);
IPage<ProjectEntity> projects = this.page( projects.addAll(0,user_projects);
new Query<ProjectEntity>().getPage(page, size), projects.addAll(0, sys_projects);
queryWrapper
); Collections.sort(projects);
return null; HashMap<Integer, ProjectEntity> result = new HashMap<>();
for (ProjectEntity pro : projects ) {
result.put(pro.getProjectid(),pro);
} }
return result;
}
} }

@ -0,0 +1,39 @@
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.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.UserDao;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.UserService;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<UserEntity> page = this.page(
new Query<UserEntity>().getPage(params),
new QueryWrapper<UserEntity>()
);
return new PageUtils(page);
}
@Override
public UserEntityVo queryUserId(Integer userId) {
UserDao userDao = this.getBaseMapper();
UserEntity userEntity = new UserEntity();
userEntity.setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());
UserEntityVo vo = userDao.getByUserId(userEntity);
return vo;
}
}

@ -1,4 +1,6 @@
spring: spring:
jackson:
default-property-inclusion: non_null
datasource: datasource:
url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: super username: super
@ -15,6 +17,9 @@ mybatis-plus:
global-config: global-config:
db-config: db-config:
id-type: auto id-type: auto
logic-delete-field: is_del
logic-delete-value: 0
logic-not-delete-value: 1
server: server:
port: 7000 port: 7000

@ -0,0 +1,32 @@
<?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.PersonalFileDao">
<select id="getPersonalfiles" parameterType="com.msdw.tms.entity.PersonalFileEntity" resultType="com.msdw.tms.entity.vo.PersonalFileVo">
SELECT
personalFileId,
personalCareerId,
schoolName,
disciplineName,
professionalClassName,
professionalName
FROM
hr_personal_file pr,
professional pro,
professional_class proc,
discipline dis,
school sc
WHERE
pr.userId = #{userid}
AND pro.professionalClassId = proc.professionalClassId
AND proc.disciplineId = dis.disciplineId
AND pr.professionalId = pro.professionalId
AND pr.professionalClassId = proc.professionalClassId
AND pr.disciplineId = dis.disciplineId
AND pr.schoolId = sc.schoolId
AND sc.isdel= 0
</select>
</mapper>

@ -15,8 +15,16 @@
<result property="ascription" column="ascription"/> <result property="ascription" column="ascription"/>
<result property="userid" column="userId"/> <result property="userid" column="userId"/>
<result property="creationtime" column="creationTime"/> <result property="creationtime" column="creationTime"/>
<result property="isdel" column="isdel"/> <result property="isdel" column="is_del"/>
</resultMap> </resultMap>
<select id="getByUserId" parameterType="com.msdw.tms.entity.ProjectEntity" resultType="com.msdw.tms.entity.ProjectEntity">
select projectId,projectName from tms_project where userId = #{userid} and projectState = #{projectstate} and is_del=#{isdel}
</select>
<select id="querySystem" parameterType="com.msdw.tms.entity.ProjectEntity" resultType="com.msdw.tms.entity.ProjectEntity">
select projectId,projectName from tms_project where ascription = #{ascription} and projectState = #{projectstate} and is_del=#{isdel}
</select>
</mapper> </mapper>

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yipin.liuwanr.fictitious.dao.ProjectRecordDao"> <mapper namespace="com.msdw.tms.dao.ProjectRecordDao">
<!-- 可根据自己的需求,是否要使用 --> <!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.yipin.liuwanr.fictitious.entity.ProjectRecordEntity" id="projectRecordMap"> <resultMap type="com.msdw.tms.entity.ProjectRecordEntity" id="projectRecordMap">
<result property="recordid" column="recordId"/> <result property="recordid" column="recordId"/>
<result property="userid" column="userId"/> <result property="userid" column="userId"/>
<result property="projectid" column="projectId"/> <result property="projectid" column="projectId"/>
@ -12,9 +12,97 @@
<result property="recordstate" column="recordState"/> <result property="recordstate" column="recordState"/>
<result property="startingtime" column="startingTime"/> <result property="startingtime" column="startingTime"/>
<result property="endtime" column="endTime"/> <result property="endtime" column="endTime"/>
<result property="submittime" column="submitTime"/> <result property="submitTime" column="submitTime"/>
<result property="isdel" column="isdel"/> <result property="isdel" column="isdel"/>
</resultMap> </resultMap>
<select id="getByUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
tpr.projectId,
projectName,
score,
timeSum,
startingTime as startTime,
endTime,
recordState
FROM
tms_project_record tpr
LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId
WHERE
tpr.userId = #{pro.userid}
AND
tpr.isdel = #{pro.isdel}
</select>
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
tpr.projectId,
projectName,
score,
timeSum,
startingTime as startTime,
endTime,
recordState
FROM
tms_project_record tpr
LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId
WHERE
tpr.userId = #{userid}
AND
tpr.isdel = #{isdel}
</select>
<select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
userName,
count( * ) AS experimentNumber,
sum( timeSum ) AS totalTime,
avg( score ) avgScore
FROM
tms_project_record pr
LEFT JOIN hr_user_info u ON pr.userId = u.userId
WHERE
pr.userId = #{userid}
and
isdel = #{isdel}
</select>
<select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
recordId,
tpr.projectId,
projectName,
schoolName,
userName,
score,
recordState,
submitTime,
COUNT(DISTINCT CASE WHEN recordState = '1' THEN recordState END) as complete,
COUNT(DISTINCT CASE WHEN recordState = '0' THEN recordState END) as tobescored
FROM
tms_project_record tpr
LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId
LEFT JOIN hr_user_info u ON tpr.userId = u.userId
LEFT JOIN school sc ON u.schoolId = sc.schoolId
WHERE
tpr.isdel = #{pro.isdel}
and
tp.isdel = #{pro.isdel}
and
u.isdel = #{pro.isdel}
and
sc.isdel = #{pro.isdel}
<if test="pro.month!=null ">and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) &lt;= date(submitTime)</if>
<if test="pro.startTime!=null and pro.endTime!=null">and submitTime between startingtime=#{pro.startTime} and endtime=#{pro.endTime}</if>
<if test="pro.recordState!=null">and recordState=#{pro.recordState}</if>
<if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )</if>
</select>
<update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" >
update tms_project_record
set isdel = #{isdel}
<if test="recordstate!=null">,recordstate = #{recordstate}</if>
where recordId=#{recordid}
</update>
</mapper> </mapper>

@ -0,0 +1,38 @@
<?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.UserDao">
<select id="getByUserId" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo">
SELECT
userName,
sex,
countries,
p.provinceName as provinceName,
c.cityName as provinceName,
IDNumber,
educationDegree,
schoolName,
account,
phone,
email,
weChatID,
'password'
FROM
hr_user_info u,
province p,
city c,
school s
WHERE
u.userId = #{userid}
AND u.provinceId = p.provinceId
AND p.provinceId = c.provinceId
AND c.cityId = u.cityId
AND u.schoolId = s.schoolId
AND p.isdel = #{isdel}
AND c.isdel = #{isdel}
AND s.isdel = #{isdel}
</select>
</mapper>
Loading…
Cancel
Save