Joburgess 5 years ago
parent
commit
259a4ff37d

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

@@ -1,46 +0,0 @@
-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.*;
-
-/**
- * @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));
-    }
-
-    @ApiOperation("更新考级项目与代理商关联信息")
-    @PostMapping(value = "/updateExamAgencyRelation")
-    public HttpResponseResult updateExamAgencyRelation(@RequestBody ExamAgencyRelation examAgencyRelation){
-        examAgencyRelationService.updateExamAgencyRelation(examAgencyRelation);
-        return succeed();
-    }
-
-    @ApiOperation("发送考级报名链接")
-    @GetMapping(value = "/sendUrl")
-    public HttpResponseResult sendUrl(Integer examId, String agencyIds){
-        examAgencyRelationService.sendUrl(examId, agencyIds);
-        return succeed();
-    }
-
-}

+ 46 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrganizationRelationController.java

@@ -0,0 +1,46 @@
+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.ExamOrganizationRelation;
+import com.keao.edu.user.page.ExamOrganizationRelationQueryInfo;
+import com.keao.edu.user.service.ExamOrganizationRelationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.18
+ */
+@RestController
+@RequestMapping("examOrganizationRelation")
+@Api(tags = "考级项目合作单位服务")
+public class ExamOrganizationRelationController extends BaseController {
+
+    @Autowired
+    private ExamOrganizationRelationService examOrganizationRelationService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamOrganizationRelation>> getList(ExamOrganizationRelationQueryInfo queryInfo) {
+        return succeed(examOrganizationRelationService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("更新考级项目与合作单位关联信息")
+    @PostMapping(value = "/updateExamOrganizationRelation")
+    public HttpResponseResult updateExamOrganizationRelation(@RequestBody ExamOrganizationRelation examOrganizationRelation){
+        examOrganizationRelationService.updateExamOrganizationRelation(examOrganizationRelation);
+        return succeed();
+    }
+
+    @ApiOperation("发送考级报名链接")
+    @GetMapping(value = "/sendUrl")
+    public HttpResponseResult sendUrl(Integer examId, String agencyIds){
+        examOrganizationRelationService.sendUrl(examId, agencyIds);
+        return succeed();
+    }
+
+}

+ 9 - 9
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamAgencyRelationDao.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java

@@ -1,35 +1,35 @@
 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.entity.ExamOrganizationRelation;
 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> {
+public interface ExamOrganizationRelationDao extends BaseDAO<Long, ExamOrganizationRelation> {
 
     /**
      * @describe 批量插入考级项目与代理关联
      * @author Joburgess
      * @date 2020.06.18
-     * @param examAgencyRelations:
+     * @param examOrganizationRelations:
      * @return int
      */
-    int batchInsert(@Param("examAgencyRelations") List<ExamAgencyRelation> examAgencyRelations);
+    int batchInsert(@Param("examOrganizationRelations") List<ExamOrganizationRelation> examOrganizationRelations);
 
     /**
      * @describe 批量更新代理商的链接发送状态
      * @author Joburgess
      * @date 2020.06.18
      * @param examId: 考级项目编号
-     * @param agencyIds: 代理商编号列表
+     * @param organIds: 代理商编号列表
      * @param sendUrlFlag: 链接发送状态
      * @return int
      */
     int batchUpdateSendUrlFlag(@Param("examId") Integer examId,
-                               @Param("agencyIds") List<Integer> agencyIds,
+                               @Param("organIds") List<Integer> organIds,
                                @Param("sendUrlFlag")YesOrNoEnum sendUrlFlag);
 
     /**
@@ -37,9 +37,9 @@ public interface ExamAgencyRelationDao extends BaseDAO<Long, ExamAgencyRelation>
      * @author Joburgess
      * @date 2020.06.18
      * @param examId:
-     * @return com.keao.edu.user.entity.ExamAgencyRelation
+     * @return com.keao.edu.user.entity.ExamOrganizationRelation
      */
-    List<ExamAgencyRelation> getWithExam(@Param("examId") Integer examId);
+    List<ExamOrganizationRelation> getWithExam(@Param("examId") Integer examId);
 
     /**
      * @describe 获取考级项目关联的代理商编号
@@ -48,6 +48,6 @@ public interface ExamAgencyRelationDao extends BaseDAO<Long, ExamAgencyRelation>
      * @param examId:
      * @return java.util.Set<java.lang.Integer>
      */
-    Set<Integer> getAgencyIdsWithExam(@Param("examId") Integer examId);
+    Set<Integer> getOrganIdsWithExam(@Param("examId") Integer examId);
 	
 }

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

@@ -1,18 +0,0 @@
-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;
-    }
-}

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

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

+ 8 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamAgencyRelation.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamOrganizationRelation.java

@@ -10,7 +10,7 @@ import java.math.BigDecimal;
 /**
  * 对应数据库表(exam_agency_relation):
  */
-public class ExamAgencyRelation {
+public class ExamOrganizationRelation {
 
 	private Long id;
 
@@ -20,8 +20,8 @@ public class ExamAgencyRelation {
 	@ApiModelProperty(value = "考试编号")
 	private Integer examinationBasicId;
 
-	@ApiModelProperty(value = "代理人编号")
-	private Integer agencyId;
+	@ApiModelProperty(value = "合作单位编号")
+	private Integer organId;
 
 	@ApiModelProperty(value = "分润结算方式")
 	private SettlementTypeEnum settlementType;
@@ -87,12 +87,12 @@ public class ExamAgencyRelation {
 		this.totalPaymentAmount = totalPaymentAmount;
 	}
 
-	public void setAgencyId(Integer agencyId){
-		this.agencyId = agencyId;
+	public Integer getOrganId() {
+		return organId;
 	}
-	
-	public Integer getAgencyId(){
-		return this.agencyId;
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
 	}
 
 	public SettlementTypeEnum getSettlementType() {

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamAgencyRelationQueryInfo.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamOrganizationRelationQueryInfo.java

@@ -10,7 +10,7 @@ import javax.management.Query;
  * @Author Joburgess
  * @Date 2020.06.18
  */
-public class ExamAgencyRelationQueryInfo extends QueryInfo {
+public class ExamOrganizationRelationQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "考试项目编号")
     private Integer examId;

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

@@ -1,29 +0,0 @@
-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);
-
-
-
-}

+ 29 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamOrganizationRelationService.java

@@ -0,0 +1,29 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamOrganizationRelation;
+
+public interface ExamOrganizationRelationService extends BaseService<Long, ExamOrganizationRelation> {
+
+    /**
+     * @describe 更新考级项目与合作单位关联信息
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examOrganizationRelation:
+     * @return void
+     */
+    void updateExamOrganizationRelation(ExamOrganizationRelation examOrganizationRelation);
+
+    /**
+     * @describe 发送考级报名链接
+     * @author Joburgess
+     * @date 2020.06.18
+     * @param examId:
+     * @param agencyIds:
+     * @return void
+     */
+    void sendUrl(Integer examId, String organIds);
+
+
+
+}

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

@@ -1,99 +0,0 @@
-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.common.tenant.TenantContextHolder;
-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.math.BigDecimal;
-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("请指定代理商");
-		}
-		examAgencyRelation.setTenantId(TenantContextHolder.getTenantId().toString());
-		examAgencyRelation.setShareProfitAmount(BigDecimal.ZERO);
-		examAgencyRelation.setTotalRegistrationStudentNum(BigDecimal.ZERO.intValue());
-		examAgencyRelation.setTotalPaymentAmount(BigDecimal.ZERO);
-		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);
-			examAgencyRelation.setTenantId(TenantContextHolder.getTenantId().toString());
-			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);
-		}
-	}
-}

