From c0f3b38ee45565e9f67f0fcc094cdd905d926e01 Mon Sep 17 00:00:00 2001 From: jjh Date: Fri, 4 Aug 2023 11:43:10 +0900 Subject: [PATCH] =?UTF-8?q?DB=EC=97=90=20=EC=9D=B8=EC=84=9C=ED=8A=B8?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20ID=20=EC=83=9D=EC=84=B1(max+1)=20?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml | 4 +++- src/main/resources/sql/mapper/fims/excl/excl01-mapper.xml | 4 +++- src/main/resources/sql/mapper/fims/excl/excl02-mapper.xml | 7 ++++++- src/main/resources/sql/mapper/fims/excl/excl03-mapper.xml | 4 +++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml index de8ea805..bf892e59 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/crdnSttsHstry-mapper.xml @@ -62,7 +62,9 @@ /* 단속 상태 이력 등록(crdnSttsHstryMapper.insertCrdnSttsHstry) */ - SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(STTS_HSTRY_ID,5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID FROM TB_CRDN_STTS_HSTRY + SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(STTS_HSTRY_ID, 5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID + FROM TB_CRDN_STTS_HSTRY + WHERE STTS_HSTRY_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') INSERT INTO TB_CRDN_STTS_HSTRY ( diff --git a/src/main/resources/sql/mapper/fims/excl/excl01-mapper.xml b/src/main/resources/sql/mapper/fims/excl/excl01-mapper.xml index 1749597d..e41eb6b0 100644 --- a/src/main/resources/sql/mapper/fims/excl/excl01-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/excl01-mapper.xml @@ -251,7 +251,9 @@ /* 부과제외 대장 등록(excl01Mapper.insertLevyExcl) */ - SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(LEVY_EXCL_ID,5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID FROM TB_LEVY_EXCL + SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(LEVY_EXCL_ID, 5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID + FROM TB_LEVY_EXCL + WHERE LEVY_EXCL_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') INSERT INTO TB_LEVY_EXCL ( diff --git a/src/main/resources/sql/mapper/fims/excl/excl02-mapper.xml b/src/main/resources/sql/mapper/fims/excl/excl02-mapper.xml index 5af0405a..0b3edec1 100644 --- a/src/main/resources/sql/mapper/fims/excl/excl02-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/excl02-mapper.xml @@ -318,6 +318,9 @@ , B.ADDR /* 주소 */ , B.DTL_ADDR /* 상세 주소 */ , C.OPNN_ID /* 의견 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 RCPT_NO LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') ) AS RCPT_NO /* 접수 번호 */ , AS TODAY /* 오늘 일자 */ FROM TB_CRDN A LEFT OUTER JOIN TB_PAYER B ON (A.RTPYR_ID = B.RTPYR_ID) @@ -327,7 +330,9 @@ /* 의견제출 대장 등록(excl02Mapper.insertOpnnSbmsn) */ - SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(OPNN_ID,5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID FROM TB_OPNN_SBMSN + SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(OPNN_ID, 5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID + FROM TB_OPNN_SBMSN + WHERE OPNN_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') INSERT INTO TB_OPNN_SBMSN ( diff --git a/src/main/resources/sql/mapper/fims/excl/excl03-mapper.xml b/src/main/resources/sql/mapper/fims/excl/excl03-mapper.xml index 0250e10c..7125eda3 100644 --- a/src/main/resources/sql/mapper/fims/excl/excl03-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/excl03-mapper.xml @@ -140,7 +140,9 @@ /* 단속 재등록 등록(excl03Mapper.insertCrdnReReg) */ - SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(RE_REG_ID,5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID FROM TB_CRDN_RE_REG + SELECT CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(RE_REG_ID, 5)) + 1, 1) AS INT), 16, '0')) AS NEW_ID + FROM TB_CRDN_RE_REG + WHERE RE_REG_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') INSERT INTO TB_CRDN_RE_REG ( RE_REG_ID /* 재등록 ID */