新增获取最大代号项目

This commit is contained in:
2025-12-01 14:34:17 +08:00
parent 0f0e6890de
commit 79d0e8b80a
5 changed files with 26 additions and 0 deletions

View File

@@ -890,4 +890,14 @@
) AS finance_details ON p.project_id = finance_details.project_id
${ew.customSqlSegment}
</select>
<select id="getMaxCodeProject" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">
SELECT sop.project_id, project_name, project_num, project_code, project_type, address, funds, functionary, begin_time, finish_time, original_finish_time, delivery, guarantee, introduction, project_grade, project_status, contract_id, invoice_name, invoice_number, invoice_address, invoice_bank, accessory, bail, closure_files, signing_company, remark, create_by, create_time, update_by, update_time, is_postpone, postpone_reason, postpone_time, postpone_count, color, trade_type, pre_pay, customer_id, is_top
FROM sys_oa_project sop
WHERE project_code IS NOT NULL
AND project_code LIKE CONCAT(#{prefix}, '-%')
ORDER BY CAST(SUBSTRING(project_code, LOCATE('-', project_code) + 1) AS UNSIGNED) DESC
LIMIT 1;
</select>
</mapper>