Explorar o código

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
02a4d16959

+ 10 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -38,6 +38,8 @@ public class ExamRoom {
 	private Integer organId;
 
 	private YesOrNoEnum examPlanPushFlag;
+
+	private Integer examRoomStudentNum;
 	
 	/**  */
 	private boolean delFlag;
@@ -164,6 +166,14 @@ public class ExamRoom {
 		this.examPlanPushFlag = examPlanPushFlag;
 	}
 
+	public Integer getExamRoomStudentNum() {
+		return examRoomStudentNum;
+	}
+
+	public void setExamRoomStudentNum(Integer examRoomStudentNum) {
+		this.examRoomStudentNum = examRoomStudentNum;
+	}
+
 	public void setTenantId(String tenantId){
 		this.tenantId = tenantId;
 	}

+ 4 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -4,8 +4,12 @@ import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamCertification;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
 
+    int batchInsert(@Param("ecs")List<ExamCertification> ecs);
+
 
     /**
      * 获取学员准考证

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -55,4 +55,15 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
                                                                  @Param("organIds") List<Integer> organIds,
                                                                  @Param("examId") Integer examId);
 
+    /**
+     * @describe 获取指定考级项目下指定学员的报名记录
+     * @author Joburgess
+     * @date 2020.07.02
+     * @param examId:
+     * @param studentIds:
+     * @return java.util.List<com.keao.edu.user.entity.ExamRegistration>
+     */
+    List<ExamRegistration> getWithExamAndStudents(@Param("examId") Integer examId,
+                                                  @Param("studentIds") List<Integer> studentIds);
+
 }

+ 3 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java

@@ -45,5 +45,7 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
     List<ExamRoom> getWithExam(@Param("organIds") List<Integer> organIds,
                                 @Param("examId") Integer examId);
 
-//    int batchUpdateExamRoomPushStatus(@Param())
+    int updateSL(ExamRoom examRoom);
+
+    ExamRoom lockRoom(@Param("examRoomId") Long examRoomId);
 }

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamTeacherSalaryDao.java