+ 99 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java

@@ -0,0 +1,99 @@
+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.common.tenant.TenantContextHolder;
+import com.keao.edu.user.dao.ExamOrganizationRelationDao;
+import com.keao.edu.user.dao.ExaminationBasicDao;
+import com.keao.edu.user.entity.ExamOrganizationRelation;
+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.ExamOrganizationRelationService;
+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.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, ExamOrganizationRelation> implements ExamOrganizationRelationService {
+	
+	@Autowired
+	private ExamOrganizationRelationDao examOrganizationRelationDao;
+	@Autowired
+	private ExaminationBasicDao examinationBasicDao;
+
+	@Override
+	public BaseDAO<Long, ExamOrganizationRelation> getDAO() {
+		return examOrganizationRelationDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void updateExamOrganizationRelation(ExamOrganizationRelation examOrganizationRelation) {
+		if(Objects.isNull(examOrganizationRelation.getExaminationBasicId())){
+			throw new BizException("请指定考级项目");
+		}
+		if(Objects.isNull(examOrganizationRelation.getOrganId())){
+			throw new BizException("请指定代理商");
+		}
+		examOrganizationRelation.setTenantId(TenantContextHolder.getTenantId().toString());
+		examOrganizationRelation.setShareProfitAmount(BigDecimal.ZERO);
+		examOrganizationRelation.setTotalRegistrationStudentNum(BigDecimal.ZERO.intValue());
+		examOrganizationRelation.setTotalPaymentAmount(BigDecimal.ZERO);
+		Set<Integer> agencyIds = examOrganizationRelationDao.getOrganIdsWithExam(examOrganizationRelation.getExaminationBasicId());
+		if(agencyIds.contains(examOrganizationRelation.getOrganId())){
+			examOrganizationRelationDao.update(examOrganizationRelation);
+		}else{
+			examOrganizationRelationDao.insert(examOrganizationRelation);
+		}
+	}
+
+	@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> existOrganizationIds = examOrganizationRelationDao.getOrganIdsWithExam(examId);
+		List<Integer> agencyIds = Arrays.asList(agencyIdStrs.split(",")).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		List<Integer> updateSendFlagOrganizationIds=new ArrayList<>();
+		List<ExamOrganizationRelation> examOrganizationRelations=new ArrayList<>();
+		for (Integer agencyId : agencyIds) {
+			if(existOrganizationIds.contains(agencyId)){
+				updateSendFlagOrganizationIds.add(agencyId);
+				continue;
+			}
+			ExamOrganizationRelation examOrganizationRelation=new ExamOrganizationRelation();
+			examOrganizationRelation.setExaminationBasicId(examId);
+			examOrganizationRelation.setOrganId(agencyId);
+			examOrganizationRelation.setSendUrlFlag(YesOrNoEnum.YES);
+			examOrganizationRelation.setTenantId(TenantContextHolder.getTenantId().toString());
+			examOrganizationRelations.add(examOrganizationRelation);
+		}
+		ExaminationBasic examinationBasic = examinationBasicDao.get(examId.longValue());
+		if(Objects.isNull(examinationBasic)){
+			throw new BizException("考级项目不存在");
+		}
+		if(!CollectionUtils.isEmpty(updateSendFlagOrganizationIds)){
+			examOrganizationRelationDao.batchUpdateSendUrlFlag(examId, updateSendFlagOrganizationIds, YesOrNoEnum.YES);
+		}
+		if(!CollectionUtils.isEmpty(examOrganizationRelations)){
+			examOrganizationRelationDao.batchInsert(examOrganizationRelations);
+		}
+		if(examinationBasic.getStatus().equals(ExamStatusEnum.SETTING)){
+			examinationBasic.setStatus(ExamStatusEnum.NOT_START);
+			examinationBasicDao.update(examinationBasic);
+		}
+	}
+}

