IFNULL -> NVL, 추가: now, today 오라클 버젼

master
mjkhan21 11 months ago
parent 8daafecea2
commit 04f6bfe56b

@ -61,7 +61,7 @@ SELECT A.*, FILE_PATH URL
<selectKey keyProperty="file.id,file.path" keyColumn="NEW_ID,PATH" resultType="map" order="BEFORE"> <selectKey keyProperty="file.id,file.path" keyColumn="NEW_ID,PATH" resultType="map" order="BEFORE">
SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH
FROM ( 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, (<include refid="utility.selectThisDay" />) B FROM TB_FILE A, (<include refid="utility.selectThisDay" />) B
WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%') WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%')
) T1, ( ) T1, (

@ -20,16 +20,23 @@ SELECT FOUND_ROWS() TOT_CNT</select>
<sql id="orderBy"><if test="fetchSize == null or fetchSize &lt; 1"><include refid="utility.sortBy" /></if></sql> <sql id="orderBy"><if test="fetchSize == null or fetchSize &lt; 1"><include refid="utility.sortBy" /></if></sql>
<sql id="now">DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y%m%d%H%i%s')</sql> <!-- 마리아 DB -->
<sql id="now">DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s')</sql>
<sql id="selectNow">SELECT<include refid="utility.now" />NOW</sql>
<sql id="today">DATE_FORMAT(CURRENT_DATE, '%Y%m%d')</sql> <sql id="today">DATE_FORMAT(CURRENT_DATE, '%Y%m%d')</sql>
<sql id="selectToday">SELECT<include refid="utility.today" />TODAY</sql> <!-- 오라클
<sql id="now">TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS')</sql>
<sql id="today">TO_CHAR(CURRENT_DATE, 'YYYYMMDD')</sql>
-->
<sql id="selectNow">SELECT<include refid="utility.now" />NOW FROM DUAL</sql>
<sql id="selectToday">SELECT<include refid="utility.today" />TODAY FROM DUAL</sql>
<sql id="thisDay">IFNULL(#{thisDay},<include refid="utility.today" />)</sql> <sql id="thisDay">NVL(#{thisDay},<include refid="utility.today" />)</sql>
<sql id="selectThisDay">SELECT<include refid="utility.thisDay" />THIS_DAY</sql> <sql id="selectThisDay">SELECT<include refid="utility.thisDay" />THIS_DAY FROM DUAL</sql>
</mapper> </mapper>

@ -205,7 +205,7 @@
<insert id="insertA01" parameterType="map">/* 과태료 대장 단속 정보 등록(lntrisAMapper.insertA01) */ <insert id="insertA01" parameterType="map">/* 과태료 대장 단속 정보 등록(lntrisAMapper.insertA01) */
<selectKey keyProperty="a01.a01Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="a01.a01Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_A01 A, (<include refid="utility.selectToday" />) B
WHERE A01_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE A01_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_A01 ( INSERT INTO TB_NIS_INDIV_A01 (
@ -645,7 +645,7 @@ UPDATE TB_NIS_INDIV_A01 A
<insert id="insertA02" parameterType="map">/* 과태료 대장 전일자 변동자료 등록(lntrisAMapper.insertA02) */ <insert id="insertA02" parameterType="map">/* 과태료 대장 전일자 변동자료 등록(lntrisAMapper.insertA02) */
<selectKey keyProperty="a02.a02Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="a02.a02Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_A02 A, (<include refid="utility.selectToday" />) B
WHERE A02_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE A02_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_A02 ( INSERT INTO TB_NIS_INDIV_A02 (
@ -1136,7 +1136,7 @@ UPDATE TB_NIS_INDIV_A02
<insert id="insertA03" parameterType="map">/* 과태료 대장 상세 조회 결과 등록(lntrisAMapper.insertA03) */ <insert id="insertA03" parameterType="map">/* 과태료 대장 상세 조회 결과 등록(lntrisAMapper.insertA03) */
<selectKey keyProperty="a03.a03Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="a03.a03Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_A03 A, (<include refid="utility.selectToday" />) B
WHERE A03_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE A03_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_A03 ( INSERT INTO TB_NIS_INDIV_A03 (

@ -199,7 +199,7 @@
<insert id="insertD01" parameterType="map">/* 부과정보 등록(lntrisDMapper.insertD01) */ <insert id="insertD01" parameterType="map">/* 부과정보 등록(lntrisDMapper.insertD01) */
<selectKey keyProperty="d01.d01Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d01.d01Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D01 A, (<include refid="utility.selectToday" />) B
WHERE D01_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D01_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D01 ( INSERT INTO TB_NIS_INDIV_D01 (
@ -601,7 +601,7 @@ UPDATE TB_NIS_INDIV_D01 A
<insert id="insertD02" parameterType="map">/* 부과_수납정보 등록(lntrisDMapper.insertD02) */ <insert id="insertD02" parameterType="map">/* 부과_수납정보 등록(lntrisDMapper.insertD02) */
<selectKey keyProperty="d02.d02Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d02.d02Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D02 A, (<include refid="utility.selectToday" />) B
WHERE D02_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D02_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D02 ( INSERT INTO TB_NIS_INDIV_D02 (
@ -961,7 +961,7 @@ UPDATE TB_NIS_INDIV_D02 A
<insert id="insertD03" parameterType="map">/* 부과결과정보 등록(lntrisDMapper.insertD03) */ <insert id="insertD03" parameterType="map">/* 부과결과정보 등록(lntrisDMapper.insertD03) */
<selectKey keyProperty="d03.d03Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d03.d03Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D03 A, (<include refid="utility.selectToday" />) B
WHERE D03_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D03_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D03 ( INSERT INTO TB_NIS_INDIV_D03 (
@ -1171,7 +1171,7 @@ UPDATE TB_NIS_INDIV_D03
<insert id="insertD04" parameterType="map">/* 부과취소정보 등록(lntrisDMapper.insertD04) */ <insert id="insertD04" parameterType="map">/* 부과취소정보 등록(lntrisDMapper.insertD04) */
<selectKey keyProperty="d04.d04Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d04.d04Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D04 A, (<include refid="utility.selectToday" />) B
WHERE D04_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D04_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D04 ( INSERT INTO TB_NIS_INDIV_D04 (
@ -1337,7 +1337,7 @@ UPDATE TB_NIS_INDIV_D04
<insert id="insertD05" parameterType="map">/* 수납정보 등록(lntrisDMapper.insertD05) */ <insert id="insertD05" parameterType="map">/* 수납정보 등록(lntrisDMapper.insertD05) */
<selectKey keyProperty="d05.d05Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d05.d05Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D05 A, (<include refid="utility.selectToday" />) B
WHERE D05_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D05_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D05 ( INSERT INTO TB_NIS_INDIV_D05 (
@ -1541,7 +1541,7 @@ UPDATE TB_NIS_INDIV_D05
<insert id="insertD06" parameterType="map">/* 감액정보 등록(lntrisDMapper.insertD06) */ <insert id="insertD06" parameterType="map">/* 감액정보 등록(lntrisDMapper.insertD06) */
<selectKey keyProperty="d06.d06Id" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d06.d06Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D06 A, (<include refid="utility.selectToday" />) B
WHERE D06_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D06_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D06 ( INSERT INTO TB_NIS_INDIV_D06 (

@ -262,7 +262,7 @@
<insert id="insertD07a" parameterType="map">/* 부과체납정보 등록(lntrisD07Mapper.insertD07a) */ <insert id="insertD07a" parameterType="map">/* 부과체납정보 등록(lntrisD07Mapper.insertD07a) */
<selectKey keyProperty="d07a.d07aId" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d07a.d07aId" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D07A A, (<include refid="utility.selectToday" />) B
WHERE D07A_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D07A_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D07A ( INSERT INTO TB_NIS_INDIV_D07A (
@ -627,7 +627,7 @@ UPDATE TB_NIS_INDIV_D07A
<insert id="insertD07b" parameterType="map">/* 수납정보 등록(lntrisD07Mapper.insertD07b) */ <insert id="insertD07b" parameterType="map">/* 수납정보 등록(lntrisD07Mapper.insertD07b) */
<selectKey keyProperty="d07b.d07bId" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d07b.d07bId" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D07B A, (<include refid="utility.selectToday" />) B
WHERE D07B_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D07B_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D07B ( INSERT INTO TB_NIS_INDIV_D07B (
@ -832,7 +832,7 @@ UPDATE TB_NIS_INDIV_D07B
<insert id="insertD07c" parameterType="map">/* 감액정보 등록(lntrisD07Mapper.insertD07c) */ <insert id="insertD07c" parameterType="map">/* 감액정보 등록(lntrisD07Mapper.insertD07c) */
<selectKey keyProperty="d07c.d07cId" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d07c.d07cId" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D07C A, (<include refid="utility.selectToday" />) B
WHERE D07C_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D07C_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D07C ( INSERT INTO TB_NIS_INDIV_D07C (
@ -1031,7 +1031,7 @@ UPDATE TB_NIS_INDIV_D07C
<insert id="insertD07d" parameterType="map">/* 과오납정보 등록(lntrisD07Mapper.insertD07d) */ <insert id="insertD07d" parameterType="map">/* 과오납정보 등록(lntrisD07Mapper.insertD07d) */
<selectKey keyProperty="d07d.d07dId" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d07d.d07dId" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D07D A, (<include refid="utility.selectToday" />) B
WHERE D07D_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D07D_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D07D ( INSERT INTO TB_NIS_INDIV_D07D (
@ -1246,7 +1246,7 @@ UPDATE TB_NIS_INDIV_D07D
<insert id="insertD07e" parameterType="map">/* 결손정보 등록(lntrisD07Mapper.insertD07e) */ <insert id="insertD07e" parameterType="map">/* 결손정보 등록(lntrisD07Mapper.insertD07e) */
<selectKey keyProperty="d07e.d07eId" keyColumn="NEW_ID" resultType="string" order="BEFORE"> <selectKey keyProperty="d07e.d07eId" keyColumn="NEW_ID" resultType="string" order="BEFORE">
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, (<include refid="utility.selectToday" />) B FROM TB_NIS_INDIV_D07E A, (<include refid="utility.selectToday" />) B
WHERE D07E_ID LIKE CONCAT(TODAY, '%')</selectKey> WHERE D07E_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_NIS_INDIV_D07E ( INSERT INTO TB_NIS_INDIV_D07E (

Loading…
Cancel
Save