@@ -9,6 +9,8 @@ import java.util.List;
 
 public interface ExamTeacherSalaryDao extends BaseDAO<Long, ExamTeacherSalary> {
 
+    int batchUpdate(@Param("teacherSalaries") List<ExamTeacherSalary> teacherSalaries);
+
     /**
      * @describe 获取指定考级项目下的老师分润设置
      * @author Joburgess

+ 4 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java

@@ -2,6 +2,7 @@ package com.keao.edu.user.entity;
 
 import com.keao.edu.user.enums.ExamModeEnum;
 import com.keao.edu.user.enums.SettlementTypeEnum;
+import com.keao.edu.user.enums.TeacherSettlementTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -24,7 +25,7 @@ public class ExamTeacherSalary {
 	private Integer teacherId;
 
 	@ApiModelProperty(value = "结算类型(按天/人)")
-	private SettlementTypeEnum settlementType;
+	private TeacherSettlementTypeEnum settlementType;
 
 	@ApiModelProperty(value = "分润金额")
 	private java.math.BigDecimal shareProfitAmount;
@@ -60,11 +61,11 @@ public class ExamTeacherSalary {
 		this.examMode = examMode;
 	}
 
-	public SettlementTypeEnum getSettlementType() {
+	public TeacherSettlementTypeEnum getSettlementType() {
 		return settlementType;
 	}
 
-	public void setSettlementType(SettlementTypeEnum settlementType) {
+	public void setSettlementType(TeacherSettlementTypeEnum settlementType) {
 		this.settlementType = settlementType;
 	}
 

+ 47 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -4,23 +4,25 @@ import com.keao.edu.auth.api.entity.SysUser;
 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.service.IdGeneratorService;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.api.entity.ExamRoom;
-import com.keao.edu.user.dao.ExamRoomDao;
-import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
-import com.keao.edu.user.dao.StudentExamResultDao;
+import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
-import com.keao.edu.user.entity.StudentExamResult;
-import com.keao.edu.user.entity.Subject;
+import com.keao.edu.user.entity.*;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
+import com.keao.edu.user.service.ExamCertificationService;
 import com.keao.edu.user.service.ExamRoomStudentRelationService;
+import com.keao.edu.user.service.ExamTeacherSalaryService;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 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.*;
@@ -37,6 +39,16 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	private OrganizationService organizationService;
 	@Autowired
 	private StudentExamResultDao studentExamResultDao;
+	@Autowired
+	private ExamCertificationDao examCertificationDao;
+	@Autowired
+	private ExamLocationDao examLocationDao;
+	@Autowired
+	private IdGeneratorService idGeneratorService;
+	@Autowired
+	private ExamRegistrationDao examRegistrationDao;
+	@Autowired
+	private ExamTeacherSalaryService examTeacherSalaryService;
 
 	@Override
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
@@ -49,6 +61,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void addStudentForRoom(Long examRoomId, String studentIdsStr) {
 		if(Objects.isNull(examRoomId)){
 			throw new BizException("请指定教室");
@@ -56,19 +69,31 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(StringUtils.isBlank(studentIdsStr)){
 			throw new BizException("请指定学员");
 		}
-		ExamRoom examRoom = examRoomDao.get(examRoomId);
+		ExamRoom examRoom = examRoomDao.lockRoom(examRoomId);
 		if(Objects.isNull(examRoom)){
 			throw new BizException("教室不存在");
 		}
+		ExamLocation examLocation = examLocationDao.get(examRoom.getExamLocationId());
+
 		List<ExamRoomStudentRelation> studentsWithExamRoom = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoomId);
 		Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
 		String[] studentIds = studentIdsStr.split(",");
+
+		List<ExamRegistration> examRegistrations = examRegistrationDao.getWithExamAndStudents(examRoom.getExaminationBasicId(), Arrays.asList(studentIds).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList()));
+		Map<Integer, ExamRegistration> studentRegistMap = examRegistrations.stream().collect(Collectors.toMap(ExamRegistration::getStudentId, e -> e));
+
 		List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
 		List<StudentExamResult> studentExamResults=new ArrayList<>();
+		List<ExamCertification> examCertifications=new ArrayList<>();
 		for (String studentId : studentIds) {
 			if(existStudentIds.contains(Integer.valueOf(studentId))){
 				continue;
 			}
+			ExamRegistration examRegistration = studentRegistMap.get(Integer.valueOf(studentId));
+			if(Objects.isNull(examRegistration)){
+				throw new BizException("学员信息错误");
+			}
+
 			ExamRoomStudentRelation e=new ExamRoomStudentRelation();
 			e.setExaminationBasicId(examRoom.getExaminationBasicId());
 			e.setExamRoomId(examRoom.getId());
@@ -83,13 +108,29 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			ser.setConfirmStatus(false);
 			ser.setTenantId(TenantContextHolder.getTenantId().toString());
 			studentExamResults.add(ser);
+
+			ExamCertification ec=new ExamCertification();
+			ec.setExaminationBasicId(examRoom.getExaminationBasicId());
+			ec.setStudentId(Integer.valueOf(studentId));
+			ec.setCardNo(String.valueOf(idGeneratorService.generatorId()));
+			ec.setSubjectId(examRegistration.getSubjectId());
+			ec.setLevel(examRegistration.getLevel());
+			ec.setExamStartTime(examRoom.getExamStartTime());
+			ec.setExamEndTime(examRoom.getExamEndTime());
+			ec.setExamAddress(examLocation.getAddress());
+			ec.setTenantId(TenantContextHolder.getTenantId().toString());
+			examCertifications.add(ec);
 		}
 		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
 			examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
+			examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 		}
 		if(!CollectionUtils.isEmpty(studentExamResults)){
 			studentExamResultDao.batchInsert(studentExamResults);
 		}
+		if(!CollectionUtils.isEmpty(examCertifications)){
+			examCertificationDao.batchInsert(examCertifications);
+		}
 	}
 
 	@Override

+ 39 - 11
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java

@@ -9,15 +9,17 @@ import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
 import com.keao.edu.user.dao.ExamTeacherSalaryDao;
 import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.entity.ExamTeacherSalary;
+import com.keao.edu.user.enums.SettlementTypeEnum;
+import com.keao.edu.user.enums.TeacherSettlementTypeEnum;
 import com.keao.edu.user.service.ExamTeacherSalaryService;
 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.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -25,8 +27,6 @@ import java.util.stream.Stream;
 public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeacherSalary> implements ExamTeacherSalaryService {
 
 	@Autowired
-	private ExaminationBasicDao examinationBasicDao;
-	@Autowired
 	private ExamRoomDao examRoomDao;
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
@@ -44,13 +44,41 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 		if(CollectionUtils.isEmpty(examRooms)){
 			return;
 		}
-		List<ExamRoomStudentRelation> examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
-		Map<Long, List<ExamRoomStudentRelation>> examRoomStudentsMap = new HashMap<>();
-		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
-			examRoomStudentsMap=examRoomStudentRelations.stream().collect(Collectors.groupingBy(ExamRoomStudentRelation::getExamRoomId));
+
+		Map<Integer, List<ExamRoom>> teacherExamRoomMap=new HashMap<>();
+		for (ExamRoom examRoom : examRooms) {
+			if(!teacherExamRoomMap.containsKey(examRoom.getMainTeacherUserId())){
+				teacherExamRoomMap.put(examRoom.getMainTeacherUserId(), new ArrayList<>());
+			}
+			teacherExamRoomMap.get(examRoom.getMainTeacherUserId()).add(examRoom);
+			if(StringUtils.isBlank(examRoom.getAssistantTeacherUserIdList())){
+				continue;
+			}
+			for (String assistantTeacherId : examRoom.getAssistantTeacherUserIdList().split(",")) {
+				if(!teacherExamRoomMap.containsKey(Integer.valueOf(assistantTeacherId))){
+					teacherExamRoomMap.put(Integer.valueOf(assistantTeacherId), new ArrayList<>());
+				}
+				teacherExamRoomMap.get(Integer.valueOf(assistantTeacherId)).add(examRoom);
+			}
 		}
-		List<ExamTeacherSalary> examTeacherSalaries = examTeacherSalaryDao.queryWithExam(examId);
-		Map<Integer, ExamTeacherSalary> teacherIdSalaryMap = examTeacherSalaries.stream().collect(Collectors.toMap(ExamTeacherSalary::getTeacherId, e -> e));
 
+		List<ExamRoomStudentRelation> examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
+
+		List<ExamTeacherSalary> examTeacherSalaries = examTeacherSalaryDao.queryWithExam(examId);
+		for (ExamTeacherSalary examTeacherSalary : examTeacherSalaries) {
+			List<ExamRoom> teacherExamRooms = teacherExamRoomMap.get(examTeacherSalary.getTeacherId());
+			if(CollectionUtils.isEmpty(teacherExamRooms)){
+				examTeacherSalary.setTotalInvigilationNum(0);
+				examTeacherSalary.setTotalInvigilationStudentNum(0);
+				examTeacherSalary.setTotalSettlementCost(BigDecimal.ZERO);
+				continue;
+			}
+			Set<Long> examRoomIds = teacherExamRooms.stream().map(ExamRoom::getId).collect(Collectors.toSet());
+			long studentNum = examRoomStudentRelations.stream().filter(e -> examRoomIds.contains(e.getExamRoomId())).count();
+			examTeacherSalary.setTotalInvigilationNum(examRoomIds.size());
+			examTeacherSalary.setTotalInvigilationStudentNum((int) studentNum);
+			examTeacherSalary.setTotalSettlementCost(examTeacherSalary.getShareProfitAmount().multiply(new BigDecimal(studentNum)));
+		}
+		examTeacherSalaryDao.batchUpdate(examTeacherSalaries);
 	}
 }

+ 10 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -38,6 +38,16 @@
 		VALUES(#{id},#{examinationBasicId},#{studentId},#{cardNo},#{subjectId},#{level},#{examStartTime},
 		#{examEndTime},#{examAddress},NOW(),NOW(),#{tenantId})
 	</insert>
+
+	<insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamCertification" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_certification (examination_basic_id_,student_id_,card_no_,subject_id_,
+		level_,exam_start_time_,exam_end_time_,exam_address_,create_time_,update_time_,tenant_id_)
+		VALUES
+		<foreach collection="ecs" item="ec" separator=",">
+			(#{ec.examinationBasicId},#{ec.studentId},#{ec.cardNo},#{ec.subjectId},#{ec.level},#{ec.examStartTime},
+			#{ec.examEndTime},#{ec.examAddress},NOW(),NOW(),#{ec.tenantId})
+		</foreach>
+	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.ExamCertification">

+ 6 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -214,4 +214,10 @@
 		AND er.examination_basic_id_ = #{examId}
 		AND er.status_ != ''
 	</select>
+    <select id="getWithExamAndStudents" resultMap="ExamRegistration">
+		SELECT * FROM exam_registration WHERE examination_basic_id_=#{examId} AND student_id_ IN
+		<foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+			#{studentId}
+		</foreach>
+	</select>
 </mapper>

+ 58 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -19,6 +19,7 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="organ_id_" property="organId"/>
 		<result column="exam_plan_push_flag_" property="examPlanPushFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="exam_room_student_num_" property="examRoomStudentNum"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -37,9 +38,11 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
-		assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,create_time_,update_time_,tenant_id_)
+		assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
+		exam_room_student_num_,create_time_,update_time_,tenant_id_)
 		VALUES(#{id},#{examinationBasicId},#{examMode},#{examLocationId},#{subjectIdList},#{mainTeacherUserId},#{assistantTeacherUserIdList},
-		#{examStartTime},#{examEndTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
+		#{examStartTime},#{examEndTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+		#{examRoomStudentNum},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -82,9 +85,58 @@
 			<if test="examPlanPushFlag != null">
 				exam_plan_push_flag_ = #{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="examRoomStudentNum!=null">
+				exam_room_student_num_=#{examRoomStudentNum},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
+
+	<update id="updateSL" parameterType="com.keao.edu.user.api.entity.ExamRoom">
+		UPDATE exam_room
+		<set>
+			<if test="delFlag != null">
+				del_flag_ = #{delFlag},
+			</if>
+			<if test="examinationBasicId != null">
+				examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="examStartTime != null">
+				exam_start_time_ = #{examStartTime},
+			</if>
+			<if test="examEndTime != null">
+				exam_end_time_ = #{examEndTime},
+			</if>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="examMode != null">
+				exam_mode_ = #{examMode},
+			</if>
+			<if test="examLocationId != null">
+				exam_location_id_ = #{examLocationId},
+			</if>
+			<if test="mainTeacherUserId != null">
+				main_teacher_user_id_ = #{mainTeacherUserId},
+			</if>
+			<if test="assistantTeacherUserIdList != null">
+				assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="examPlanPushFlag != null">
+				exam_plan_push_flag_ = #{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="examRoomStudentNum!=null">
+				exam_room_student_num_=#{examRoomStudentNum},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id} AND update_time_=#{updateTime}
+	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
@@ -168,4 +220,8 @@
 			</foreach>
 		</if>
     </select>
+
+	<select id="lockRoom" resultType="com.keao.edu.user.api.entity.ExamRoom">
+		SELECT * FROM exam_room WHERE id_=#{examRoomId} FOR UPDATE
+	</select>
 </mapper>

+ 7 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -113,6 +113,7 @@
 			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
 				#{organI}
 			</foreach>
+			AND er.status_='AUDIT_PASS'
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = 1
 			</if>
@@ -127,13 +128,13 @@
 
 	<select id="findExamRoomStudents" resultMap="ExamRoomStudentRelationDto" parameterType="map">
 		SELECT
-		ersr.id_,
-		ersr.student_id_,
-		er.subject_id_ regist_subject_id_,
-		er.level_ regist_level_,
-		er.create_time_ regist_create_time_
+			ersr.id_,
+			ersr.student_id_,
+			er.subject_id_ regist_subject_id_,
+			er.level_ regist_level_,
+			er.create_time_ regist_create_time_
 		FROM
-		exam_registration er
+			exam_registration er
 		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_ ON ersr.examination_basic_id_=er.examination_basic_id_
 		<include refid="queryCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>

+ 36 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml

@@ -73,6 +73,42 @@
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
+
+	<update id="batchUpdate" parameterType="com.keao.edu.user.entity.ExamTeacherSalary">
+		<foreach collection="teacherSalaries" item="ts" separator=";">
+			UPDATE exam_teacher_salary
+			<set>
+				<if test="examinationBasicId != null">
+					examination_basic_id_ = #{ts.examinationBasicId},
+				</if>
+				<if test="teacherId != null">
+					teacher_id_ = #{ts.teacherId},
+				</if>
+				<if test="tenantId != null">
+					tenant_id_ = #{ts.tenantId},
+				</if>
+				<if test="examMode != null">
+					exam_mode_ = #{ts.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="shareProfitAmount != null">
+					share_profit_amount_ = #{ts.shareProfitAmount},
+				</if>
+				<if test="settlementType != null">
+					settlement_type_ = #{ts.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="totalInvigilationNum != null">
+					total_invigilation_num_ = #{ts.totalInvigilationNum},
+				</if>
+				<if test="totalInvigilationStudentNum != null">
+					total_invigilation_student_num_ = #{ts.totalInvigilationStudentNum},
+				</if>
+				<if test="totalSettlementCost != null">
+					total_settlement_fee_ = #{ts.totalSettlementCost},
+				</if>
+				update_time_ = NOW()
+			</set> WHERE id_ = #{id}
+		</foreach>
+	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >