Merge remote-tracking branch 'origin/master'
19个文件已修改
9个文件已添加
1 文件已重命名
| | |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.DepartmentExamine; |
| | | import com.mindskip.xzs.domain.vo.DepartmentExamineVO; |
| | | import com.mindskip.xzs.service.IDepartmentExamineService; |
| | | import com.mindskip.xzs.service.DepartmentExamineService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RequiredArgsConstructor |
| | | public class DepartmentExamineController extends BaseApiController { |
| | | |
| | | private final IDepartmentExamineService departmentExamineService; |
| | | private final DepartmentExamineService departmentExamineService; |
| | | |
| | | @RequestMapping(value = "list", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<DepartmentExamineVO>> list(@RequestBody DepartmentExamineVO departmentExamineVO) { |
| | |
| | | import com.mindskip.xzs.domain.ExamPaperSubject; |
| | | import com.mindskip.xzs.domain.Subject; |
| | | import com.mindskip.xzs.domain.exam.ExamPaperAnswerObject; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperDataVO; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO; |
| | | import com.mindskip.xzs.service.ExamPaperAnswerService; |
| | | import com.mindskip.xzs.service.ExamPaperSubjectService; |
| | |
| | | examPaperStatisticVO.setDepartmentId(ObjectUtils.isNotEmpty(examPaperStatisticVO.getDepartmentId()) ? examPaperStatisticVO.getDepartmentId() : getAdminDeptIds()); |
| | | return RestResponse.ok(examPaperAnswerService.statistic(examPaperStatisticVO)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/data", method = RequestMethod.POST) |
| | | public RestResponse<Map<String, Object>> data(@RequestBody ExamPaperDataVO examPaperDataVO) { |
| | | return RestResponse.ok(examPaperAnswerService.data(examPaperDataVO)); |
| | | } |
| | | } |
| | |
| | | List<Integer> adminDeptIds = getAdminDeptIds(); |
| | | return RestResponse.ok(examPaperService.selectStudent(userVO, adminDeptIds)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/queryCondition", method = RequestMethod.GET) |
| | | public RestResponse<List<ExamPaper>> queryCondition() { |
| | | return RestResponse.ok(examPaperService.queryCondition()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.controller.admin; |
| | | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.base.BaseApiController; |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.UserConditionExamine; |
| | | import com.mindskip.xzs.domain.vo.UserConditionExamineVO; |
| | | import com.mindskip.xzs.service.UserConditionExamineService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/admin/userCondition/examine") |
| | | @RequiredArgsConstructor |
| | | public class UserConditionExamineController extends BaseApiController { |
| | | |
| | | private final UserConditionExamineService userConditionExamineService; |
| | | |
| | | @RequestMapping(value = "list", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<UserConditionExamineVO>> list(@RequestBody UserConditionExamineVO userConditionExamineVO) { |
| | | userConditionExamineVO.setDeptIds(ObjectUtils.isNotEmpty(userConditionExamineVO.getDeptIds()) ? userConditionExamineVO.getDeptIds() : getAdminDeptIds()); |
| | | return RestResponse.ok(userConditionExamineService.pageInfo(userConditionExamineVO)); |
| | | } |
| | | |
| | | @RequestMapping(value = "save", method = RequestMethod.POST) |
| | | public RestResponse<Boolean> save(@RequestBody UserConditionExamine userConditionExamine) { |
| | | userConditionExamine.setCreateTime(LocalDateTime.now()); |
| | | userConditionExamine.setCreateUser(getCurrentUser().getId()); |
| | | return RestResponse.ok(userConditionExamineService.save(userConditionExamine)); |
| | | } |
| | | |
| | | @RequestMapping(value = "delete/{id}", method = RequestMethod.POST) |
| | | public RestResponse<Boolean> delete(@PathVariable Integer id) { |
| | | return RestResponse.ok(userConditionExamineService.removeById(id)); |
| | | } |
| | | |
| | | @RequestMapping(value = "audit", method = RequestMethod.POST) |
| | | public RestResponse<Boolean> audit(@RequestBody UserConditionExamineVO userConditionExamine) { |
| | | return RestResponse.ok(userConditionExamineService.audit(userConditionExamine)); |
| | | } |
| | | |
| | | } |
| | |
| | | return RestResponse.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/setStatus", method = RequestMethod.POST) |
| | | public RestResponse<String> setStatus(@RequestBody UserVO user) { |
| | | userService.setStatus(user); |
| | | return RestResponse.ok("操作成功"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.mindskip.xzs.domain.enums.UserConditionEnum; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况审核表 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_condition_examine") |
| | | public class UserConditionExamine implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * 目标状况 |
| | | */ |
| | | private UserConditionEnum targetCondition; |
| | | |
| | | /** |
| | | * 原始状况 |
| | | */ |
| | | private UserConditionEnum sourceCondition; |
| | | |
| | | /** |
| | | * 附件 |
| | | */ |
| | | private String attachment; |
| | | |
| | | /** |
| | | * 调动原因 |
| | | */ |
| | | private String reason; |
| | | |
| | | /** |
| | | * 审核结果 |
| | | */ |
| | | private UserConditionEnum result; |
| | | |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | private Integer createUser; |
| | | |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableLogic |
| | | private Boolean deleted; |
| | | |
| | | |
| | | } |
| | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 用户状态 |
| | | * 部门审核状态 |
| | | * |
| | | * @author gonghl |
| | | */ |
New file |
| | |
| | | package com.mindskip.xzs.domain.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 用户审核状态 |
| | | * |
| | | * @author gonghl |
| | | */ |
| | | @Getter |
| | | public enum UserConditionExamineEnum { |
| | | |
| | | WAIT("0", "待审核"), |
| | | PASS("1", "审核通过"), |
| | | OVERRULE("2", "审核驳回"), |
| | | ; |
| | | |
| | | |
| | | @EnumValue // 标明该字段存入数据库 |
| | | private final String code; |
| | | |
| | | @JsonValue // 标明在转JSON时使用该字段,即响应时 |
| | | private final String desc; |
| | | |
| | | UserConditionExamineEnum(String code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private Integer pageSize; |
| | | |
| | | /** |
| | | * 部门管理员只看自己的记录 |
| | | */ |
| | | private List<Integer> deptIds; |
| | | |
| | | /** |
New file |
| | |
| | | package com.mindskip.xzs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @author gonghl |
| | | * @since 2024/5/23 |
| | | */ |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class ExamPaperDataVO { |
| | | |
| | | private Integer id; |
| | | |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.mindskip.xzs.domain.enums.DepartmentExamineEnum; |
| | | import com.mindskip.xzs.domain.enums.UserConditionEnum; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况审核表 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | public class UserConditionExamineVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | private String userName; |
| | | |
| | | /** |
| | | * 目标状况 |
| | | */ |
| | | private UserConditionEnum targetCondition; |
| | | |
| | | /** |
| | | * 原始状况 |
| | | */ |
| | | private UserConditionEnum sourceCondition; |
| | | |
| | | /** |
| | | * 附件 |
| | | */ |
| | | private String attachment; |
| | | |
| | | /** |
| | | * 调动原因 |
| | | */ |
| | | private String reason; |
| | | |
| | | private Integer createUser; |
| | | private String createUserName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 审核结果 |
| | | */ |
| | | private DepartmentExamineEnum result; |
| | | |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | private Boolean deleted; |
| | | |
| | | private Integer pageIndex; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | /** |
| | | * 部门管理员只看自己的记录 |
| | | */ |
| | | private List<Integer> deptIds; |
| | | |
| | | } |
| | |
| | | import com.mindskip.xzs.domain.ExamTemplatesUserCount; |
| | | import com.mindskip.xzs.domain.ScoreTemplatesUserCount; |
| | | import com.mindskip.xzs.domain.other.KeyValue; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperDataVO; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO; |
| | | import com.mindskip.xzs.domain.vo.ExamTemplatesVO; |
| | | import com.mindskip.xzs.domain.vo.TeamplatesUserExcelVO; |
| | |
| | | |
| | | void insertDefault(ExamPaperEditRequestVM model); |
| | | |
| | | void insertDefaultByTemplate(ExamTemplatesVO model); |
| | | |
| | | Map<String, Object> histogram(ExamPaperStatisticVO examPaperStatisticVO); |
| | | |
| | | Map<String, Object> pieChart(ExamPaperStatisticVO examPaperStatisticVO); |
| | | |
| | | List<Map<String, Object>> dataByTemplate(ExamPaperDataVO examPaperDataVO); |
| | | |
| | | Map<String, Object> totalByTemplate(ExamPaperDataVO examPaperDataVO); |
| | | |
| | | List<Map<String, Object>> dataByPaper(ExamPaperDataVO examPaperDataVO); |
| | | |
| | | Map<String, Object> totalByPaper(ExamPaperDataVO examPaperDataVO); |
| | | } |
| | |
| | | List<UserVO> selectStudent(UserVO userVO); |
| | | |
| | | List<Integer> getExamPaperByTemplateId(ExamTemplatesVO model); |
| | | |
| | | List<ExamPaper> getExamPaper(); |
| | | |
| | | List<ExamPaper> getTemplate(); |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.repository; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mindskip.xzs.domain.UserConditionExamine; |
| | | import com.mindskip.xzs.domain.vo.UserConditionExamineVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况审核表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | @Mapper |
| | | public interface UserConditionExamineMapper extends BaseMapper<UserConditionExamine> { |
| | | |
| | | List<UserConditionExamineVO> pageInfo(UserConditionExamineVO userConditionExamineVO); |
| | | } |
| | |
| | | import com.mindskip.xzs.domain.User; |
| | | import com.mindskip.xzs.domain.other.KeyValue; |
| | | import com.mindskip.xzs.domain.vo.UpdateDeptAdminVO; |
| | | import com.mindskip.xzs.domain.vo.UserVO; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradeQuery; |
| | | import com.mindskip.xzs.viewmodel.admin.user.UserPageRequestVM; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | |
| | | List<ExamPaperAnswer> getUserByDept(@Param("query") ExamPaperGradeQuery query); |
| | | |
| | | void setStatus(UserVO user); |
| | | void setStatus(User user); |
| | | |
| | | /** |
| | | * 清除某部门的用户管理员标识 |
File was renamed from src/main/java/com/mindskip/xzs/service/IDepartmentExamineService.java |
| | |
| | | * @author gonghl |
| | | * @since 2024-05-13 |
| | | */ |
| | | public interface IDepartmentExamineService extends IService<DepartmentExamine> { |
| | | public interface DepartmentExamineService extends IService<DepartmentExamine> { |
| | | |
| | | PageInfo<DepartmentExamineVO> pageInfo(DepartmentExamineVO departmentExamineVO); |
| | | |
| | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.domain.*; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperDataVO; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradePageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradeQuery; |
| | |
| | | PageInfo<ExamPaperAnswer> getByCreatUser(ExamPaperGradeQuery query); |
| | | |
| | | Map<String, Object> statistic(ExamPaperStatisticVO examPaperStatisticVO); |
| | | |
| | | Map<String, Object> data(ExamPaperDataVO examPaperDataVO); |
| | | } |
| | |
| | | PageInfo<UserVO> selectStudent(UserVO userVO, List<Integer> adminDeptIds); |
| | | |
| | | void missExamByTemplateId(ExamTemplatesVO model); |
| | | |
| | | /** |
| | | * 考试统计的查询条件 |
| | | * @return 试卷id、名称、类型 |
| | | */ |
| | | List<ExamPaper> queryCondition(); |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.domain.UserConditionExamine; |
| | | import com.mindskip.xzs.domain.vo.UserConditionExamineVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况表 服务类 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | public interface UserConditionExamineService extends IService<UserConditionExamine> { |
| | | |
| | | PageInfo<UserConditionExamineVO> pageInfo(UserConditionExamineVO userConditionExamineVO); |
| | | |
| | | Boolean audit(UserConditionExamineVO userConditionExamine); |
| | | } |
| | |
| | | import com.mindskip.xzs.domain.ExamPaper; |
| | | import com.mindskip.xzs.domain.User; |
| | | import com.mindskip.xzs.domain.other.KeyValue; |
| | | import com.mindskip.xzs.domain.vo.UserVO; |
| | | import com.mindskip.xzs.viewmodel.admin.user.UserPageRequestVM; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | User getUserByRealName(String realName); |
| | | |
| | | void setStatus(UserVO user); |
| | | void setStatus(User user); |
| | | |
| | | User getUserByExam(ExamPaper examPaper); |
| | | |
| | |
| | | import com.mindskip.xzs.domain.DepartmentExamine; |
| | | import com.mindskip.xzs.domain.vo.DepartmentExamineVO; |
| | | import com.mindskip.xzs.repository.DepartmentExamineMapper; |
| | | import com.mindskip.xzs.service.IDepartmentExamineService; |
| | | import com.mindskip.xzs.service.DepartmentExamineService; |
| | | import com.mindskip.xzs.service.UserDepartMentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class DepartmentExamineServiceImpl extends ServiceImpl<DepartmentExamineMapper, DepartmentExamine> implements IDepartmentExamineService { |
| | | public class DepartmentExamineServiceImpl extends ServiceImpl<DepartmentExamineMapper, DepartmentExamine> implements DepartmentExamineService { |
| | | |
| | | private final UserDepartMentService userDepartMentService; |
| | | |
| | |
| | | import com.mindskip.xzs.domain.other.ExamPaperAnswerUpdate; |
| | | import com.mindskip.xzs.domain.other.KeyValue; |
| | | import com.mindskip.xzs.domain.task.TaskItemAnswerObject; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperDataVO; |
| | | import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO; |
| | | import com.mindskip.xzs.repository.ExamPaperAnswerMapper; |
| | | import com.mindskip.xzs.repository.ExamPaperMapper; |
| | |
| | | map.put("examPeopleNum", examPeopleNum); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> data(ExamPaperDataVO examPaperDataVO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 随机试卷 |
| | | if (Objects.equals(examPaperDataVO.getType(), 7)) { |
| | | map.put("data", examPaperAnswerMapper.dataByTemplate(examPaperDataVO)); |
| | | map.put("total", examPaperAnswerMapper.totalByTemplate(examPaperDataVO)); |
| | | } |
| | | // 普通试卷 |
| | | else { |
| | | map.put("data", examPaperAnswerMapper.dataByPaper(examPaperDataVO)); |
| | | map.put("total", examPaperAnswerMapper.totalByPaper(examPaperDataVO)); |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | return PageHelper.startPage(userVO.getPageIndex(), userVO.getPageSize()).doSelectPageInfo(() -> |
| | | examPaperMapper.selectStudent(userVO)); |
| | | } |
| | | |
| | | @Override |
| | | public List<ExamPaper> queryCondition() { |
| | | List<ExamPaper> examPaperList = examPaperMapper.getExamPaper(); |
| | | List<ExamPaper> templateList = examPaperMapper.getTemplate(); |
| | | examPaperList.addAll(templateList); |
| | | return examPaperList.stream().sorted(Comparator.comparing(ExamPaper::getCreateTime).reversed()).collect(Collectors.toList()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mindskip.xzs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.domain.User; |
| | | import com.mindskip.xzs.domain.UserConditionExamine; |
| | | import com.mindskip.xzs.domain.vo.UserConditionExamineVO; |
| | | import com.mindskip.xzs.repository.UserConditionExamineMapper; |
| | | import com.mindskip.xzs.service.UserConditionExamineService; |
| | | import com.mindskip.xzs.service.UserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户状况表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author gonghl |
| | | * @since 2024-05-22 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class UserConditionExamineServiceImpl extends ServiceImpl<UserConditionExamineMapper, UserConditionExamine> implements UserConditionExamineService { |
| | | |
| | | private final UserService userService; |
| | | |
| | | @Override |
| | | public PageInfo<UserConditionExamineVO> pageInfo(UserConditionExamineVO userConditionExamineVO) { |
| | | return PageHelper.startPage(userConditionExamineVO.getPageIndex(), userConditionExamineVO.getPageSize(), "id desc").doSelectPageInfo(() -> |
| | | baseMapper.pageInfo(userConditionExamineVO) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean audit(UserConditionExamineVO userConditionExamine) { |
| | | // 审核通过修改状况 |
| | | if ("1".equals(userConditionExamine.getResult().getCode())) { |
| | | User user = new User(); |
| | | user.setId(userConditionExamine.getUserId()); |
| | | user.setCondition(userConditionExamine.getTargetCondition()); |
| | | userService.setStatus(user); |
| | | } |
| | | return new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .eq(UserConditionExamine::getId, userConditionExamine.getId()) |
| | | .set(UserConditionExamine::getResult, userConditionExamine.getResult()) |
| | | .set(UserConditionExamine::getRemark, userConditionExamine.getRemark()) |
| | | .update(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void setStatus(UserVO user) { |
| | | public void setStatus(User user) { |
| | | userMapper.setStatus(user); |
| | | } |
| | | |
| | |
| | | GROUP BY user_id) d ON a.user_id = d.user_id |
| | | </select> |
| | | |
| | | <insert id="insertDefault"> |
| | | INSERT INTO t_exam_paper_answer(exam_paper_id, paper_name, paper_type, system_score, user_score, paper_score, question_correct, question_count, do_time, status, |
| | | create_user, create_time, invalid) |
| | | SELECT |
| | | a.id, a.name, a.paper_type, 0, 0, a.score, 0, a.question_count, 0, 2, b.user_id, NOW(), 0 |
| | | FROM t_exam_paper a |
| | | left join t_exam_paper_user b on a.id = b.exam_paper_id and b.deleted = 0 |
| | | left join t_exam_paper_answer c on a.id = c.exam_paper_id and c.create_user = b.user_id |
| | | WHERE a.id = #{examPaperId} |
| | | and c.id is null |
| | | and b.user_id not in |
| | | <foreach collection="userIds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </insert> |
| | | <insert id="insertDefault"> |
| | | INSERT INTO t_exam_paper_answer(exam_paper_id, paper_name, paper_type, system_score, user_score, paper_score, question_correct, question_count, do_time, status, |
| | | create_user, create_time, invalid) |
| | | SELECT |
| | | a.id, a.name, a.paper_type, 0, 0, a.score, 0, a.question_count, 0, 2, b.user_id, NOW(), 0 |
| | | FROM t_exam_paper a |
| | | left join t_exam_paper_user b on a.id = b.exam_paper_id and b.deleted = 0 |
| | | left join t_exam_paper_answer c on a.id = c.exam_paper_id and c.create_user = b.user_id |
| | | WHERE a.id = #{examPaperId} |
| | | and c.id is null |
| | | and b.user_id not in |
| | | <foreach collection="userIds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="dataByTemplate" resultType="java.util.Map" parameterType="com.mindskip.xzs.domain.vo.ExamPaperDataVO"> |
| | | SELECT |
| | | a.id, |
| | | a.name, |
| | | COUNT(DISTINCT c.create_user) as factPeopleTotal, -- 参考人数 |
| | | IFNULL(ROUND(AVG(c.user_score), 2), 0) as averageScore, -- 平均成绩 |
| | | IFNULL(ROUND((COUNT(DISTINCT c.create_user) * 100.0 / COUNT(DISTINCT d.user_id)), 2), 0) AS referencePercentage -- 参考百分比 |
| | | FROM |
| | | t_department a |
| | | LEFT JOIN t_user_department b ON a.id = b.department_id |
| | | LEFT JOIN t_exam_templates_user d ON d.user_id = b.user_id AND d.templates_id = #{id} |
| | | LEFT JOIN t_exam_templates_user_count e ON d.templates_id = e.exam_templates_id |
| | | LEFT JOIN t_exam_paper_answer c ON d.user_id = c.create_user AND e.exam_paper_id = c.exam_paper_id AND (c.invalid = 0 OR c.invalid IS NULL) |
| | | GROUP BY |
| | | a.id, a.name |
| | | </select> |
| | | |
| | | <select id="totalByTemplate" resultType="java.util.Map" parameterType="com.mindskip.xzs.domain.vo.ExamPaperDataVO"> |
| | | SELECT |
| | | (SELECT (SELECT count(*) FROM t_exam_paper) + (SELECT count(*) FROM t_exam_templates)) as examTotal, -- 总考试次数 |
| | | COUNT(DISTINCT c.create_user) as factPeopleTotal, -- 参考人数 |
| | | IFNULL(ROUND(AVG(c.user_score), 2), 0) as averageScore, -- 平均成绩 |
| | | IFNULL(ROUND((COUNT(DISTINCT c.create_user) * 100.0 / COUNT(DISTINCT d.user_id)), 2), 0) AS referencePercentage -- 参考百分比 |
| | | FROM |
| | | t_exam_templates a |
| | | LEFT JOIN t_exam_templates_user d ON d.templates_id = a.id |
| | | LEFT JOIN t_exam_templates_user_count e ON d.templates_id = e.exam_templates_id |
| | | LEFT JOIN t_exam_paper_answer c ON d.user_id = c.create_user AND e.exam_paper_id = c.exam_paper_id AND (c.invalid = 0 OR c.invalid IS NULL) |
| | | WHERE a.id = #{id} |
| | | GROUP BY |
| | | a.id |
| | | </select> |
| | | |
| | | <select id="dataByPaper" resultType="java.util.Map" parameterType="com.mindskip.xzs.domain.vo.ExamPaperDataVO"> |
| | | SELECT |
| | | a.id, |
| | | a.name, |
| | | COUNT(DISTINCT c.create_user) as factPeopleTotal, -- 参考人数 |
| | | IFNULL(ROUND(AVG(c.user_score), 2), 0) as averageScore, -- 平均成绩 |
| | | IFNULL(ROUND((COUNT(DISTINCT c.create_user) * 100.0 / COUNT(DISTINCT d.user_id)), 2), 0) AS referencePercentage -- 参考百分比 |
| | | FROM |
| | | t_department a |
| | | LEFT JOIN t_user_department b ON a.id = b.department_id |
| | | LEFT JOIN t_exam_paper_answer c ON b.user_id = c.create_user AND (c.invalid = 0 OR c.invalid IS NULL) AND c.exam_paper_id = #{id} |
| | | LEFT JOIN t_exam_paper_user d ON c.exam_paper_id = d.exam_paper_id and b.user_id = d.user_id |
| | | GROUP BY |
| | | a.id, a.name |
| | | </select> |
| | | |
| | | <select id="totalByPaper" resultType="java.util.Map" parameterType="com.mindskip.xzs.domain.vo.ExamPaperDataVO"> |
| | | SELECT |
| | | (SELECT (SELECT count(*) FROM t_exam_paper) + (SELECT count(*) FROM t_exam_templates)) as examTotal, -- 总考试次数 |
| | | count(DISTINCT b.create_user) AS factPeopleTotal, -- 参考数 |
| | | IFNULL(ROUND(avg(user_score), 2), 0) as averageScore, -- 平均分 |
| | | IFNULL(ROUND((COUNT(DISTINCT b.create_user) * 100.0 / COUNT(DISTINCT c.user_id)), 2), 0) AS referencePercentage -- 参考百分比 |
| | | FROM t_exam_paper a |
| | | LEFT JOIN t_exam_paper_answer b ON a.id = b.exam_paper_id AND (b.invalid = 0 OR b.invalid IS NULL) |
| | | LEFT JOIN t_exam_paper_user c ON a.id = c.exam_paper_id |
| | | WHERE a.id = #{id} |
| | | GROUP BY a.id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | select exam_paper_id from t_exam_templates_user_count where exam_templates_id = #{id} |
| | | </select> |
| | | |
| | | <select id="getExamPaper" resultType="com.mindskip.xzs.domain.ExamPaper"> |
| | | select id, name, paper_type, create_time from t_exam_paper where paper_type != 7 order by create_time desc |
| | | </select> |
| | | |
| | | <select id="getTemplate" resultType="com.mindskip.xzs.domain.ExamPaper"> |
| | | select id, name, paper_type, ctime as create_time from t_exam_templates order by ctime desc |
| | | </select> |
| | | |
| | | </mapper> |
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="com.mindskip.xzs.repository.UserConditionExamineMapper"> |
| | | |
| | | <select id="pageInfo" resultType="com.mindskip.xzs.domain.vo.UserConditionExamineVO"> |
| | | SELECT |
| | | a.* , |
| | | b1.real_name as userName, |
| | | b2.real_name as createUserName |
| | | FROM |
| | | t_user_condition_examine a |
| | | LEFT JOIN t_user b1 ON a.user_id = b1.id |
| | | LEFT JOIN t_user b2 ON a.create_user = b2.id |
| | | iNNER JOIN t_user_department c ON a.user_id = c.user_id |
| | | <if test="deptIds != null and deptIds.size() > 0"> |
| | | AND c.department_id IN |
| | | <foreach collection="deptIds" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | WHERE |
| | | a.deleted = 0 |
| | | <if test="userName != null"> |
| | | AND b1.real_name LIKE concat('%', #{userName}, '%') |
| | | </if> |
| | | GROUP BY a.id, a.create_time |
| | | ORDER BY a.create_time |
| | | </select> |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <update id="setStatus"> |
| | | UPDATE t_user |
| | | SET `condition` = #{condition}, |
| | | `condition_detail` = #{conditionDetail} |
| | | WHERE id = #{id} |
| | | AND deleted = 0 |
| | | UPDATE t_user |
| | | SET `condition` = #{condition} |
| | | WHERE id = #{id} |
| | | AND deleted = 0 |
| | | </update> |
| | | |
| | | <update id="clearDeptAdmin"> |