|
|
|
@ -381,10 +381,13 @@
|
|
|
|
|
|
|
|
|
|
<insert id="insertOpnnSbmsn" parameterType="map">/* 의견제출 대장 등록(opnnSbmsnMapper.insertOpnnSbmsn) */
|
|
|
|
|
<selectKey resultType="hashmap" keyProperty="opnnSbmsn.opnnId,opnnSbmsn.rcptNo" keyColumn="NEW_ID,NEW_RCPT_NO" order="BEFORE">
|
|
|
|
|
SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(OPNN_ID, 5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID
|
|
|
|
|
, CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(RCPT_NO, 5)) + 1, 1) AS INT), 6, '0')) AS NEW_RCPT_NO
|
|
|
|
|
SELECT CONCAT(#{opnnSbmsn.sggCd}, DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(OPNN_ID, 10)) + 1, 1) AS INT), 11, '0')) AS NEW_ID
|
|
|
|
|
, (SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(RCPT_NO, 5)) + 1, 1) AS INT), 6, '0'))
|
|
|
|
|
FROM TB_OPNN_SBMSN
|
|
|
|
|
WHERE OPNN_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%')
|
|
|
|
|
WHERE OPNN_ID LIKE CONCAT(#{opnnSbmsn.sggCd}, DATE_FORMAT(CURRENT_DATE, '%Y'), '%')
|
|
|
|
|
AND RCPT_NO LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%')) AS NEW_RCPT_NO
|
|
|
|
|
FROM TB_OPNN_SBMSN
|
|
|
|
|
WHERE OPNN_ID LIKE CONCAT(#{opnnSbmsn.sggCd}, DATE_FORMAT(CURRENT_DATE, '%Y'), '%')
|
|
|
|
|
</selectKey>
|
|
|
|
|
INSERT
|
|
|
|
|
INTO TB_OPNN_SBMSN (
|
|
|
|
|