diff --git a/src/main/resources/sql/mapper/base/utility.xml b/src/main/resources/sql/mapper/base/utility.xml index 7f335db7..fe68838e 100644 --- a/src/main/resources/sql/mapper/base/utility.xml +++ b/src/main/resources/sql/mapper/base/utility.xml @@ -20,13 +20,17 @@ SELECT FOUND_ROWS() TOT_CNT -DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s') -TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS') + +DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s') +TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS') + SELECTNOW FROM DUAL -DATE_FORMAT(CURRENT_DATE, '%Y%m%d') -TO_CHAR(CURRENT_DATE, 'YYYYMMDD') + +DATE_FORMAT(CURRENT_DATE, '%Y%m%d') +TO_CHAR(CURRENT_DATE, 'YYYYMMDD') + SELECTTODAY FROM DUAL @@ -34,4 +38,9 @@ SELECT FOUND_ROWS() TOT_CNT SELECTTHIS_DAY FROM DUAL + +DATE_FORMAT(CURRENT_DATE, '%Y') +TO_CHAR(CURRENT_DATE, 'YYYY') + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/cmmn/extrStng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/extrStng-mapper.xml index 4cdcff10..b0c0e0d5 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/extrStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/extrStng-mapper.xml @@ -18,10 +18,11 @@ SELECT EXTR_BSC_ID /* PDF 자료 추출 템플릿 문구 설정 등록(extrStngMapper.insertBscStng) */ -SELECT - LPAD(CAST(IFNULL(MAX(EXTR_BSC_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_EXTR_BSC_STNG + + + + + INSERT INTO TB_EXTR_BSC_STNG ( @@ -69,10 +70,11 @@ SELECT EXTR_FORM_ID /* 추출 설정 등록(extrStngMapper.insertArtclStng) */ -SELECT - LPAD(CAST(IFNULL(MAX(EXTR_FORM_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_EXTR_FORM_STNG + + + + + INSERT INTO TB_EXTR_FORM_STNG ( diff --git a/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml index 1b68e5fd..d8aa0da0 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/link-mapper.xml @@ -5,11 +5,11 @@ /* 전자고지 발송 마스터 정보 등록(linkMapper.insertElectronicNoticeSndngMaster) */ -SELECT - CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(UNITY_SNDNG_MASTR_ID,5)) + 1, 1) AS INT), 16, '0')) - AS NEW_ID - FROM TB_CNTC_SNDNG_MASTR -WHERE UNITY_SNDNG_MASTR_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') + + + + + INSERT INTO TB_CNTC_SNDNG_MASTR ( @@ -50,11 +50,11 @@ INSERT /* 전자고지 발송 디테일 정보 등록(linkMapper.insertElectronicNoticeSndngDetail) */ -SELECT - CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(UNITY_SNDNG_DETAIL_ID,5)) + 1, 1) AS INT), 16, '0')) - AS NEW_ID - FROM TB_CNTC_SNDNG_DETAIL -WHERE UNITY_SNDNG_DETAIL_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') + + + + + INSERT INTO TB_CNTC_SNDNG_DETAIL ( diff --git a/src/main/resources/sql/mapper/fims/cmmn/otptStng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/otptStng-mapper.xml index 7d1644ab..5dbf65ea 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/otptStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/otptStng-mapper.xml @@ -24,10 +24,11 @@ SELECT OTPT_BSC_ID /* 출력 기본 설정 등록(otptStngMapper.insertBscStng) */ -SELECT - LPAD(CAST(IFNULL(MAX(OTPT_BSC_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_OTPT_BSC_STNG + + + + + INSERT INTO TB_OTPT_BSC_STNG ( @@ -109,10 +110,11 @@ SELECT OTPT_FORM_ID /* 출력 설정 등록(otptStngMapper.insertArtclStng) */ -SELECT - LPAD(CAST(IFNULL(MAX(OTPT_FORM_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_OTPT_FORM_STNG + + + + + INSERT INTO TB_OTPT_FORM_STNG ( diff --git a/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml index 6156b664..762a5622 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml @@ -24,10 +24,11 @@ SELECT OUTSOURCING_FORM_ID /* 외주요청파일서식 설정 등록(outsourcingStngMapper.insertArtclStng) */ -SELECT - LPAD(CAST(IFNULL(MAX(OUTSOURCING_FORM_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_OUTSOURCING_FORM_STNG + + + + + INSERT INTO TB_OUTSOURCING_FORM_STNG ( diff --git a/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml index 5195a47d..7fac6ee8 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml @@ -88,10 +88,11 @@ UPDATE TB_DEPT /* 사용자 기본 업무 등록 (stngMapper.insertDefaultTask) */ -SELECT - LPAD(CAST(IFNULL(MAX(TASK_MTCHG_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_TASK_MTCHG + + + + + INSERT INTO TB_TASK_MTCHG ( diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-inst-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-inst-mapper.xml index ec642853..475791ae 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-inst-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-inst-mapper.xml @@ -5,11 +5,11 @@ /* 단속 대장 등록(crdnInstMapper.insertCrdn) */ -SELECT - CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(CRDN_ID,5)) + 1, 1) AS INT), 16, '0')) - AS NEW_ID - FROM TB_CRDN -WHERE CRDN_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') + + + + + INSERT INTO TB_CRDN ( CRDN_ID diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-stng-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-stng-mapper.xml index ec15a571..ba1f9640 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-stng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-stng-mapper.xml @@ -111,10 +111,11 @@ SELECT A.FILE_LAYOUT_ID /* 연계파일 레이아웃 등록(crdnStngMapper.insertCrdnFileLayout) */ -SELECT - LPAD(CAST(IFNULL(MAX(FILE_LAYOUT_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_CRDN_FILE_LAYOUT + + + + + INSERT INTO TB_CRDN_FILE_LAYOUT ( diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml index 36b4cd03..3ff877b3 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-team-mapper.xml @@ -52,10 +52,11 @@ UPDATE TB_TEAM /* 단속팀 정보 등록(crdnTeamMapper.insertTeamInfo) */ -SELECT - LPAD(CAST(IFNULL(MAX(TEAM_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_TEAM + + + + + INSERT INTO TB_TEAM ( diff --git a/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml index bb7c151e..0bd02708 100644 --- a/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml @@ -53,10 +53,11 @@ SELECT A.EXMPTN_VHCL_ID /* 면제차량 정보 등록(exmptnVhclMapper.insertExemptionVehicleInfo) */ -SELECT - LPAD(CAST(IFNULL(MAX(EXMPTN_VHCL_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_EXMPTN_VHCL + + + + + INSERT INTO TB_EXMPTN_VHCL ( EXMPTN_VHCL_ID diff --git a/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml index 7d33776b..e4da11f7 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml @@ -160,10 +160,11 @@ UPDATE TB_CVLCPT_BSC_WORDS /* 본문 문구 설정 등록(answerWordsMapper.insertAnswerBodyWordsInfo) */ -SELECT - LPAD(CAST(IFNULL(MAX(ANS_WORDS_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_CVLCPT_ANS_WORDS + + + + + INSERT INTO TB_CVLCPT_ANS_WORDS( diff --git a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml index 1977d661..6592ccb4 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -649,11 +649,11 @@ SELECT CC.CVLCPT_LINK_ID /* 민원 연계 ID */ /* 단속정보 복사(crdnCvlcptMapper.insertCrdnFromSelect) */ -SELECT - CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(CRDN_ID,5)) + 1, 1) AS INT), 16, '0')) - AS NEW_ID - FROM TB_CRDN -WHERE CRDN_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') + + + + + INSERT INTO TB_CRDN ( diff --git a/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml index bcfbe6e2..b615ccde 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml @@ -31,11 +31,11 @@ SELECT SA.INDIV_ID -SELECT - CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(INDIV_ID, 5)) + 1, 1) AS INT), 26, '0')) - AS NEW_ID - FROM TB_SA_CVLCPT_INDIV_DMND -WHERE INDIV_ID LIKE CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), '%') + + + + + /* 새올요청자료 등록(saCvlcptIndviDmndMapper.insertDmndDataInfo) */ INSERT diff --git a/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml index cf24ec53..a9576cd9 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml @@ -25,10 +25,11 @@ SELECT A.CODE AS LEVY_EXCL_RSN_CD /* 계도문 문구 설정 등록(warningWordsMapper.insertWarningWordsInfo) */ -SELECT - LPAD(CAST(IFNULL(MAX(ANS_WORDS_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_CVLCPT_ANS_WORDS + + + + + INSERT INTO TB_CVLCPT_ANS_WORDS( diff --git a/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml index 23b113c9..b9efd3ae 100644 --- a/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/ntc-mapper.xml @@ -67,10 +67,11 @@ WHERE A.DEL_YN = 'N' /* 공지사항 등록(ntcMapper.insertNtc) */ -SELECT - LPAD(CAST(IFNULL(MAX(NTC_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_NOTICE + + + + + INSERT INTO TB_NOTICE ( diff --git a/src/main/resources/sql/mapper/fims/mngt/schdl-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/schdl-mapper.xml index d5864755..aa68c681 100644 --- a/src/main/resources/sql/mapper/fims/mngt/schdl-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/schdl-mapper.xml @@ -58,10 +58,11 @@ WHERE DEL_YN = 'N' /* 일정관리 등록(schdlMapper.insertSchdl) */ -SELECT - LPAD(CAST(IFNULL(MAX(SCHDL_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID -FROM TB_SCHDL + + + + + INSERT INTO TB_SCHDL ( diff --git a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml index d6f992e0..dabbbccf 100644 --- a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml @@ -102,10 +102,11 @@ /* 위반 정보 등록(vltnMapper.insertVltn) */ - SELECT - LPAD(CAST(IFNULL(MAX(VLTN_ID) + 1, 1) AS INT), 10, '0') - AS NEW_ID - FROM TB_VLTN + + + + + INSERT INTO TB_VLTN ( diff --git a/src/main/resources/sql/mapper/fims/numbering.xml b/src/main/resources/sql/mapper/fims/numbering.xml new file mode 100644 index 00000000..d985ea8d --- /dev/null +++ b/src/main/resources/sql/mapper/fims/numbering.xml @@ -0,0 +1,33 @@ + + + + + +SELECT + LPAD(CAST(IFNULL(MAX(${TABLE_KEY}) + 1, 1) AS INT), ${pad}, '0') + AS NEW_ID + FROM ${TABLE_NAME} + + + +SELECT + CONCAT( + + , LPAD(CAST(IFNULL(MAX(SUBSTRING(${TABLE_KEY}, 4+1)) + 1, 1) AS INT), ${pad}-4, '0') + ) AS NEW_ID + FROM ${TABLE_NAME} + WHERE ${TABLE_KEY} LIKE CONCAT(, '%') + + + +SELECT + CONCAT( + #{sggCd} + , + , LPAD(CAST(IFNULL(MAX(SUBSTRING(${TABLE_KEY}, 9+1)) + 1, 1) AS INT), ${pad}-9, '0') + ) AS NEW_ID + FROM ${TABLE_NAME} + WHERE ${TABLE_KEY} LIKE CONCAT(#{sggCd}, , '%') + + + \ No newline at end of file