Joburgess 5 years ago
parent
commit
075b250517
28 changed files with 1635 additions and 4 deletions
  1. 34 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamAgencyRelationController.java
  2. 34 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSubjectSongController.java
  3. 34 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExaminationBasicController.java
  4. 14 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/AgencyDao.java
  5. 53 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamAgencyRelationDao.java
  6. 13 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectSongDao.java
  7. 21 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExaminationBasicDao.java
  8. 18 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamAgencyRelationExtraDto.java
  9. 124 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamAgencyRelation.java
  10. 145 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamSubjectSong.java
  11. 180 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExaminationBasic.java
  12. 37 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamModeEnum.java
  13. 42 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamStatusEnum.java
  14. 39 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/SettlementTypeEnum.java
  15. 3 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/SongTypeEnum.java
  16. 36 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamAgencyRelationQueryInfo.java
  17. 45 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamSubjectSongQueryInfo.java
  18. 21 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExaminationQueryInfo.java
  19. 27 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamAgencyRelationService.java
  20. 19 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSubjectSongService.java
  21. 34 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExaminationBasicService.java
  22. 92 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamAgencyRelationServiceImpl.java
  23. 50 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectSongServiceImpl.java
  24. 92 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java
  25. 4 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/AgencyMapper.xml
  26. 137 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamAgencyRelationMapper.xml
  27. 126 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml
  28. 161 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

+ 34 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamAgencyRelationController.java

@@ -0,0 +1,34 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.user.entity.ExamAgencyRelation;
+import com.keao.edu.user.page.ExamAgencyRelationQueryInfo;
+import com.keao.edu.user.service.ExamAgencyRelationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+@RestController
+@RequestMapping("examAgencyRelation")
+@Api(tags = "考级项目代理商服务")
+public class ExamAgencyRelationController extends BaseController {
+
+    @Autowired
+    private ExamAgencyRelationService examAgencyRelationService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamAgencyRelation>> getList(ExamAgencyRelationQueryInfo queryInfo) {
+        return succeed(examAgencyRelationService.queryPage(queryInfo));
+    }
+
+}

+ 34 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSubjectSongController.java

@@ -0,0 +1,34 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.user.entity.ExamSubjectSong;
+import com.keao.edu.user.page.ExamSubjectSongQueryInfo;
+import com.keao.edu.user.service.ExamSubjectSongService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+@RestController
+@RequestMapping("examSubjectSong")
+@Api(tags = "考级内容服务")
+public class ExamSubjectSongController extends BaseController {
+
+    @Autowired
+    private ExamSubjectSongService examSubjectSongService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamSubjectSong>> getList(ExamSubjectSongQueryInfo queryInfo) {
+        return succeed(examSubjectSongService.queryPage(queryInfo));
+    }
+
+}

+ 34 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExaminationBasicController.java

@@ -0,0 +1,34 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.user.entity.ExaminationBasic;
+import com.keao.edu.user.page.ExaminationQueryInfo;
+import com.keao.edu.user.service.ExaminationBasicService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+@RestController
+@RequestMapping("examinationBasic")
+@Api(tags = "考级项目服务")
+public class ExaminationBasicController extends BaseController {
+
+    @Autowired
+    private ExaminationBasicService examinationBasicService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExaminationBasic>> getList(ExaminationQueryInfo queryInfo) {
+        return succeed(examinationBasicService.queryPage(queryInfo));
+    }
+
+}

+ 14 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/AgencyDao.java

@@ -3,8 +3,20 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.Agency;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 public interface AgencyDao extends BaseDAO<Integer, Agency> {
 
-	
-}
+    /**
+     * @describe 获取指定机构下的所有代理商
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param tenantId:
+     * @return java.util.List<com.keao.edu.user.entity.Agency>
+     */
+    List<Agency> getByTenant(@Param("tenantId") String tenantId);
+
+}

+ 53 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamAgencyRelationDao.java

@@ -0,0 +1,53 @@
+package com.keao.edu.user.dao;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamAgencyRelation;
+import com.keao.edu.user.enums.YesOrNoEnum;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
+
+public interface ExamAgencyRelationDao extends BaseDAO<Long, ExamAgencyRelation> {
+
+    /**
+     * @describe 批量插入考级项目与代理关联
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examAgencyRelations:
+     * @return int
+     */
+    int batchInsert(List<ExamAgencyRelation> examAgencyRelations);
+
+    /**
+     * @describe 批量更新代理商的链接发送状态
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examId: 考级项目编号
+     * @param agencyIds: 代理商编号列表
+     * @param sendUrlFlag: 链接发送状态
+     * @return int
+     */
+    int batchUpdateSendUrlFlag(@Param("examId") Integer examId,
+                               @Param("agencyIds") List<Integer> agencyIds,
+                               @Param("sendUrlFlag")YesOrNoEnum sendUrlFlag);
+
+    /**
+     * @describe 获取考级项目关联的代理商
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examId:
+     * @return com.keao.edu.user.entity.ExamAgencyRelation
+     */
+    List<ExamAgencyRelation> getWithExam(@Param("examId") Integer examId);
+
+    /**
+     * @describe 获取考级项目关联的代理商编号
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examId:
+     * @return java.util.Set<java.lang.Integer>
+     */
+    Set<Integer> getAgencyIdsWithExam(@Param("examId") Integer examId);
+	
+}

+ 13 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSubjectSongDao.java

