This commit is contained in:
linfso 2024-05-22 19:27:27 +08:00
parent ad7b300138
commit 488ba9a301

View File

@ -367,10 +367,13 @@
<select id="selectMaxCustomerCodeBySite" parameterType="String" resultType="Long">
select CONCAT(#{ownSiteCode},LPAD((count(1)+1),6,'0')) as code from emis_customer_user where owner_site = #{ownSiteCode}
select IF(max(customer_code) is NULL,CONCAT(#{ownSiteCode},LPAD('1',6,'0')),CONCAT(CONVERT(customer_code,SIGNED)+1,'')) as new_code
from emis_customer_user where owner_site = #{ownSiteCode}
</select>
<!-- select max(CONVERT(customer_code,SIGNED)) as code from emis_customer_user where owner_site = #{ownSiteCode}-->
<!-- select CONCAT(#{ownSiteCode},LPAD((count(1)+1),6,'0')) as code from emis_customer_user where owner_site = #{ownSiteCode}-->
<!-- select max(CONVERT(customer_code,SIGNED)) as code from emis_customer_user where owner_site = #{ownSiteCode}-->