+ 36 - 36
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamAgencyRelationMapper.xml → edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml

@@ -4,13 +4,13 @@
 这个文件是自动生成的。
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
-<mapper namespace="com.keao.edu.user.dao.ExamAgencyRelationDao">
+<mapper namespace="com.keao.edu.user.dao.ExamOrganizationRelationDao">
 	
-	<resultMap type="com.keao.edu.user.entity.ExamAgencyRelation" id="ExamAgencyRelation">
+	<resultMap type="com.keao.edu.user.entity.ExamOrganizationRelation" id="ExamOrganizationRelation">
 		<result column="id_" property="id" />
 
 		<result column="examination_basic_id_" property="examinationBasicId" />
-		<result column="agency_id_" property="agencyId" />
+		<result column="organ_id_" property="organId" />
 		<result column="settlement_type_" property="settlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
 		<result column="share_profit_amount_" property="shareProfitAmount" />
 		<result column="total_registration_student_num_" property="totalRegistrationStudentNum"/>
@@ -22,37 +22,37 @@
 		<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 id="ExamOrganizationRelationExtraDto" type="com.keao.edu.user.dto.ExamOrganizationRelationExtraDto" extends="ExamOrganizationRelation">
+		<result column="organ_name_" property="organizationName"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="ExamAgencyRelation" >
-		SELECT * FROM exam_agency_relation WHERE id_ = #{id} 
+	<select id="get" resultMap="ExamOrganizationRelation" >
+		SELECT * FROM exam_organization_relation WHERE id_ = #{id} 
 	</select>
 	
 	<!-- 全查询 -->
