feat: 添加批量检查编号存在性和批量插入链接任务的方法,优化链接生成逻辑,更新相关XML映射配置

This commit is contained in:
zyh
2025-10-03 11:02:39 +08:00
parent 83fd8b02d7
commit c6238277b8
6 changed files with 116 additions and 41 deletions

View File

@@ -299,4 +299,22 @@
AND conflict_check.has_conflict IS NULL
</update>
<!-- 批量检查编号是否存在,返回已存在的编号列表 -->
<select id="findExistingCodeNos" resultType="string">
SELECT code_no FROM link_task
WHERE code_no IN
<foreach collection="codeNos" item="codeNo" open="(" close=")" separator=",">
#{codeNo}
</foreach>
</select>
<!-- 批量插入链接任务 -->
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO link_task (batch_id, agent_id, code_no, token_hash, expire_at, status, region, machine_id, login_at, refund_at, revoked_at, need_refresh, refresh_time, qr_created_at, qr_expire_at, first_region_select_at)
VALUES
<foreach collection="tasks" item="task" separator=",">
(#{task.batchId}, #{task.agentId}, #{task.codeNo}, #{task.tokenHash}, #{task.expireAt}, #{task.status}, #{task.region}, #{task.machineId}, #{task.loginAt}, #{task.refundAt}, #{task.revokedAt}, #{task.needRefresh}, #{task.refreshTime}, #{task.qrCreatedAt}, #{task.qrExpireAt}, #{task.firstRegionSelectAt})
</foreach>
</insert>
</mapper>