feat: 生成编号和删除限制等
This commit is contained in:
@@ -3,7 +3,14 @@
|
||||
<mapper namespace="org.agt.module.license.dal.mysql.project.ProjectMapper">
|
||||
|
||||
<select id="selectMaxCode" resultType="Integer">
|
||||
SELECT max(`code` + 0) from crm_project;
|
||||
SELECT
|
||||
MIN( t1.num + 1 ) AS next_num
|
||||
FROM
|
||||
( SELECT CAST( `code` AS UNSIGNED ) AS num FROM crm_project ) t1
|
||||
LEFT JOIN ( SELECT CAST( `code` AS UNSIGNED ) AS num FROM crm_project ) t2 ON t2.num = t1.num + 1
|
||||
WHERE
|
||||
t2.num IS NULL
|
||||
AND t1.num >= 2000
|
||||
</select>
|
||||
|
||||
<select id="selectOldMaxCode" resultType="Integer">
|
||||
|
||||
Reference in New Issue
Block a user