키 채번 수정

main
이범준 6 months ago
parent 3f6f350e8c
commit fa8ab2c595

@ -22,12 +22,12 @@ SELECT
<sql id="keyBySggAndYear"> <sql id="keyBySggAndYear">
SELECT SELECT
CONCAT( CONCAT(
#{sggCd} ${sggCd}
, <include refid="utility.currentYear" /> , <include refid="utility.currentYear" />
, LPAD(CAST(IFNULL(MAX(SUBSTRING(${TABLE_KEY}, 9+1)) + 1, 1) AS INT), ${pad}-9, '0') , LPAD(CAST(IFNULL(MAX(SUBSTRING(${TABLE_KEY}, 9+1)) + 1, 1) AS INT), ${pad}-9, '0')
) AS NEW_ID ) AS NEW_ID
FROM ${TABLE_NAME} FROM ${TABLE_NAME}
WHERE ${TABLE_KEY} LIKE CONCAT(#{sggCd}, <include refid="utility.currentYear" />, '%') WHERE ${TABLE_KEY} LIKE CONCAT(${sggCd}, <include refid="utility.currentYear" />, '%')
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save