入伍保留学籍-批量插入(辅导员批量申请)

This commit is contained in:
2026-03-20 15:20:24 +08:00
parent 2c591aa557
commit 1b9ffef757
5 changed files with 220 additions and 5 deletions

View File

@@ -216,6 +216,16 @@
WHERE a.stu_no = #{stuNo}
</select>
<!-- 查询数据库中已存在的学生(按姓名+学号) -->
<select id="selectExistStudents" parameterType="java.util.List" resultType="java.lang.String">
SELECT CONCAT(student_name, '_', student_no)
FROM rt_enlistment_reserve
WHERE CONCAT(student_name, '_', student_no) IN
<foreach collection="list" item="item" open="(" separator="," close=")">
CONCAT(#{item.studentName}, '_', #{item.studentNo})
</foreach>
</select>
<insert id="insertRtEnlistmentReserve" parameterType="RtEnlistmentReserve" useGeneratedKeys="true" keyProperty="id">
insert into rt_enlistment_reserve
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -272,6 +282,68 @@
</trim>
</insert>
<!-- 批量插入 -->
<insert id="batchInsertRtEnlistmentReserve" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into rt_enlistment_reserve
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="list != null and list.size() > 0">
<if test="list[0].applyNo != null and list[0].applyNo != ''">apply_no,</if>
<if test="list[0].studentId != null">student_id,</if>
<if test="list[0].teacherName != null and list[0].teacherName != ''">teacher_name,</if>
<if test="list[0].studentName != null and list[0].studentName != ''">student_name,</if>
<if test="list[0].gender != null and list[0].gender != ''">gender,</if>
<if test="list[0].nation != null and list[0].nation != ''">nation,</if>
<if test="list[0].grade != null and list[0].grade != ''">grade,</if>
<if test="list[0].studentNo != null and list[0].studentNo != ''">student_no,</if>
<if test="list[0].className != null and list[0].className != ''">class_name,</if>
<if test="list[0].major != null and list[0].major != ''">major,</if>
<if test="list[0].familyAddress != null and list[0].familyAddress != ''">family_address,</if>
<if test="list[0].parentPhone != null and list[0].parentPhone != ''">parent_phone,</if>
<if test="list[0].applyReason != null and list[0].applyReason != ''">apply_reason,</if>
<if test="list[0].applyStatus != null">apply_status,</if>
<if test="list[0].processInstanceId != null">process_instance_id,</if>
<if test="list[0].reserveNo != null">reserve_no,</if>
<if test="list[0].reserveStartDate != null">reserve_start_date,</if>
<if test="list[0].reserveEndDate != null">reserve_end_date,</if>
<if test="list[0].approvalNo != null">approval_no,</if>
<if test="list[0].createTime != null">create_time,</if>
<if test="list[0].updateTime != null">update_time,</if>
<if test="list[0].affixId != null">affix_id,</if>
<if test="list[0].deployId != null">deploy_id,</if>
<if test="list[0].deptName != null">dept_name,</if>
</if>
</trim>
values
<foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.applyNo != null and item.applyNo != ''">#{item.applyNo},</if>
<if test="item.studentId != null">#{item.studentId},</if>
<if test="item.teacherName != null and item.teacherName != ''">#{item.teacherName},</if>
<if test="item.studentName != null and item.studentName != ''">#{item.studentName},</if>
<if test="item.gender != null and item.gender != ''">#{item.gender},</if>
<if test="item.nation != null and item.nation != ''">#{item.nation},</if>
<if test="item.grade != null and item.grade != ''">#{item.grade},</if>
<if test="item.studentNo != null and item.studentNo != ''">#{item.studentNo},</if>
<if test="item.className != null and item.className != ''">#{item.className},</if>
<if test="item.major != null and item.major != ''">#{item.major},</if>
<if test="item.familyAddress != null and item.familyAddress != ''">#{item.familyAddress},</if>
<if test="item.parentPhone != null and item.parentPhone != ''">#{item.parentPhone},</if>
<if test="item.applyReason != null and item.applyReason != ''">#{item.applyReason},</if>
<if test="item.applyStatus != null">#{item.applyStatus},</if>
<if test="item.processInstanceId != null">#{item.processInstanceId},</if>
<if test="item.reserveNo != null">#{item.reserveNo},</if>
<if test="item.reserveStartDate != null">#{item.reserveStartDate},</if>
<if test="item.reserveEndDate != null">#{item.reserveEndDate},</if>
<if test="item.approvalNo != null">#{item.approvalNo},</if>
<if test="item.createTime != null">#{item.createTime},</if>
<if test="item.updateTime != null">#{item.updateTime},</if>
<if test="item.affixId != null">#{item.affixId},</if>
<if test="item.deployId != null">#{item.deployId},</if>
<if test="item.deptName != null">#{item.deptName},</if>
</trim>
</foreach>
</insert>
<update id="updateRtEnlistmentReserve" parameterType="RtEnlistmentReserve">
update rt_enlistment_reserve
<trim prefix="SET" suffixOverrides=",">