@@ -0,0 +1,13 @@
+package com.keao.edu.user.dao;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamSubjectSong;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ExamSubjectSongDao extends BaseDAO<Long, ExamSubjectSong> {
+
+    int batchInsert(@Param("examSubjectSongs") List<ExamSubjectSong> examSubjectSongs);
+	
+}

+ 21 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExaminationBasicDao.java

@@ -0,0 +1,21 @@
+package com.keao.edu.user.dao;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExaminationBasic;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ExaminationBasicDao extends BaseDAO<Long, ExaminationBasic> {
+
+    int batchUpdate(@Param("exams") List<ExaminationBasic> exams);
+
+    /**
+     * @describe 获取需要更新状态的考级项目
+     * @author Joburgess
+     * @date 2020.06.19
+     * @return java.util.List<com.keao.edu.user.entity.ExaminationBasic>
+     */
+    List<ExaminationBasic> getNeedUpdateStatusExams();
+	
+}

+ 18 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/ExamAgencyRelationExtraDto.java

@@ -0,0 +1,18 @@
+package com.keao.edu.user.dto;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+public class ExamAgencyRelationExtraDto {
+
+    private String agencyName;
+
+    public String getAgencyName() {
+        return agencyName;
+    }
+
+    public void setAgencyName(String agencyName) {
+        this.agencyName = agencyName;
+    }
+}

+ 124 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamAgencyRelation.java

