实现历史项目流水复制后端逻辑

This commit is contained in:
wkc
2026-03-29 09:54:05 +08:00
parent b098d4eed1
commit 46d190aa74
8 changed files with 412 additions and 7 deletions

View File

@@ -299,6 +299,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="statementOrderBy"/>
</select>
<select id="selectStatementsForHistoryImport" resultMap="CcdiBankStatementResult">
SELECT
<include refid="selectCcdiBankStatementVo"/>
FROM ccdi_bank_statement bs
<where>
bs.project_id = #{projectId}
AND bs.batch_id = #{batchId}
<if test="startDate != null and startDate != ''">
AND (<include refid="parsedTrxDateExpr"/>) <![CDATA[ >= ]]>
CASE
WHEN LENGTH(TRIM(#{startDate})) = 10
THEN STR_TO_DATE(CONCAT(TRIM(#{startDate}), ' 00:00:00'), '%Y-%m-%d %H:%i:%s')
ELSE STR_TO_DATE(TRIM(#{startDate}), '%Y-%m-%d %H:%i:%s')
END
</if>
<if test="endDate != null and endDate != ''">
AND (<include refid="parsedTrxDateExpr"/>) <![CDATA[ <= ]]>
CASE
WHEN LENGTH(TRIM(#{endDate})) = 10
THEN STR_TO_DATE(CONCAT(TRIM(#{endDate}), ' 23:59:59'), '%Y-%m-%d %H:%i:%s')
ELSE STR_TO_DATE(TRIM(#{endDate}), '%Y-%m-%d %H:%i:%s')
END
</if>
</where>
ORDER BY bs.batch_sequence ASC, bs.bank_statement_id ASC
</select>
<select id="selectStatementDetailById" resultMap="CcdiBankStatementDetailVOResultMap">
SELECT
bs.bank_statement_id AS bankStatementId,

View File

@@ -32,13 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 批量插入 -->
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into ccdi_file_upload_record (
project_id, lsfx_project_id, file_name, file_size, file_status,
project_id, lsfx_project_id, log_id, file_name, file_size, file_status,
source_type, source_project_id, source_project_name,
enterprise_names, account_nos, upload_time, upload_user
) values
<foreach collection="list" item="item" separator=",">
(
#{item.projectId}, #{item.lsfxProjectId}, #{item.fileName},
#{item.projectId}, #{item.lsfxProjectId}, #{item.logId}, #{item.fileName},
#{item.fileSize}, #{item.fileStatus}, #{item.sourceType},
#{item.sourceProjectId}, #{item.sourceProjectName},
#{item.enterpriseNames}, #{item.accountNos}, #{item.uploadTime}, #{item.uploadUser}
@@ -46,6 +46,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<select id="selectSuccessfulRecordsByProjectIds" resultMap="CcdiFileUploadRecordResult">
<include refid="selectCcdiFileUploadRecordVo"/>
where project_id in
<foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
#{projectId}
</foreach>
and file_status = 'parsed_success'
and log_id is not null
order by project_id asc, log_id asc, id asc
</select>
<!-- 统计各状态文件数量 -->
<select id="countByStatus" resultType="java.util.Map">
select file_status as `status`, count(*) as count