应征入伍保留学籍申请表-附件上传

This commit is contained in:
2025-11-17 17:45:34 +08:00
parent 013eaa5d6d
commit 0aeb9f2dd8
10 changed files with 170 additions and 27 deletions

View File

@@ -96,6 +96,64 @@
where id = #{id}
</update>
<!-- 批量插入(复用单条的动态字段逻辑) -->
<insert id="batchInsertRtEnlistmentReserveAttach" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into rt_enlistment_reserve_attach
<!-- 提取公共字段列表与单条插入的trim逻辑一致 -->
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="list != null and list.size() > 0">
<!-- 取列表第一个元素判断字段是否需要包含(避免循环判断,提升性能) -->
<if test="list[0].applyId != null">apply_id,</if>
<if test="list[0].fileName != null and list[0].fileName != ''">file_name,</if>
<if test="list[0].filePath != null and list[0].filePath != ''">file_path,</if>
<if test="list[0].fileSize != null">file_size,</if>
<if test="list[0].fileType != null and list[0].fileType != ''">file_type,</if>
<if test="list[0].createTime != null">create_time,</if>
<if test="list[0].applyNo != null and list[0].applyNo != ''">apply_no,</if>
<if test="list[0].studentName != null and list[0].studentName != ''">student_name,</if>
<if test="list[0].studentNo != null and list[0].studentNo != ''">student_no,</if>
</if>
</trim>
values
<!-- 循环列表项生成多个values -->
<foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.applyId != null">#{item.applyId},</if>
<if test="item.fileName != null and item.fileName != ''">#{item.fileName},</if>
<if test="item.filePath != null and item.filePath != ''">#{item.filePath},</if>
<if test="item.fileSize != null">#{item.fileSize},</if>
<if test="item.fileType != null and item.fileType != ''">#{item.fileType},</if>
<if test="item.createTime != null">#{item.createTime},</if>
<if test="item.applyNo != null and item.applyNo != ''">#{item.applyNo},</if>
<if test="item.studentName != null and item.studentName != ''">#{item.studentName},</if>
<if test="item.studentNo != null and item.studentNo != ''">#{item.studentNo},</if>
</trim>
</foreach>
</insert>
<!-- 批量修改根据ID更新支持动态字段 -->
<update id="batchUpdateRtEnlistmentReserveAttach" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
update rt_enlistment_reserve_attach
<set>
<!-- 动态更新字段(仅更新非空/非空字符串的字段) -->
<if test="item.applyId != null">apply_id = #{item.applyId},</if>
<if test="item.fileName != null and item.fileName != ''">file_name = #{item.fileName},</if>
<if test="item.filePath != null and item.filePath != ''">file_path = #{item.filePath},</if>
<if test="item.fileSize != null">file_size = #{item.fileSize},</if>
<if test="item.fileType != null and item.fileType != ''">file_type = #{item.fileType},</if>
<if test="item.createTime != null">create_time = #{item.createTime},</if>
<if test="item.applyNo != null and item.applyNo != ''">apply_no = #{item.applyNo},</if>
<if test="item.studentName != null and item.studentName != ''">student_name = #{item.studentName},</if>
<if test="item.studentNo != null and item.studentNo != ''">student_no = #{item.studentNo},</if>
<!-- 可选:添加更新时间字段 -->
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
</set>
<!-- 必须包含主键ID否则无法定位要修改的记录 -->
where id = #{item.id}
</foreach>
</update>
<delete id="deleteRtEnlistmentReserveAttachById" parameterType="Long">
delete
from rt_enlistment_reserve_attach

View File

@@ -27,6 +27,7 @@
<result property="approvalNo" column="approval_no"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="affixId" column="affix_id"/>
<!--入伍保留学籍申请表-审核记录 多条件查询column里传入了多条件【{studentName = student_name, studentNo = student_no}】javaType里面写了list表明你有多条件 studentName student_name字段-->
<collection property="enlistmentReserveApprovalList"
column="{studentName = student_name, studentNo = student_no}"
@@ -120,7 +121,8 @@
reserve_end_date,
approval_no,
create_time,
update_time
update_time,
affix_id
from rt_enlistment_reserve
</sql>
@@ -153,6 +155,7 @@
<if test="reserveStartDate != null ">and reserve_start_date = #{reserveStartDate}</if>
<if test="reserveEndDate != null ">and reserve_end_date = #{reserveEndDate}</if>
<if test="approvalNo != null and approvalNo != ''">and approval_no = #{approvalNo}</if>
<if test="affixId != null and affixId != ''">and affix_id = #{affixId}</if>
</where>
</select>
@@ -178,7 +181,7 @@
WHERE a.stu_no = #{stuNo}
</select>
<insert id="insertRtEnlistmentReserve" parameterType="EnlistmentReserve" useGeneratedKeys="true" keyProperty="id">
<insert id="insertRtEnlistmentReserve" parameterType="RtEnlistmentReserve" useGeneratedKeys="true" keyProperty="id">
insert into rt_enlistment_reserve
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="applyNo != null and applyNo != ''">apply_no,</if>
@@ -202,6 +205,7 @@
<if test="approvalNo != null">approval_no,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="affixId != null">affix_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="applyNo != null and applyNo != ''">#{applyNo},</if>
@@ -225,10 +229,11 @@
<if test="approvalNo != null">#{approvalNo},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="affixId != null">#{affixId},</if>
</trim>
</insert>
<update id="updateRtEnlistmentReserve" parameterType="EnlistmentReserve">
<update id="updateRtEnlistmentReserve" parameterType="RtEnlistmentReserve">
update rt_enlistment_reserve
<trim prefix="SET" suffixOverrides=",">
<if test="applyNo != null and applyNo != ''">apply_no = #{applyNo},</if>
@@ -252,6 +257,7 @@
<if test="approvalNo != null">approval_no = #{approvalNo},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="affixId != null">affix_id = #{affixId},</if>
</trim>
where id = #{id}
</update>