From 04f6bfe56b36cd9e71f264e3674aa4a962e3e698 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Wed, 13 Dec 2023 16:08:37 +0900 Subject: [PATCH] =?UTF-8?q?IFNULL=20->=20NVL,=20=EC=B6=94=EA=B0=80:=20now,?= =?UTF-8?q?=20today=20=EC=98=A4=EB=9D=BC=ED=81=B4=20=EB=B2=84=EC=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/mapper/base/file-mapper.xml | 2 +- .../resources/sql/mapper/base/utility.xml | 19 +++++++++++++------ .../sql/mapper/lntris/lntris-A-mapper.xml | 6 +++--- .../sql/mapper/lntris/lntris-D-mapper.xml | 12 ++++++------ .../sql/mapper/lntris/lntris-D07-mapper.xml | 10 +++++----- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/resources/sql/mapper/base/file-mapper.xml b/src/main/resources/sql/mapper/base/file-mapper.xml index 55f5dc6..55ecb7c 100644 --- a/src/main/resources/sql/mapper/base/file-mapper.xml +++ b/src/main/resources/sql/mapper/base/file-mapper.xml @@ -61,7 +61,7 @@ SELECT A.*, FILE_PATH URL SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH FROM ( - SELECT IFNULL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID + SELECT NVL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID FROM TB_FILE A, () B WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%') ) T1, ( diff --git a/src/main/resources/sql/mapper/base/utility.xml b/src/main/resources/sql/mapper/base/utility.xml index 5187fae..c927282 100644 --- a/src/main/resources/sql/mapper/base/utility.xml +++ b/src/main/resources/sql/mapper/base/utility.xml @@ -20,16 +20,23 @@ SELECT FOUND_ROWS() TOT_CNT -DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y%m%d%H%i%s') - -SELECTNOW + +DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s') DATE_FORMAT(CURRENT_DATE, '%Y%m%d') -SELECTTODAY + + +SELECTNOW FROM DUAL + +SELECTTODAY FROM DUAL -IFNULL(#{thisDay},) +NVL(#{thisDay},) -SELECTTHIS_DAY +SELECTTHIS_DAY FROM DUAL \ No newline at end of file diff --git a/src/main/resources/sql/mapper/lntris/lntris-A-mapper.xml b/src/main/resources/sql/mapper/lntris/lntris-A-mapper.xml index 24b2ef7..9a67941 100644 --- a/src/main/resources/sql/mapper/lntris/lntris-A-mapper.xml +++ b/src/main/resources/sql/mapper/lntris/lntris-A-mapper.xml @@ -205,7 +205,7 @@ /* 과태료 대장 단속 정보 등록(lntrisAMapper.insertA01) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(A01_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(A01_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_A01 A, () B WHERE A01_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_A01 ( @@ -645,7 +645,7 @@ UPDATE TB_NIS_INDIV_A01 A /* 과태료 대장 전일자 변동자료 등록(lntrisAMapper.insertA02) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(A02_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(A02_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_A02 A, () B WHERE A02_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_A02 ( @@ -1136,7 +1136,7 @@ UPDATE TB_NIS_INDIV_A02 /* 과태료 대장 상세 조회 결과 등록(lntrisAMapper.insertA03) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(A03_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(A03_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_A03 A, () B WHERE A03_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_A03 ( diff --git a/src/main/resources/sql/mapper/lntris/lntris-D-mapper.xml b/src/main/resources/sql/mapper/lntris/lntris-D-mapper.xml index 37bc1fd..532a881 100644 --- a/src/main/resources/sql/mapper/lntris/lntris-D-mapper.xml +++ b/src/main/resources/sql/mapper/lntris/lntris-D-mapper.xml @@ -199,7 +199,7 @@ /* 부과정보 등록(lntrisDMapper.insertD01) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D01_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D01_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D01 A, () B WHERE D01_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D01 ( @@ -601,7 +601,7 @@ UPDATE TB_NIS_INDIV_D01 A /* 부과_수납정보 등록(lntrisDMapper.insertD02) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D02_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D02_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D02 A, () B WHERE D02_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D02 ( @@ -961,7 +961,7 @@ UPDATE TB_NIS_INDIV_D02 A /* 부과결과정보 등록(lntrisDMapper.insertD03) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D03_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D03_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D03 A, () B WHERE D03_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D03 ( @@ -1171,7 +1171,7 @@ UPDATE TB_NIS_INDIV_D03 /* 부과취소정보 등록(lntrisDMapper.insertD04) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D04_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D04_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D04 A, () B WHERE D04_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D04 ( @@ -1337,7 +1337,7 @@ UPDATE TB_NIS_INDIV_D04 /* 수납정보 등록(lntrisDMapper.insertD05) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D05_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D05_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D05 A, () B WHERE D05_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D05 ( @@ -1541,7 +1541,7 @@ UPDATE TB_NIS_INDIV_D05 /* 감액정보 등록(lntrisDMapper.insertD06) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D06_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D06_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D06 A, () B WHERE D06_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D06 ( diff --git a/src/main/resources/sql/mapper/lntris/lntris-D07-mapper.xml b/src/main/resources/sql/mapper/lntris/lntris-D07-mapper.xml index 642b92c..875ac22 100644 --- a/src/main/resources/sql/mapper/lntris/lntris-D07-mapper.xml +++ b/src/main/resources/sql/mapper/lntris/lntris-D07-mapper.xml @@ -262,7 +262,7 @@ /* 부과체납정보 등록(lntrisD07Mapper.insertD07a) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D07A_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D07A_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D07A A, () B WHERE D07A_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D07A ( @@ -627,7 +627,7 @@ UPDATE TB_NIS_INDIV_D07A /* 수납정보 등록(lntrisD07Mapper.insertD07b) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D07B_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D07B_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D07B A, () B WHERE D07B_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D07B ( @@ -832,7 +832,7 @@ UPDATE TB_NIS_INDIV_D07B /* 감액정보 등록(lntrisD07Mapper.insertD07c) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D07C_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D07C_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D07C A, () B WHERE D07C_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D07C ( @@ -1031,7 +1031,7 @@ UPDATE TB_NIS_INDIV_D07C /* 과오납정보 등록(lntrisD07Mapper.insertD07d) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D07D_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D07D_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D07D A, () B WHERE D07D_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D07D ( @@ -1246,7 +1246,7 @@ UPDATE TB_NIS_INDIV_D07D /* 결손정보 등록(lntrisD07Mapper.insertD07e) */ -SELECT CONCAT(TODAY, LPAD(IFNULL(SUBSTR(MAX(D07E_ID), 9) + 1, 1), 22, '0')) NEW_ID +SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(D07E_ID), 9) + 1, 1), 22, '0')) NEW_ID FROM TB_NIS_INDIV_D07E A, () B WHERE D07E_ID LIKE CONCAT(TODAY, '%') INSERT INTO TB_NIS_INDIV_D07E (