Forráskód Böngészése

组卷条件接口

mingfu 1 hónapja
szülő
commit
3435ab6383

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzCardsController.java

@@ -34,7 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/dz/cards")
-@Api("后台-学习卡管理")
+@Api(tags = "后台-学习卡管理")
 public class DzCardsController extends BaseController
 {
     @Autowired

+ 22 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzControlController.java

@@ -1,7 +1,13 @@
 package com.ruoyi.web.controller.dz;
 
 import java.util.List;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.ruoyi.common.annotation.Anonymous;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -29,6 +35,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/dz/control")
+@Api(tags = "后台-基础-控制")
 public class DzControlController extends BaseController
 {
     @Autowired
@@ -101,4 +108,19 @@ public class DzControlController extends BaseController
     {
         return toAjax(dzControlService.deleteDzControlByIds(ids));
     }
+
+    @GetMapping(value = "provinces")
+    @Anonymous
+    @ApiOperation("1. 省份列表")
+    public AjaxResult provinces()
+    {
+        DzControl cond = new DzControl();
+        cond.setIsValid(1);
+        return AjaxResult.success(dzControlService.selectDzControlList(cond).stream().map(t -> {
+            JSONObject o = new JSONObject();
+            o.put("dictValue", t.getLocation());
+            o.put("dictLabel", t.getLocation());
+            return o;
+        }).collect(Collectors.toList()));
+    }
 }

+ 118 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/learn/LearnTeacherController.java

@@ -0,0 +1,118 @@
+package com.ruoyi.web.controller.learn;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.AjaxResult2;
+import com.ruoyi.common.enums.ExamType;
+import com.ruoyi.dz.domain.DzControl;
+import com.ruoyi.dz.domain.DzSubject;
+import com.ruoyi.dz.service.IDzControlService;
+import com.ruoyi.dz.service.IDzSubjectService;
+import com.ruoyi.ie.service.IAMarjorPlanService;
+import com.ruoyi.learn.domain.TestPaperVO;
+import com.ruoyi.web.service.LearnTeacherService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/learn/teaching")
+@Api(tags = "后台-学习 - 老师业务")
+public class LearnTeacherController extends BaseController {
+    private final IDzControlService dzControlService;
+    private final IDzSubjectService dzSubjectService;
+    private final LearnTeacherService learnTeacherService;
+    private final IAMarjorPlanService marjorPlanService;
+
+    public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, IAMarjorPlanService marjorPlanService) {
+        this.dzControlService = dzControlService;
+        this.dzSubjectService = dzSubjectService;
+        this.learnTeacherService = learnTeacherService;
+        this.marjorPlanService = marjorPlanService;
+    }
+
+    /**
+     -- 1. 查询考试批次(假设每个老师自已控制)
+     -- 2. 查询班老师班级列表
+     -- 3. 查询定向院校列表
+     -- 5. 查询定向院校专业组
+     -- 6. 查询科目(分是否定向)
+     -- 7. 查询知识点(分是否定向)
+     -- 8. 查询单个定向时知识点树
+     -- 9. 设置题型数量(预置题型要求,或人工指定,不指定时平均分配, 题型是针对院校的)
+     */
+
+    @GetMapping("/classes")
+    @ApiOperation("2. 班级列表")
+    public AjaxResult classes()
+    {
+        return AjaxResult.success(learnTeacherService.getClasses(getUserId()));
+    }
+
+    @GetMapping("/universities")
+    @ApiOperation("院校列表")
+    public AjaxResult universities()
+    {
+        return AjaxResult.success(learnTeacherService.selectUniversityList(getUserId()));
+    }
+
+    @GetMapping("/majors")
+    @ApiOperation("专业列表")
+    public AjaxResult majors(@ApiParam("省份") String location, @ApiParam("考生类型") ExamType examType, @RequestParam(required = false) @ApiParam("院校列表") Long universityId)
+    {
+        DzControl control = dzControlService.selectDzControl(location, examType);
+        return AjaxResult.success(learnTeacherService.selectMajorList(universityId, control.getPlanYear()));
+    }
+
+    @GetMapping("/subjects")
+    @ApiOperation("科目列表")
+    public AjaxResult2<List<DzSubject>> subjects(@RequestParam(required = false) @ApiParam("院校列表") Long universityId)
+    {
+        DzSubject sCond = new DzSubject();
+        List<DzSubject> list = dzSubjectService.selectDzSubjectList(sCond);
+        return AjaxResult2.success(list);
+    }
+
+    @GetMapping("/knowledges")
+    @ApiOperation("知识点列表")
+    public AjaxResult knowledges(@ApiParam("科目ID") Long subjectId, @RequestParam(required = false) @ApiParam("专业计划ID") Long[] majorPlanIds)
+    {
+        return AjaxResult.success(learnTeacherService.getKnowledgeTree(subjectId, majorPlanIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('learn:test_paper:add')")
+    @PostMapping("/build")
+    @ApiOperation("批量组卷")
+    public AjaxResult batchBuild(@RequestBody TestPaperVO.TestPapersBuildReq req)
+    {
+        return toAjax(true);
+    }
+
+    @PreAuthorize("@ss.hasPermi('learn:test_paper:query')")
+    @GetMapping("/publish")
+    @ApiOperation("批量发布查询")
+    public AjaxResult batchQuery(@RequestBody TestPaperVO.TestPapersQueryReq req)
+    {
+        return AjaxResult.success(true);
+    }
+
+    @PreAuthorize("@ss.hasPermi('learn:test_paper:add')")
+    @PostMapping("/publish/papers")
+    @ApiOperation("批量发布生成")
+    public AjaxResult publishBatch(@RequestBody TestPaperVO.TestPapersPublishReq req)
+    {
+        return toAjax(true);
+    }
+
+    @PreAuthorize("@ss.hasPermi('learn:test_paper:add')")
+    @PostMapping("/publish/paper")
+    @ApiOperation("批量发布生成")
+    public AjaxResult publishSingle(@RequestBody TestPaperVO.TestPaperPublishReq req)
+    {
+        return toAjax(true);
+    }
+}

+ 9 - 4
ie-admin/src/main/java/com/ruoyi/web/controller/learn/LearnTestController.java

@@ -4,6 +4,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/learn/test")
-@Api("后台-学习 - 批次")
+@Api(tags = "后台-学习 - 批次")
 public class LearnTestController extends BaseController
 {
     @Autowired
@@ -42,11 +43,11 @@ public class LearnTestController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('learn:test:list')")
     @GetMapping("/list")
-    public TableDataInfo list(LearnTest learnTest)
+    @ApiOperation("列表")
+    public AjaxResult list(LearnTest learnTest)
     {
-        startPage();
         List<LearnTest> list = learnTestService.selectLearnTestList(learnTest);
-        return getDataTable(list);
+        return AjaxResult.success(list);
     }
 
     /**
@@ -78,8 +79,10 @@ public class LearnTestController extends BaseController
     @PreAuthorize("@ss.hasPermi('learn:test:add')")
     @Log(title = "试卷批次", businessType = BusinessType.INSERT)
     @PostMapping
+    @ApiOperation("新增")
     public AjaxResult add(@RequestBody LearnTest learnTest)
     {
+        learnTest.setCreatorId(getUserId());
         return toAjax(learnTestService.insertLearnTest(learnTest));
     }
 
@@ -89,6 +92,7 @@ public class LearnTestController extends BaseController
     @PreAuthorize("@ss.hasPermi('learn:test:edit')")
     @Log(title = "试卷批次", businessType = BusinessType.UPDATE)
     @PutMapping
+    @ApiOperation("修改")
     public AjaxResult edit(@RequestBody LearnTest learnTest)
     {
         return toAjax(learnTestService.updateLearnTest(learnTest));
@@ -100,6 +104,7 @@ public class LearnTestController extends BaseController
     @PreAuthorize("@ss.hasPermi('learn:test:remove')")
     @Log(title = "试卷批次", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{batchIds}")
+    @ApiOperation("删除")
     public AjaxResult remove(@PathVariable String[] batchIds)
     {
         return toAjax(learnTestService.deleteLearnTestByBatchIds(batchIds));

+ 74 - 0
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -0,0 +1,74 @@
+package com.ruoyi.web.service;
+
+import cn.hutool.core.lang.Dict;
+import com.ruoyi.common.core.domain.TreeEntity;
+import com.ruoyi.dz.domain.DzClasses;
+import com.ruoyi.dz.mapper.DzClassesMapper;
+import com.ruoyi.ie.mapper.AMarjorPlanMapper;
+import com.ruoyi.learn.domain.LearnKnowledgeTree;
+import com.ruoyi.learn.mapper.LearnKnowledgeTreeMapper;
+import com.ruoyi.syzy.domain.BBusiWishUniversities;
+import com.ruoyi.syzy.mapper.BBusiWishUniversitiesMapper;
+import lombok.Data;
+import org.apache.commons.compress.utils.Lists;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class LearnTeacherService {
+    private final DzClassesMapper dzClassesMapper;
+    private final LearnKnowledgeTreeMapper learnKnowledgeTreeMapper;
+    private final AMarjorPlanMapper marjorPlanMapper;
+    private final BBusiWishUniversitiesMapper busiWishUniversitiesMapper;
+
+    public LearnTeacherService(DzClassesMapper dzClassesMapper, LearnKnowledgeTreeMapper learnKnowledgeTreeMapper, AMarjorPlanMapper marjorPlanMapper, BBusiWishUniversitiesMapper busiWishUniversitiesMapper) {
+        this.dzClassesMapper = dzClassesMapper;
+        this.learnKnowledgeTreeMapper = learnKnowledgeTreeMapper;
+        this.marjorPlanMapper = marjorPlanMapper;
+        this.busiWishUniversitiesMapper = busiWishUniversitiesMapper;
+    }
+
+    public List<DzClasses> getClasses(Long teacherId)
+    {
+        return dzClassesMapper.selectClassesForTeacher(teacherId);
+    }
+
+    public List<BBusiWishUniversities> selectUniversityList(Long teacherId) {
+        return busiWishUniversitiesMapper.selectUniversityListForTeacher(teacherId);
+    }
+
+    public List<Dict> selectMajorList(Long universityId, Integer year) {
+        return marjorPlanMapper.selectMajorForUniversity(universityId, year).stream().map(t -> Dict.create().set("id", t.getId()).set("majorGroup", t.getMajorGroup())
+                .set("majorName", t.getMajorName()).set("count", t.getPlanTotal())).collect(Collectors.toList());
+    }
+
+    public List<TreeNode> getKnowledgeTree(Long subjectId, Long[] planIds) {
+        LearnKnowledgeTree ktCond = new LearnKnowledgeTree();
+        ktCond.setSubjectId(subjectId);
+        List<LearnKnowledgeTree> ktList = learnKnowledgeTreeMapper.selectLearnKnowledgeTreeList(ktCond);
+        List<TreeNode> treeNodeList = Lists.newArrayList();
+        Map<Long, TreeNode> teMap = ktList.stream().collect(Collectors.toMap(LearnKnowledgeTree::getId, t -> new TreeNode(t.getId(), t.getName())));
+        for(LearnKnowledgeTree kt : ktList) {
+            if(null == kt.getPid()) {
+                treeNodeList.add(teMap.get(kt.getId()));
+                continue;
+            }
+            teMap.get(kt.getPid()).getChildren().add(teMap.get(kt.getId()));
+        }
+        return treeNodeList;
+    }
+
+    @Data
+    public static class TreeNode {
+        private Long id;
+        private String name;
+        List<TreeNode> children = Lists.newArrayList();
+        public TreeNode(Long id, String name) {
+            this.id = id;
+            this.name = name;
+        }
+    }
+}

+ 210 - 0
ie-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult2.java

@@ -0,0 +1,210 @@
+package com.ruoyi.common.core.domain;
+
+import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.utils.StringUtils;
+
+import java.util.HashMap;
+import java.util.Objects;
+
+/**
+ * 操作消息提醒
+ * 
+ * @author ruoyi
+ */
+public class AjaxResult2<T> extends HashMap<String, Object>
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 状态码 */
+    public static final String CODE_TAG = "code";
+
+    /** 返回内容 */
+    public static final String MSG_TAG = "msg";
+
+    /** 数据对象 */
+    public static final String DATA_TAG = "data";
+
+    /**
+     * 初始化一个新创建的 AjaxResult 对象
+     *
+     * @param code 状态码
+     * @param msg 返回内容
+     */
+    public AjaxResult2(int code, String msg)
+    {
+        super.put(CODE_TAG, code);
+        super.put(MSG_TAG, msg);
+    }
+
+    /**
+     * 初始化一个新创建的 AjaxResult 对象
+     *
+     * @param code 状态码
+     * @param msg 返回内容
+     * @param data 数据对象
+     */
+    public AjaxResult2(int code, String msg, T data)
+    {
+        super.put(CODE_TAG, code);
+        super.put(MSG_TAG, msg);
+        if (StringUtils.isNotNull(data))
+        {
+            super.put(DATA_TAG, data);
+        }
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @return 成功消息
+     */
+    public static <T> AjaxResult2<T> success()
+    {
+        return AjaxResult2.success("操作成功");
+    }
+
+    /**
+     * 返回成功数据
+     * 
+     * @return 成功消息
+     */
+    public static <T> AjaxResult2<T> success(T data)
+    {
+        return AjaxResult2.success("操作成功", data);
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @param msg 返回内容
+     * @return 成功消息
+     */
+    public static <T> AjaxResult2<T> success(String msg)
+    {
+        return AjaxResult2.success(msg, null);
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @param msg 返回内容
+     * @param data 数据对象
+     * @return 成功消息
+     */
+    public static <T> AjaxResult2<T> success(String msg, T data)
+    {
+        return new AjaxResult2<T>(HttpStatus.SUCCESS, msg, data);
+    }
+
+    /**
+     * 返回警告消息
+     *
+     * @param msg 返回内容
+     * @return 警告消息
+     */
+    public static <T> AjaxResult2<T> warn(String msg)
+    {
+        return AjaxResult2.warn(msg, null);
+    }
+
+    /**
+     * 返回警告消息
+     *
+     * @param msg 返回内容
+     * @param data 数据对象
+     * @return 警告消息
+     */
+    public static <T> AjaxResult2<T> warn(String msg, T data)
+    {
+        return new AjaxResult2(HttpStatus.WARN, msg, data);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @return 错误消息
+     */
+    public static <T> AjaxResult2<T> error()
+    {
+        return AjaxResult2.error("操作失败");
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param msg 返回内容
+     * @return 错误消息
+     */
+    public static <T> AjaxResult2<T> error(String msg)
+    {
+        return AjaxResult2.error(msg, null);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param msg 返回内容
+     * @param data 数据对象
+     * @return 错误消息
+     */
+    public static <T> AjaxResult2<T> error(String msg, T data)
+    {
+        return new AjaxResult2<T>(HttpStatus.ERROR, msg, data);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param code 状态码
+     * @param msg 返回内容
+     * @return 错误消息
+     */
+    public static <T> AjaxResult2<T> error(int code, String msg)
+    {
+        return new AjaxResult2(code, msg, null);
+    }
+
+    /**
+     * 是否为成功消息
+     *
+     * @return 结果
+     */
+    public boolean isSuccess()
+    {
+        return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
+    }
+
+    /**
+     * 是否为警告消息
+     *
+     * @return 结果
+     */
+    public boolean isWarn()
+    {
+        return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
+    }
+
+    /**
+     * 是否为错误消息
+     *
+     * @return 结果
+     */
+    public boolean isError()
+    {
+        return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
+    }
+
+    /**
+     * 方便链式调用
+     *
+     * @param key 键
+     * @param value 值
+     * @return 数据对象
+     */
+    @Override
+    public AjaxResult2 put(String key, Object value)
+    {
+        super.put(key, value);
+        return this;
+    }
+}

+ 3 - 0
ie-system/src/main/java/com/ruoyi/dz/mapper/DzClassesMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.dz.mapper;
 
 import java.util.List;
 import com.ruoyi.dz.domain.DzClasses;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 学生班级Mapper接口
@@ -11,6 +12,8 @@ import com.ruoyi.dz.domain.DzClasses;
  */
 public interface DzClassesMapper 
 {
+    public List<DzClasses> selectClassesForTeacher(@Param("teacherId") Long teacherId);
+
     /**
      * 查询学生班级
      * 

+ 2 - 0
ie-system/src/main/java/com/ruoyi/dz/service/IDzControlService.java

@@ -64,4 +64,6 @@ public interface IDzControlService
 
 
     public DzControl selectDzControl(SysUser user);
+
+    public DzControl selectDzControl(String location, ExamType examType);
 }

+ 8 - 3
ie-system/src/main/java/com/ruoyi/dz/service/impl/DzControlServiceImpl.java

@@ -100,13 +100,18 @@ public class DzControlServiceImpl implements IDzControlService
 
     @Override
     public DzControl selectDzControl(SysUser user) {
+        return selectDzControl(user.getLocation(), user.getExamType());
+    }
+
+    public DzControl selectDzControl(String location, ExamType type) {
         DzControl cond = new DzControl();
-        cond.setLocation(user.getLocation());
-        String examType = user.getExamType().name();
+        cond.setLocation(location);
+        String examType = type.name();
         Optional<DzControl> optional = dzControlMapper.selectDzControlList(cond).stream().filter(t -> StringUtils.isBlank(t.getExamTypes()) || t.getExamTypes().contains(examType)).findFirst();
         if(optional.isPresent()) {
             return optional.get();
         }
-        throw new ValidationException("未初始化控制状态: " + user.getLocation() + "," + examType);
+        throw new ValidationException("未初始化控制状态: " + location + "," + examType);
     }
+
 }

+ 2 - 0
ie-system/src/main/java/com/ruoyi/ie/mapper/AMarjorPlanMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.ie.domain.AMarjorPlan;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 专业计划要求Mapper接口
@@ -13,6 +14,7 @@ import com.ruoyi.ie.domain.AMarjorPlan;
  */
 public interface AMarjorPlanMapper 
 {
+    public List<AMarjorPlan>  selectMajorForUniversity(@Param("universityId") Long universityId, @Param("year") Integer year);
     /**
      * 查询专业计划要求
      * 

+ 44 - 20
ie-system/src/main/java/com/ruoyi/learn/domain/LearnStudent.java

@@ -18,35 +18,59 @@ public class LearnStudent extends BaseEntity
     /** 学生用户ID */
     private Long studentId;
 
-    /** 定向Key */
-    @Excel(name = "定向Key")
-    private String directKey;
+    /** 班级ID */
+    @Excel(name = "班级ID")
+    private Long classId;
 
-    public void setStudentId(Long studentId) 
-    {
+    /** 校区ID */
+    @Excel(name = "校区ID")
+    private Long campusId;
+
+    /** 院校id */
+    @Excel(name = "院校id")
+    private Long universityId;
+
+    /** 计划专业id */
+    @Excel(name = "计划专业id")
+    private Long majorPlanId;
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
         this.studentId = studentId;
     }
 
-    public Long getStudentId() 
-    {
-        return studentId;
+    public Long getClassId() {
+        return classId;
+    }
+
+    public void setClassId(Long classId) {
+        this.classId = classId;
+    }
+
+    public Long getCampusId() {
+        return campusId;
+    }
+
+    public void setCampusId(Long campusId) {
+        this.campusId = campusId;
+    }
+
+    public Long getUniversityId() {
+        return universityId;
     }
 
-    public void setDirectKey(String directKey) 
-    {
-        this.directKey = directKey;
+    public void setUniversityId(Long universityId) {
+        this.universityId = universityId;
     }
 
-    public String getDirectKey() 
-    {
-        return directKey;
+    public Long getMajorPlanId() {
+        return majorPlanId;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("studentId", getStudentId())
-            .append("directKey", getDirectKey())
-            .toString();
+    public void setMajorPlanId(Long majorPlanId) {
+        this.majorPlanId = majorPlanId;
     }
 }

+ 5 - 0
ie-system/src/main/java/com/ruoyi/syzy/mapper/BBusiWishUniversitiesMapper.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.ruoyi.syzy.domain.BBusiWishUniversities;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.security.core.parameters.P;
 
 /**
  * 院校库Mapper接口
@@ -13,6 +14,10 @@ import org.apache.ibatis.annotations.Param;
  * @date 2021-07-29
  */
 public interface BBusiWishUniversitiesMapper {
+
+    public List<BBusiWishUniversities> selectUniversityListForTeacher(@Param("teacherId") Long teacherId);
+
+
     public List<BBusiWishUniversities> listMyByPage(String customerCode);
 
     public List<Long> listForCourses(@Param("qw") String where);

+ 9 - 0
ie-system/src/main/resources/mapper/dz/DzClassesMapper.xml

@@ -20,6 +20,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select class_id, school_id, year, name, online, status, stats, create_time, update_time from dz_classes
     </sql>
 
+
+    <select id="selectClassesForTeacher" parameterType="Long" resultMap="DzClassesResult">
+        SELECT c.* FROM `dz_teacher_class` tc
+        JOIN `dz_classes` c ON tc.`class_id` = c.`class_id`
+        WHERE tc.`teacher_id` = #{teacherId} AND NOW() &lt; tc.`out_date`
+    </select>
+
+
+
     <select id="selectDzClassesList" parameterType="DzClasses" resultMap="DzClassesResult">
         <include refid="selectDzClassesVo"/>
         <where>  

+ 9 - 0
ie-system/src/main/resources/mapper/ie/AMarjorPlanMapper.xml

@@ -38,6 +38,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
 
+    <select id="selectMajorForUniversity" parameterType="Map" resultMap="AMarjorPlanResult">
+        SELECT mp.`majorGroup`, mp.`majorName`, COUNT(DISTINCT sl.`student_id`) planTotal
+        FROM `learn_student` sl
+        JOIN `a_marjor_plan` mp ON sl.`major_plan_id` = mp.`id`
+        WHERE sl.`university_id` = #{universityId} and mp.year = #{year}
+        GROUP BY mp.`majorGroup`, mp.`majorName`
+        ORDER BY mp.`majorGroup`, mp.`majorName`
+    </select>
+
     <select id="selectListByRuleCond" parameterType="Map" resultMap="AMarjorPlanResult">
       SELECT m1.code majorCode, p.id, p.year, p.universityId, p.universityName, p.level, majorGroup, majorName, majorDirection, enrollCode, majorEnrollCode, examineeType, planTotal, xuefei, lengthOfSchooling, score, culturalScore, profScore, schoolScore, chinessScore, mathScore, englishScore, custCond, comment, company
         FROM `a_marjor_plan` p

+ 17 - 5
ie-system/src/main/resources/mapper/learn/LearnStudentMapper.xml

@@ -6,11 +6,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="LearnStudent" id="LearnStudentResult">
         <result property="studentId"    column="student_id"    />
-        <result property="directKey"    column="direct_key"    />
+        <result property="classId"    column="class_id"    />
+        <result property="campusId"    column="campus_id"    />
+        <result property="universityId"    column="university_id"    />
+        <result property="majorPlanId"    column="major_plan_id"    />
     </resultMap>
 
     <sql id="selectLearnStudentVo">
-        select student_id, direct_key from learn_student
+        select student_id, class_id, campus_id, university_id, major_plan_id from learn_student
     </sql>
 
     <select id="selectLearnStudentList" parameterType="LearnStudent" resultMap="LearnStudentResult">
@@ -29,18 +32,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into learn_student
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="studentId != null">student_id,</if>
-            <if test="directKey != null">direct_key,</if>
+            <if test="classId != null">class_id,</if>
+            <if test="campusId != null">campus_id,</if>
+            <if test="universityId != null">university_id,</if>
+            <if test="majorPlanId != null">major_plan_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="studentId != null">#{studentId},</if>
-            <if test="directKey != null">#{directKey},</if>
+            <if test="classId != null">#{classId},</if>
+            <if test="campusId != null">#{campusId},</if>
+            <if test="universityId != null">#{universityId},</if>
+            <if test="majorPlanId != null">#{majorPlanId},</if>
          </trim>
     </insert>
 
     <update id="updateLearnStudent" parameterType="LearnStudent">
         update learn_student
         <trim prefix="SET" suffixOverrides=",">
-            <if test="directKey != null">direct_key = #{directKey},</if>
+            <if test="classId != null">class_id = #{classId},</if>
+            <if test="campusId != null">campus_id = #{campusId},</if>
+            <if test="universityId != null">university_id = #{universityId},</if>
+            <if test="majorPlanId != null">major_plan_id = #{majorPlanId},</if>
         </trim>
         where student_id = #{studentId}
     </update>

+ 5 - 1
ie-system/src/main/resources/mapper/learn/LearnTestMapper.xml

@@ -7,12 +7,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="LearnTest" id="LearnTestResult">
         <result property="batchId"    column="batch_id"    />
         <result property="name"    column="name"    />
+        <result property="year"    column="year"    />
         <result property="creatorId"    column="creator_id"    />
         <result property="createTime"    column="create_time"    />
     </resultMap>
 
     <sql id="selectLearnTestVo">
-        select batch_id, name, creator_id, create_time from learn_test
+        select batch_id, name, year, creator_id, create_time from learn_test
     </sql>
 
     <select id="selectLearnTestList" parameterType="LearnTest" resultMap="LearnTestResult">
@@ -21,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="creatorId != null "> and creator_id = #{creatorId}</if>
         </where>
+        order by batch_id desc
     </select>
     
     <select id="selectLearnTestByBatchId" parameterType="String" resultMap="LearnTestResult">
@@ -32,11 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into learn_test
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="name != null and name != ''">name,</if>
+            <if test="year != null">year,</if>
             <if test="creatorId != null">creator_id,</if>
             <if test="createTime != null">create_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null and name != ''">#{name},</if>
+            <if test="year != null">#{year},</if>
             <if test="creatorId != null">#{creatorId},</if>
             <if test="createTime != null">#{createTime},</if>
          </trim>

+ 7 - 0
ie-system/src/main/resources/mapper/syzy/BBusiWishUniversitiesMapper.xml

@@ -71,6 +71,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from b_busi_wish_universities
   </sql>
 
+  <select id="selectUniversityListForTeacher" parameterType="Long" resultType="java.lang.Long">
+    SELECT DISTINCT sl.`university_id`, u.`name`
+    FROM `dz_teacher_class` tc
+    JOIN `learn_student` sl ON tc.`class_id` = sl.`class_id`
+    JOIN `b_busi_wish_universities` u ON sl.`university_id` = u.`id`
+    WHERE tc.`teacher_id` = #{teacherId} AND NOW() &lt; tc.`out_date`
+  </select>
 
   <select id="listForCourses" parameterType="String" resultType="java.lang.Long">
     select id from b_busi_wish_universities where status>0 ${qw}