-	<select id="findAll" resultMap="ExamAgencyRelation">
-		SELECT * FROM exam_agency_relation WHERE tenant_id_#{tenantId} ORDER BY id_
+	<select id="findAll" resultMap="ExamOrganizationRelation">
+		SELECT * FROM exam_organization_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_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
-		VALUES(#{examinationBasicId},#{agencyId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{totalRegistrationStudentNum},#{totalPaymentAmount},#{url},#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
+		VALUES(#{examinationBasicId},#{organId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{totalRegistrationStudentNum},#{totalPaymentAmount},#{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_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
+    <insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_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.totalRegistrationStudentNum},#{examAgencyRelation.totalPaymentAmount},#{examAgencyRelation.url},#{examAgencyRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examAgencyRelation.tenantId})
+		<foreach collection="examOrganizationRelations" item="examOrganizationRelation" separator=",">
+			(#{examOrganizationRelation.examinationBasicId},#{examOrganizationRelation.organId},#{examOrganizationRelation.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examOrganizationRelation.shareProfitAmount},#{examOrganizationRelation.totalRegistrationStudentNum},#{examOrganizationRelation.totalPaymentAmount},#{examOrganizationRelation.url},#{examOrganizationRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examOrganizationRelation.tenantId})
 		</foreach>
 	</insert>
 
     <!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.keao.edu.user.entity.ExamAgencyRelation">
-		UPDATE exam_agency_relation
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation">
+		UPDATE exam_organization_relation
 		<set>
 			<if test="examinationBasicId != null">
 			examination_basic_id_ = #{examinationBasicId},
@@ -81,8 +81,8 @@
 			<if test="totalPaymentAmount != null">
 				total_payment_amount_ = #{totalPaymentAmount},
 			</if>
-			<if test="agencyId != null">
-			agency_id_ = #{agencyId},
+			<if test="organId != null">
+			organ_id_ = #{organId},
 			</if>
 			<if test="settlementType != null">
 			settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
@@ -93,16 +93,16 @@
 		</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}
+		UPDATE exam_organization_relation SET send_url_flag_=#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+		WHERE examination_basic_id_=#{examId} AND organ_id_ IN
+		<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+			#{organId}
 		</foreach>
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
-		DELETE FROM exam_agency_relation WHERE id_ = #{id} 
+		DELETE FROM exam_organization_relation WHERE id_ = #{id} 
 	</delete>
 
 	<sql id="queryCondition">
@@ -112,18 +112,18 @@
 				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}, '%'))
+				AND (ear.organ_id_=#{organId} OR a.name_ LIKE CONCAT(#{search}, '%'))
 			</if>
 		</where>
 	</sql>
 	
 	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="ExamAgencyRelationExtraDto" parameterType="map">
+	<select id="queryPage" resultMap="ExamOrganizationRelationExtraDto" parameterType="map">
 		SELECT
 			ear.*,
-			a.name_ agency_name_
-		FROM agency a
-		LEFT JOIN exam_agency_relation ear ON ear.agency_id_=a.id_
+			a.name_ organ_name_
+		FROM organization a
+		LEFT JOIN exam_organization_relation ear ON ear.organ_id_=a.id_
 		<if test="examId!=null">
 			AND ear.examination_basic_id_=#{examId}
 		</if>
@@ -133,17 +133,17 @@
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM agency a
-		LEFT JOIN exam_agency_relation ear ON ear.agency_id_=a.id_
+		SELECT COUNT(*) FROM organ a
+		LEFT JOIN exam_organization_relation ear ON ear.organ_id_=a.id_
 		<if test="examId!=null">
 			AND ear.examination_basic_id_=#{examId}
 		</if>
 		<include refid="queryCondition"/>
 	</select>
-	<select id="getWithExam" resultMap="ExamAgencyRelation">
-		SELECT * FROM exam_agency_relation WHERE examination_basic_id_=#{examId}
+	<select id="getWithExam" resultMap="ExamOrganizationRelation">
+		SELECT * FROM exam_organization_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 id="getOrganIdsWithExam" resultType="int">
+		SELECT organ_id_ FROM exam_organization_relation WHERE examination_basic_id_=#{examId} FOR UPDATE
 	</select>
 </mapper>