@@ -0,0 +1,124 @@
+package com.keao.edu.user.entity;
+
+import com.keao.edu.user.enums.SettlementTypeEnum;
+import com.keao.edu.user.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(exam_agency_relation):
+ */
+public class ExamAgencyRelation {
+
+	private Long id;
+
+	@ApiModelProperty(value = "考试编号")
+	private Integer examinationBasicId;
+
+	@ApiModelProperty(value = "代理人编号")
+	private Integer agencyId;
+
+	@ApiModelProperty(value = "分润结算方式")
+	private SettlementTypeEnum settlementType;
+
+	@ApiModelProperty(value = "分润金额")
+	private java.math.BigDecimal shareProfitAmount;
+
+	@ApiModelProperty(value = "链接地址")
+	private String url;
+
+	@ApiModelProperty(value = "是否已发送链接")
+	private YesOrNoEnum sendUrlFlag;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+
+	private String tenantId;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setExaminationBasicId(Integer examinationBasicId){
+		this.examinationBasicId = examinationBasicId;
+	}
+	
+	public Integer getExaminationBasicId(){
+		return this.examinationBasicId;
+	}
+			
+	public void setAgencyId(Integer agencyId){
+		this.agencyId = agencyId;
+	}
+	
+	public Integer getAgencyId(){
+		return this.agencyId;
+	}
+
+	public SettlementTypeEnum getSettlementType() {
+		return settlementType;
+	}
+
+	public void setSettlementType(SettlementTypeEnum settlementType) {
+		this.settlementType = settlementType;
+	}
+
+	public void setShareProfitAmount(java.math.BigDecimal shareProfitAmount){
+		this.shareProfitAmount = shareProfitAmount;
+	}
+	
+	public java.math.BigDecimal getShareProfitAmount(){
+		return this.shareProfitAmount;
+	}
+			
+	public void setUrl(String url){
+		this.url = url;
+	}
+	
+	public String getUrl(){
+		return this.url;
+	}
+
+	public YesOrNoEnum getSendUrlFlag() {
+		return sendUrlFlag;
+	}
+
+	public void setSendUrlFlag(YesOrNoEnum sendUrlFlag) {
+		this.sendUrlFlag = sendUrlFlag;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setTenantId(String tenantId){
+		this.tenantId = tenantId;
+	}
+	
+	public String getTenantId(){
+		return this.tenantId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 145 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamSubjectSong.java

@@ -0,0 +1,145 @@
+package com.keao.edu.user.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(exam_subject_song):
+ */
+public class ExamSubjectSong {
+
+	@ApiModelProperty(value = "考试内容编号")
+	private Long id;
+
+	@ApiModelProperty(value = "考试项目")
+	private Integer examinationBasicId;
+
+	@ApiModelProperty(value = "专业")
+	private Long examSubjectId;
+
+	@ApiModelProperty(value = "级别")
+	private Integer level;
+
+	@ApiModelProperty(value = "练习曲数量")
+	private Integer practiceNum;
+
+	@ApiModelProperty(value = "练习曲列表")
+	private String practiceSongIdList;
+
+	@ApiModelProperty(value = "演奏曲数量")
+	private Integer performNum;
+
+	@ApiModelProperty(value = "演奏曲列表")
+	private String performSongIdList;
+
+	@ApiModelProperty(value = "报名费用")
+	private java.math.BigDecimal registrationFee;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+
+	private String tenantId;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setExaminationBasicId(Integer examinationBasicId){
+		this.examinationBasicId = examinationBasicId;
+	}
+	
+	public Integer getExaminationBasicId(){
+		return this.examinationBasicId;
+	}
+			
+	public void setExamSubjectId(Long examSubjectId){
+		this.examSubjectId = examSubjectId;
+	}
+	
+	public Long getExamSubjectId(){
+		return this.examSubjectId;
+	}
+			
+	public void setLevel(Integer level){
+		this.level = level;
+	}
+	
+	public Integer getLevel(){
+		return this.level;
+	}
+			
+	public void setPracticeNum(Integer practiceNum){
+		this.practiceNum = practiceNum;
+	}
+	
+	public Integer getPracticeNum(){
+		return this.practiceNum;
+	}
+			
+	public void setPracticeSongIdList(String practiceSongIdList){
+		this.practiceSongIdList = practiceSongIdList;
+	}
+	
+	public String getPracticeSongIdList(){
+		return this.practiceSongIdList;
+	}
+			
+	public void setPerformNum(Integer performNum){
+		this.performNum = performNum;
+	}
+	
+	public Integer getPerformNum(){
+		return this.performNum;
+	}
+			
+	public void setPerformSongIdList(String performSongIdList){
+		this.performSongIdList = performSongIdList;
+	}
+	
+	public String getPerformSongIdList(){
+		return this.performSongIdList;
+	}
+			
+	public void setRegistrationFee(java.math.BigDecimal registrationFee){
+		this.registrationFee = registrationFee;
+	}
+	
+	public java.math.BigDecimal getRegistrationFee(){
+		return this.registrationFee;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setTenantId(String tenantId){
+		this.tenantId = tenantId;
+	}
+	
+	public String getTenantId(){
+		return this.tenantId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 180 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExaminationBasic.java

@@ -0,0 +1,180 @@
+package com.keao.edu.user.entity;
+
+import com.keao.edu.user.enums.ExamModeEnum;
+import com.keao.edu.user.enums.ExamStatusEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(examination_basic):
+ */
+public class ExaminationBasic {
+
+	@ApiModelProperty(value = "考级项目编号")
+	private Integer id;
+	
+	@ApiModelProperty(value = "项目名称")
+	private String name;
+	
+	@ApiModelProperty(value = "考试模式")
+	private ExamModeEnum examMode;
+	
+	@ApiModelProperty(value = "考点编号列表")
+	private String examLocationIdList;
+
+	@ApiModelProperty(value = "状态")
+	private ExamStatusEnum status;
+
+	@ApiModelProperty(value = "报名开始时间")
+	private java.util.Date enrollStartTime;
+
+	@ApiModelProperty(value = "报名结束时间")
+	private java.util.Date enrollEndTime;
+
+	@ApiModelProperty(value = "预计考试开始时间")
+	private java.util.Date expectExamStartTime;
+
+	@ApiModelProperty(value = "预计考试结束时间")
+	private java.util.Date expectExamEndTime;
+
+	@ApiModelProperty(value = "标题")
+	private String posterTitle;
+
+	@ApiModelProperty(value = "简介")
+	private String posterProfile;
+
+	@ApiModelProperty(value = "背景图")
+	private String posterBackgroundImg;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+
+	private String tenantId;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setExamLocationIdList(String examLocationIdList){
+		this.examLocationIdList = examLocationIdList;
+	}
+	
+	public String getExamLocationIdList(){
+		return this.examLocationIdList;
+	}
+
+	public ExamModeEnum getExamMode() {
+		return examMode;
+	}
+
+	public void setExamMode(ExamModeEnum examMode) {
+		this.examMode = examMode;
+	}
+
+	public ExamStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(ExamStatusEnum status) {
+		this.status = status;
+	}
+
+	public void setEnrollStartTime(java.util.Date enrollStartTime){
+		this.enrollStartTime = enrollStartTime;
+	}
+	
+	public java.util.Date getEnrollStartTime(){
+		return this.enrollStartTime;
+	}
+			
+	public void setEnrollEndTime(java.util.Date enrollEndTime){
+		this.enrollEndTime = enrollEndTime;
+	}
+	
+	public java.util.Date getEnrollEndTime(){
+		return this.enrollEndTime;
+	}
+			
+	public void setExpectExamStartTime(java.util.Date expectExamStartTime){
+		this.expectExamStartTime = expectExamStartTime;
+	}
+	
+	public java.util.Date getExpectExamStartTime(){
+		return this.expectExamStartTime;
+	}
+			
+	public void setExpectExamEndTime(java.util.Date expectExamEndTime){
+		this.expectExamEndTime = expectExamEndTime;
+	}
+	
+	public java.util.Date getExpectExamEndTime(){
+		return this.expectExamEndTime;
+	}
+			
+	public void setPosterTitle(String posterTitle){
+		this.posterTitle = posterTitle;
+	}
+	
+	public String getPosterTitle(){
+		return this.posterTitle;
+	}
+			
+	public void setPosterProfile(String posterProfile){
+		this.posterProfile = posterProfile;
+	}
+	
+	public String getPosterProfile(){
+		return this.posterProfile;
+	}
+			
+	public void setPosterBackgroundImg(String posterBackgroundImg){
+		this.posterBackgroundImg = posterBackgroundImg;
+	}
+	
+	public String getPosterBackgroundImg(){
+		return this.posterBackgroundImg;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setTenantId(String tenantId){
+		this.tenantId = tenantId;
+	}
+	
+	public String getTenantId(){
+		return this.tenantId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 37 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamModeEnum.java

@@ -0,0 +1,37 @@
+package com.keao.edu.user.enums;
+
+import com.keao.edu.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ **/
+public enum ExamModeEnum implements BaseEnum<String, ExamModeEnum> {
+
+    ONLINE("ONLINE", "线上"), OFFLINE("OFFLINE", "线下");
+
+    private String code;
+
+    private String msg;
+
+    ExamModeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }}

+ 42 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/ExamStatusEnum.java

@@ -0,0 +1,42 @@
+package com.keao.edu.user.enums;
+
+import com.keao.edu.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ **/
+public enum ExamStatusEnum implements BaseEnum<String, ExamStatusEnum> {
+    SETTING("SETTING", "设置中"),
+    NOT_START("NOT_START", "未开始"),
+    APPLYING("APPLYING","报名中"),
+    APPLIED("APPLIED", "报名结束"),
+    EXAM_ING("EXAM_ING", "考试中"),
+    EXAM_END("EXAM_END", "考试结束"),
+    CLOSE("CLOSE", "关闭");
+
+    private String code;
+
+    private String msg;
+
+    ExamStatusEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }}

+ 39 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/SettlementTypeEnum.java

@@ -0,0 +1,39 @@
+package com.keao.edu.user.enums;
+
+import com.keao.edu.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+public enum  SettlementTypeEnum implements BaseEnum<String, SettlementTypeEnum> {
+
+    INCOME_RATIO("INCOME_RATIO", "收入比例"),
+    PEOPLE_NUM("PEOPLE_NUM", "人数");
+
+    private String code;
+
+    private String msg;
+
+    SettlementTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 3 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/enums/SongTypeEnum.java

@@ -21,7 +21,7 @@ public enum SongTypeEnum implements BaseEnum<String, SongTypeEnum> {
 
     @Override
     public String getCode() {
-        return null;
+        return this.code;
     }
 
     public void setCode(String code) {
@@ -34,4 +34,5 @@ public enum SongTypeEnum implements BaseEnum<String, SongTypeEnum> {
 
     public void setMsg(String msg) {
         this.msg = msg;
-    }}
+    }
+}

+ 36 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamAgencyRelationQueryInfo.java

@@ -0,0 +1,36 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.enums.SettlementTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.management.Query;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+public class ExamAgencyRelationQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examId;
+
+    @ApiModelProperty(value = "分润结算方式")
+    private SettlementTypeEnum settlementType;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+
+    public SettlementTypeEnum getSettlementType() {
+        return settlementType;
+    }
+
+    public void setSettlementType(SettlementTypeEnum settlementType) {
+        this.settlementType = settlementType;
+    }
+}

+ 45 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamSubjectSongQueryInfo.java

@@ -0,0 +1,45 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+public class ExamSubjectSongQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "机构编号")
+    private String tenantId;
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examId;
+
+    @ApiModelProperty(value = "级别")
+    private Integer level;
+
+    @Override
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+}

+ 21 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExaminationQueryInfo.java

@@ -0,0 +1,21 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.enums.ExamStatusEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+public class ExaminationQueryInfo extends QueryInfo {
+
+    private ExamStatusEnum examStatus;
+
+    public ExamStatusEnum getExamStatus() {
+        return examStatus;
+    }
+
+    public void setExamStatus(ExamStatusEnum examStatus) {
+        this.examStatus = examStatus;
+    }
+}

+ 27 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamAgencyRelationService.java

@@ -0,0 +1,27 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamAgencyRelation;
+
+public interface ExamAgencyRelationService extends BaseService<Long, ExamAgencyRelation> {
+
+    /**
+     * @describe 更新考级项目与代理商关联信息
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examAgencyRelation:
+     * @return void
+     */
+    void updateExamAgencyRelation(ExamAgencyRelation examAgencyRelation);
+
+    /**
+     * @describe 发送考级报名链接
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examId:
+     * @param agencyIds:
+     * @return void
+     */
+    void sendUrl(Integer examId, String agencyIds);
+
+}

+ 19 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSubjectSongService.java

@@ -0,0 +1,19 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamSubjectSong;
+
+import java.util.List;
+
+public interface ExamSubjectSongService extends BaseService<Long, ExamSubjectSong> {
+
+    /**
+     * @describe 添加考试内容
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examSubjectSongs:
+     * @return void
+     */
+    void addExamSubjects(List<ExamSubjectSong> examSubjectSongs);
+
+}

+ 34 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExaminationBasicService.java

@@ -0,0 +1,34 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExaminationBasic;
+
+public interface ExaminationBasicService extends BaseService<Long, ExaminationBasic> {
+
+    /**
+     * @describe 创建考级项目基本信息
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examinationBasic:
+     * @return com.keao.edu.user.entity.ExaminationBasic
+     */
+    ExaminationBasic addExaminationBasic(ExaminationBasic examinationBasic);
+
+    /**
+     * @describe 更新考级项目状态
+     * @author Joburgess
+     * @date 2020.06.19
+     * @return void
+     */
+    void updateExamStatus();
+
+    /**
+     * @describe 关闭考级项目
+     * @author Joburgess
+     * @date 2020.06.19
+     * @param examId: 考级项目编号
+     * @param reason: 关闭原因
+     * @return void
+     */
+    void closeExam(Integer examId, String reason);
+}

+ 92 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamAgencyRelationServiceImpl.java

@@ -0,0 +1,92 @@
+package com.keao.edu.user.service.impl;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.ExamAgencyRelationDao;
+import com.keao.edu.user.dao.ExaminationBasicDao;
+import com.keao.edu.user.entity.ExamAgencyRelation;
+import com.keao.edu.user.entity.ExaminationBasic;
+import com.keao.edu.user.enums.ExamStatusEnum;
+import com.keao.edu.user.enums.YesOrNoEnum;
+import com.keao.edu.user.service.ExamAgencyRelationService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ExamAgencyRelationServiceImpl extends BaseServiceImpl<Long, ExamAgencyRelation> implements ExamAgencyRelationService {
+	
+	@Autowired
+	private ExamAgencyRelationDao examAgencyRelationDao;
+	@Autowired
+	private ExaminationBasicDao examinationBasicDao;
+
+	@Override
+	public BaseDAO<Long, ExamAgencyRelation> getDAO() {
+		return examAgencyRelationDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void updateExamAgencyRelation(ExamAgencyRelation examAgencyRelation) {
+		if(Objects.isNull(examAgencyRelation.getExaminationBasicId())){
+			throw new BizException("请指定考级项目");
+		}
+		if(Objects.isNull(examAgencyRelation.getAgencyId())){
+			throw new BizException("请指定代理商");
+		}
+		Set<Integer> agencyIds = examAgencyRelationDao.getAgencyIdsWithExam(examAgencyRelation.getExaminationBasicId());
+		if(agencyIds.contains(examAgencyRelation.getAgencyId())){
+			examAgencyRelationDao.update(examAgencyRelation);
+		}else{
+			examAgencyRelationDao.insert(examAgencyRelation);
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void sendUrl(Integer examId, String agencyIdStrs) {
+		if(Objects.isNull(examId)){
+			throw new BizException("请指定考级项目");
+		}
+		if(StringUtils.isBlank(agencyIdStrs)){
+			throw new BizException("请指定代理商");
+		}
+		Set<Integer> existAgencyIds = examAgencyRelationDao.getAgencyIdsWithExam(examId);
+		List<Integer> agencyIds = Arrays.asList(agencyIdStrs.split(",")).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		List<Integer> updateSendFlagAgencyIds=new ArrayList<>();
+		List<ExamAgencyRelation> examAgencyRelations=new ArrayList<>();
+		for (Integer agencyId : agencyIds) {
+			if(existAgencyIds.contains(agencyId)){
+				updateSendFlagAgencyIds.add(agencyId);
+				continue;
+			}
+			ExamAgencyRelation examAgencyRelation=new ExamAgencyRelation();
+			examAgencyRelation.setExaminationBasicId(examId);
+			examAgencyRelation.setAgencyId(agencyId);
+			examAgencyRelation.setSendUrlFlag(YesOrNoEnum.YES);
+			examAgencyRelations.add(examAgencyRelation);
+		}
+		ExaminationBasic examinationBasic = examinationBasicDao.get(examId.longValue());
+		if(Objects.isNull(examinationBasic)){
+			throw new BizException("考级项目不存在");
+		}
+		if(!CollectionUtils.isEmpty(updateSendFlagAgencyIds)){
+			examAgencyRelationDao.batchUpdateSendUrlFlag(examId, updateSendFlagAgencyIds, YesOrNoEnum.YES);
+		}
+		if(!CollectionUtils.isEmpty(examAgencyRelations)){
+			examAgencyRelationDao.batchInsert(examAgencyRelations);
+		}
+		if(examinationBasic.getStatus().equals(ExamStatusEnum.SETTING)){
+			examinationBasic.setStatus(ExamStatusEnum.NOT_START);
+			examinationBasicDao.update(examinationBasic);
+		}
+	}
+}

+ 50 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSubjectSongServiceImpl.java

@@ -0,0 +1,50 @@
+package com.keao.edu.user.service.impl;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.ExamSubjectSongDao;
+import com.keao.edu.user.entity.ExamSubjectSong;
+import com.keao.edu.user.service.ExamSubjectSongService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Objects;
+
+@Service
+public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjectSong> implements ExamSubjectSongService {
+	
+	@Autowired
+	private ExamSubjectSongDao examSubjectSongDao;
+
+	@Override
+	public BaseDAO<Long, ExamSubjectSong> getDAO() {
+		return examSubjectSongDao;
+	}
+
+	@Override
+	public void addExamSubjects(List<ExamSubjectSong> examSubjectSongs) {
+		if(CollectionUtils.isEmpty(examSubjectSongs)){
+			return;
+		}
+		for (ExamSubjectSong examSubjectSong : examSubjectSongs) {
+			if(Objects.isNull(examSubjectSong.getExaminationBasicId())){
+				throw new BizException("请指定考级项目");
+			}
+			if(Objects.isNull(examSubjectSong.getExamSubjectId())){
+				throw new BizException("请选择专业");
+			}
+			if(Objects.isNull(examSubjectSong.getLevel())){
+				throw new BizException("请指定报考等级");
+			}
+			if(Objects.isNull(examSubjectSong.getRegistrationFee())){
+				throw new BizException("请指定报名费用");
+			}
+		}
+		examSubjectSongDao.batchInsert(examSubjectSongs);
+	}
+}

+ 92 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java

@@ -0,0 +1,92 @@
+package com.keao.edu.user.service.impl;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.AgencyDao;
+import com.keao.edu.user.dao.ExamAgencyRelationDao;
+import com.keao.edu.user.dao.ExaminationBasicDao;
+import com.keao.edu.user.entity.ExaminationBasic;
+import com.keao.edu.user.enums.ExamModeEnum;
+import com.keao.edu.user.enums.ExamStatusEnum;
+import com.keao.edu.user.service.ExaminationBasicService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+
+@Service
+public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, ExaminationBasic> implements ExaminationBasicService{
+
+	@Autowired
+	private ExamAgencyRelationDao examAgencyRelationDao;
+	@Autowired
+	private ExaminationBasicDao examinationBasicDao;
+	@Autowired
+	private AgencyDao agencyDao;
+
+	@Override
+	public BaseDAO<Long, ExaminationBasic> getDAO() {
+		return examinationBasicDao;
+	}
+
+	@Override
+	public ExaminationBasic addExaminationBasic(ExaminationBasic examinationBasic) {
+		if(StringUtils.isBlank(examinationBasic.getName())){
+			throw new BizException("请填写项目名称");
+		}
+		if(Objects.isNull(examinationBasic.getExamMode())){
+			throw new BizException("请选择考试类型");
+		}
+		if(ExamModeEnum.OFFLINE.equals(examinationBasic.getExamMode())&&Objects.nonNull(examinationBasic.getExamLocationIdList())){
+			throw new BizException("请指定考试地点");
+		}
+		if(Objects.isNull(examinationBasic.getEnrollStartTime())||Objects.isNull(examinationBasic.getEnrollEndTime())){
+			throw new BizException("请指定考试开始与结束时间");
+		}
+		examinationBasic.setStatus(ExamStatusEnum.SETTING);
+		examinationBasicDao.insert(examinationBasic);
+		return examinationBasic;
+	}
+
+	@Override
+	public void updateExamStatus() {
+		List<ExaminationBasic> needUpdateStatusExams = examinationBasicDao.getNeedUpdateStatusExams();
+		if(CollectionUtils.isEmpty(needUpdateStatusExams)){
+			return;
+		}
+		Date now=new Date();
+		for (ExaminationBasic needUpdateStatusExam : needUpdateStatusExams) {
+			if(now.compareTo(needUpdateStatusExam.getEnrollStartTime())>=0){
+				needUpdateStatusExam.setStatus(ExamStatusEnum.APPLYING);
+			}
+			if(now.compareTo(needUpdateStatusExam.getEnrollEndTime())>=0){
+				needUpdateStatusExam.setStatus(ExamStatusEnum.APPLIED);
+			}
+			if(now.compareTo(needUpdateStatusExam.getExpectExamStartTime())>=0){
+				needUpdateStatusExam.setStatus(ExamStatusEnum.EXAM_ING);
+			}
+		}
+		examinationBasicDao.batchUpdate(needUpdateStatusExams);
+	}
+
+	@Override
+	public void closeExam(Integer examId, String reason) {
+		if(Objects.isNull(examId)){
+			throw new BizException("请指定考级项目");
+		}
+		ExaminationBasic examinationBasic = examinationBasicDao.get(examId.longValue());
+		if(Objects.isNull(examinationBasic)){
+			throw new BizException("考级项目不存在");
+		}
+		if(StringUtils.isBlank(reason)){
+			reason="后台手动关闭";
+		}
+		examinationBasic.setStatus(ExamStatusEnum.CLOSE);
+		examinationBasicDao.update(examinationBasic);
+	}
+}

+ 4 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/AgencyMapper.xml

@@ -98,4 +98,8 @@
 		SELECT COUNT(*) FROM agency
 		<include refid="agencyQueryPage"/>
 	</select>
+
+	<select id="getByTenant" resultMap="Agency">
+		SELECT * FROM agency WHERE tenant_id_ = #{tenantId} ORDER BY id_
+	</select>
 </mapper>

+ 137 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamAgencyRelationMapper.xml

@@ -0,0 +1,137 @@
+<?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.keao.edu.user.dao.ExamAgencyRelationDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExamAgencyRelation" id="ExamAgencyRelation">
+		<result column="id_" property="id" />
+		<result column="examination_basic_id_" property="examinationBasicId" />
+		<result column="agency_id_" property="agencyId" />
+		<result column="settlement_type_" property="settlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
+		<result column="share_profit_amount_" property="shareProfitAmount" />
+		<result column="url_" property="url" />
+		<result column="send_url_flag_" property="sendUrlFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
+	</resultMap>
+
+	<resultMap id="ExamAgencyRelationExtraDto" type="com.keao.edu.user.dto.ExamAgencyRelationExtraDto" extends="ExamAgencyRelation">
+		<result column="agency_name_" property="agencyName"/>
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamAgencyRelation" >
+		SELECT * FROM exam_agency_relation WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamAgencyRelation">
+		SELECT * FROM exam_agency_relation WHERE tenant_id_#{tenantId} ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamAgencyRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_agency_relation (examination_basic_id_,agency_id_,settlement_type_,share_profit_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
+		VALUES(#{examinationBasicId},#{agencyId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{url},#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
+	</insert>
+
+    <insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamAgencyRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_agency_relation (examination_basic_id_,agency_id_,settlement_type_,share_profit_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
+		VALUES
+		<foreach collection="examAgencyRelations" item="examAgencyRelation" separator=",">
+			(#{examAgencyRelation.examinationBasicId},#{examAgencyRelation.agencyId},#{examAgencyRelation.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examAgencyRelation.shareProfitAmount},#{examAgencyRelation.url},#{examAgencyRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examAgencyRelation.tenantId})
+		</foreach>
+	</insert>
+
+    <!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamAgencyRelation">
+		UPDATE exam_agency_relation
+		<set>
+			<if test="examinationBasicId != null">
+			examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="sendUrlFlag != null">
+			send_url_flag_ = #{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="url != null">
+			url_ = #{url},
+			</if>
+			<if test="tenantId != null">
+			tenant_id_ = #{tenantId},
+			</if>
+			<if test="updateTime != null">
+			update_time_ = #{updateTime},
+			</if>
+			<if test="shareProfitAmount != null">
+			share_profit_amount_ = #{shareProfitAmount},
+			</if>
+			<if test="agencyId != null">
+			agency_id_ = #{agencyId},
+			</if>
+			<if test="settlementType != null">
+			settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="createTime != null">
+			create_time_ = #{createTime},
+			</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	<update id="batchUpdateSendUrlFlag">
+		UPDATE exam_agency_relation SET send_url_flag_=#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+		WHERE examination_basic_id_=#{examId} AND agency_id_ IN
+		<foreach collection="agencyIds" item="agencyId" separator="," open="(" close=")">
+			#{agencyId}
+		</foreach>
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_agency_relation WHERE id_ = #{id} 
+	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			ear.tenant_id_#{tenantId}
+			<if test="examId!=null">
+				AND ear.examination_basic_id_=#{examId}
+			</if>
+			<if test="settlementType!=null">
+				AND ear.settlement_type_=#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="search!=null">
+				AND (ear.agency_id_=#{agencyId} OR a.name_ LIKE CONCAT(#{search}, '%'))
+			</if>
+		</where>
+	</sql>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamAgencyRelationExtraDto" parameterType="map">
+		SELECT
+			ear.*,
+			a.name_ agency_name_
+		FROM exam_agency_relation ear
+		LEFT JOIN agency a ON ear.agency_id_=a.id_
+		<include refid="queryCondition"/>
+		ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_agency_relation ear
+		LEFT JOIN agency a ON ear.agency_id_=a.id_
+		<include refid="queryCondition"/>
+	</select>
+	<select id="getWithExam" resultMap="ExamAgencyRelation">
+		SELECT * FROM exam_agency_relation WHERE examination_basic_id_=#{examId}
+	</select>
+	<select id="getAgencyIdsWithExam" resultType="int">
+		SELECT agency_id_ FROM exam_agency_relation WHERE examination_basic_id_=#{examId} FOR UPDATE
+	</select>
+</mapper>

+ 126 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml

@@ -0,0 +1,126 @@
+<?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.keao.edu.user.dao.ExamSubjectSongDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExamSubjectSong" id="ExamSubjectSong">
+		<result column="id_" property="id" />
+		<result column="examination_basic_id_" property="examinationBasicId" />
+		<result column="exam_subject_id_" property="examSubjectId" />
+		<result column="level_" property="level" />
+		<result column="practice_num_" property="practiceNum" />
+		<result column="practice_song_id_list_" property="practiceSongIdList" />
+		<result column="perform_num_" property="performNum" />
+		<result column="perform_song_id_list_" property="performSongIdList" />
+		<result column="registration_fee_" property="registrationFee" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamSubjectSong" >
+		SELECT * FROM exam_subject_song WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamSubjectSong">
+		SELECT * FROM exam_subject_song ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamSubjectSong" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_subject_song (examination_basic_id_,exam_subject_id_,level_,practice_num_,practice_song_id_list_,perform_num_,perform_song_id_list_,registration_fee_,create_time_,update_time_,tenant_id_)
+		VALUES (#{examinationBasicId},#{examSubjectId},#{level},#{practiceNum},#{practiceSongIdList},#{performNum},#{performSongIdList},#{registrationFee},NOW(),NOW(),#{tenantId})
+	</insert>
+
+	<insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamSubjectSong" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_subject_song (examination_basic_id_,exam_subject_id_,level_,practice_num_,practice_song_id_list_,perform_num_,perform_song_id_list_,registration_fee_,create_time_,update_time_,tenant_id_)
+		VALUES
+		<foreach collection="examSubjectSongs" item="examSubjectSong" separator=",">
+			(#{examSubjectSong.examinationBasicId},#{examSubjectSong.examSubjectId},#{examSubjectSong.level},#{examSubjectSong.practiceNum},#{examSubjectSong.practiceSongIdList},#{examSubjectSong.performNum},#{examSubjectSong.performSongIdList},#{examSubjectSong.registrationFee},NOW(),NOW(),#{examSubjectSong.tenantId})
+		</foreach>
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamSubjectSong">
+		UPDATE exam_subject_song
+		<set>
+			<if test="examinationBasicId != null">
+			examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="performNum != null">
+			perform_num_ = #{performNum},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="practiceSongIdList != null">
+			practice_song_id_list_ = #{practiceSongIdList},
+			</if>
+			<if test="practiceNum != null">
+			practice_num_ = #{practiceNum},
+			</if>
+			<if test="tenantId != null">
+			tenant_id_ = #{tenantId},
+			</if>
+			<if test="examSubjectId != null">
+			exam_subject_id_ = #{examSubjectId},
+			</if>
+			<if test="performSongIdList != null">
+			perform_song_id_list_ = #{performSongIdList},
+			</if>
+			<if test="registrationFee != null">
+			registration_fee_ = #{registrationFee},
+			</if>
+			<if test="updateTime != null">
+			update_time_ = #{updateTime},
+			</if>
+			<if test="level != null">
+			level_ = #{level},
+			</if>
+			<if test="createTime != null">
+			create_time_ = #{createTime},
+			</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_subject_song WHERE id_ = #{id} 
+	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			ess.tenant_id_ = #{tenantId}
+			<if test="examId!=null">
+				AND ess.examination_basic_id_ = #{examId}
+			</if>
+			<if test="level!=null">
+				AND ess.level_=#{level}
+			</if>
+			<if test="search!=null">
+				AND (ess.exam_subject_id_=#{search} OR s.name_ LIKE CONCAT(#{search}, '%'))
+			</if>
+		</where>
+	</sql>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamSubjectSong" parameterType="map">
+		SELECT * FROM exam_subject_song ess
+		LEFT JOIN subject s ON ess.exam_subject_id_=s.id_
+		<include refid="queryCondition"/>
+		ORDER BY id_
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_subject_song
+		LEFT JOIN subject s ON ess.exam_subject_id_=s.id_
+		<include refid="queryCondition"/>
+	</select>
+</mapper>

+ 161 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

@@ -0,0 +1,161 @@
+<?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.keao.edu.user.dao.ExaminationBasicDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExaminationBasic" id="ExaminationBasic">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="exam_mode_" property="examMode" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
+		<result column="exam_location_id_list_" property="examLocationIdList" />
+		<result column="status_" property="status" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
+		<result column="enroll_start_time_" property="enrollStartTime" />
+		<result column="enroll_end_time_" property="enrollEndTime" />
+		<result column="expect_exam_start_time_" property="expectExamStartTime" />
+		<result column="expect_exam_end_time_" property="expectExamEndTime" />
+		<result column="poster_title_" property="posterTitle" />
+		<result column="poster_profile_" property="posterProfile" />
+		<result column="poster_background_img_" property="posterBackgroundImg" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExaminationBasic" >
+		SELECT * FROM examination_basic WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExaminationBasic">
+		SELECT * FROM examination_basic WHERE tenant_id_=#{tenantId}
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExaminationBasic" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO examination_basic (id_,name_,exam_mode_,exam_location_id_list_,status_,enroll_start_time_,enroll_end_time_,expect_exam_start_time_,expect_exam_end_time_,poster_title_,poster_profile_,poster_background_img_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{name},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examLocationIdList},#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{enrollStartTime},#{enrollEndTime},#{expectExamStartTime},#{expectExamEndTime},#{posterTitle},#{posterProfile},#{posterBackgroundImg},NOW(),NOW(),#{tenantId})
+	</insert>
+
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamAgencyRelation">
+		UPDATE examination_basic
+		<set>
+			<if test="name != null">
+				AND name_ = #{name},
+			</if>
+			<if test="examMode != null">
+				AND exam_mode_ = #{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="examLocationIdList != null">
+				AND exam_location_id_list_ = #{examLocationIdList},
+			</if>
+			<if test="status != null">
+				AND status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="enrollStartTime != null">
+				AND enroll_start_time_ = #{enrollStartTime},
+			</if>
+			<if test="enrollEndTime != null">
+				AND enroll_end_time_ = #{enrollEndTime},
+			</if>
+			<if test="expectExamStartTime != null">
+				AND expect_exam_start_time_ = #{expectExamStartTime},
+			</if>
+			<if test="expectExamEndTime != null">
+				AND expect_exam_end_time_ = #{expectExamEndTime},
+			</if>
+			<if test="posterTitle != null">
+				AND poster_title_ = #{posterTitle},
+			</if>
+			<if test="posterProfile != null">
+				AND poster_profile_ = #{posterProfile},
+			</if>
+			<if test="posterBackgroundImg != null">
+				AND poster_profile_ = #{posterBackgroundImg},
+			</if>
+			<if test="tenantId != null">
+				AND tenant_id_ = #{tenantId},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+
+	<update id="batchUpdate" parameterType="com.keao.edu.user.entity.ExamAgencyRelation">
+		<foreach collection="exams" item="exam" separator=";">
+			UPDATE examination_basic
+			<set>
+				<if test="name != null">
+					AND name_ = #{exam.name},
+				</if>
+				<if test="examMode != null">
+					AND exam_mode_ = #{exam.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="examLocationIdList != null">
+					AND exam_location_id_list_ = #{exam.examLocationIdList},
+				</if>
+				<if test="status != null">
+					AND status_ = #{exam.status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="enrollStartTime != null">
+					AND enroll_start_time_ = #{exam.enrollStartTime},
+				</if>
+				<if test="enrollEndTime != null">
+					AND enroll_end_time_ = #{exam.enrollEndTime},
+				</if>
+				<if test="expectExamStartTime != null">
+					AND expect_exam_start_time_ = #{exam.expectExamStartTime},
+				</if>
+				<if test="expectExamEndTime != null">
+					AND expect_exam_end_time_ = #{exam.expectExamEndTime},
+				</if>
+				<if test="posterTitle != null">
+					AND poster_title_ = #{exam.posterTitle},
+				</if>
+				<if test="posterProfile != null">
+					AND poster_profile_ = #{exam.posterProfile},
+				</if>
+				<if test="posterBackgroundImg != null">
+					AND poster_profile_ = #{exam.posterBackgroundImg},
+				</if>
+				<if test="tenantId != null">
+					AND tenant_id_ = #{exam.tenantId},
+				</if>
+				update_time_ = NOW()
+			</set> WHERE id_ = #{exam.id}
+		</foreach>
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM examination_basic WHERE id_ = #{id}
+	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			tenant_id_=#{tenantId}
+			<if test="examStatus!=null">
+				status_=#{examStatus}
+			</if>
+		</where>
+	</sql>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExaminationBasic" parameterType="map">
+		SELECT * FROM examination_basic
+		<include refid="queryCondition"/>
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM examination_basic
+		<include refid="queryCondition"/>
+	</select>
+
+    <select id="getNeedUpdateStatusExams" resultMap="ExaminationBasic">
+		SELECT * FROM examination_basic WHERE status_ IN ('NOT_START', 'APPLYING', 'APPLIED')
+	</select>
+</mapper>