오라클 SQL 지원

master
mjkhan21 11 months ago
parent 143595a4e4
commit 0b21254640

@ -52,6 +52,15 @@
<artifactId>xit-lntris</artifactId> <artifactId>xit-lntris</artifactId>
<version>23.04.01-SNAPSHOT</version> <version>23.04.01-SNAPSHOT</version>
</dependency> </dependency>
<!--
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.1.0.2.0</version>
<scope>system</scope>
<systemPath>${basedir}/src/test/resources/ojdbc6.jar</systemPath>
</dependency>
-->
</dependencies> </dependencies>
<build> <build>

@ -41,6 +41,7 @@ public class LntrisA02Bean extends InterfaceInfoReader<LntrisA02> {
*/ */
public List<DataObject> getA02List(int pageNum, int fetchSize) { public List<DataObject> getA02List(int pageNum, int fetchSize) {
DataObject params = new DataObject() DataObject params = new DataObject()
.set("orderBy", "A02_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize); .set("fetchSize", fetchSize);
return lntrisAMapper.selectA02List(params); return lntrisAMapper.selectA02List(params);

@ -50,7 +50,12 @@ public class LntrisA03Bean extends ScheduledBean {
* @return * @return
*/ */
public List<DataObject> getA03List(int pageNum, int fetchSize) { public List<DataObject> getA03List(int pageNum, int fetchSize) {
return lntrisAMapper.selectA03List(new DataObject().set("pageNum", pageNum).set("fetchSize", fetchSize)); return lntrisAMapper.selectA03List(
new DataObject()
.set("orderBy", "A03_ID")
.set("pageNum", pageNum)
.set("fetchSize", fetchSize)
);
} }
public List<LntrisA03.A03Response> getA03s() { public List<LntrisA03.A03Response> getA03s() {

@ -40,6 +40,7 @@ public interface LntrisD07Mapper extends AbstractMapper {
.set("sgbCd", sgbCd) .set("sgbCd", sgbCd)
.set("dptCd", dptCd) .set("dptCd", dptCd)
.set("rprsTxmCd", rprsTxmCd) .set("rprsTxmCd", rprsTxmCd)
.set("orderBy", "D07A_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -114,6 +115,7 @@ public interface LntrisD07Mapper extends AbstractMapper {
.set("sgbCd", sgbCd) .set("sgbCd", sgbCd)
.set("dptCd", dptCd) .set("dptCd", dptCd)
.set("rprsTxmCd", rprsTxmCd) .set("rprsTxmCd", rprsTxmCd)
.set("orderBy", "D07B_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -188,6 +190,7 @@ public interface LntrisD07Mapper extends AbstractMapper {
.set("sgbCd", sgbCd) .set("sgbCd", sgbCd)
.set("dptCd", dptCd) .set("dptCd", dptCd)
.set("rprsTxmCd", rprsTxmCd) .set("rprsTxmCd", rprsTxmCd)
.set("orderBy", "D07C_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -262,6 +265,7 @@ public interface LntrisD07Mapper extends AbstractMapper {
.set("sgbCd", sgbCd) .set("sgbCd", sgbCd)
.set("dptCd", dptCd) .set("dptCd", dptCd)
.set("rprsTxmCd", rprsTxmCd) .set("rprsTxmCd", rprsTxmCd)
.set("orderBy", "D07D_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -336,6 +340,7 @@ public interface LntrisD07Mapper extends AbstractMapper {
.set("sgbCd", sgbCd) .set("sgbCd", sgbCd)
.set("dptCd", dptCd) .set("dptCd", dptCd)
.set("rprsTxmCd", rprsTxmCd) .set("rprsTxmCd", rprsTxmCd)
.set("orderBy", "D07E_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );

@ -138,6 +138,7 @@ public interface LntrisDMapper extends AbstractMapper {
*/ */
default List<DataObject> selectD03List(int pageNum, int fetchSize) { default List<DataObject> selectD03List(int pageNum, int fetchSize) {
return selectD03List(params() return selectD03List(params()
.set("orderBy", "D03_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -207,6 +208,7 @@ public interface LntrisDMapper extends AbstractMapper {
*/ */
default List<DataObject> selectD04List(int pageNum, int fetchSize) { default List<DataObject> selectD04List(int pageNum, int fetchSize) {
return selectD04List(params() return selectD04List(params()
.set("orderBy", "D04_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -276,6 +278,7 @@ public interface LntrisDMapper extends AbstractMapper {
*/ */
default List<DataObject> selectD05List(int pageNum, int fetchSize) { default List<DataObject> selectD05List(int pageNum, int fetchSize) {
return selectD05List(params() return selectD05List(params()
.set("orderBy", "D05_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );
@ -345,6 +348,7 @@ public interface LntrisDMapper extends AbstractMapper {
*/ */
default List<DataObject> selectD06List(int pageNum, int fetchSize) { default List<DataObject> selectD06List(int pageNum, int fetchSize) {
return selectD06List(params() return selectD06List(params()
.set("orderBy", "D06_ID")
.set("pageNum", pageNum) .set("pageNum", pageNum)
.set("fetchSize", fetchSize) .set("fetchSize", fetchSize)
); );

@ -1,7 +1,5 @@
package cokr.xit.interfaces.lntris.basic.d.service.bean; package cokr.xit.interfaces.lntris.basic.d.service.bean;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.log;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;

@ -1,5 +1,6 @@
{ {
"useDatabase": false, "useDatabase": true,
"sendRequest": false,
"locals": [ "locals": [
{"organization": "4060000",/* 지역 자치단체 코드(7자리) */ {"organization": "4060000",/* 지역 자치단체 코드(7자리) */

@ -399,7 +399,7 @@ INSERT INTO TB_NIS_INDIV_A01 (
)</insert> )</insert>
<update id="updateA01Status" parameterType="map">/* 과태료 대장 단속 정보 연계상태 수정(lntrisAMapper.updateA01Status) */ <update id="updateA01Status" parameterType="map">/* 과태료 대장 단속 정보 연계상태 수정(lntrisAMapper.updateA01Status) */
UPDATE TB_NIS_INDIV_A01 A <if test="_databaseId == 'mariadb'">UPDATE TB_NIS_INDIV_A01 A
, (<foreach collection="a01s" item="a01" separator=" UNION"> , (<foreach collection="a01s" item="a01" separator=" UNION">
SELECT #{a01.a01Id} A01_ID, #{a01.response.resVo1.linkMngKey} LINK_MNG_KEY, #{a01.response.linkRstCd} LINK_RST_CD, #{a01.response.linkRstMsg} LINK_RST_MSG</foreach> SELECT #{a01.a01Id} A01_ID, #{a01.response.resVo1.linkMngKey} LINK_MNG_KEY, #{a01.response.linkRstCd} LINK_RST_CD, #{a01.response.linkRstMsg} LINK_RST_MSG</foreach>
) B ) B
@ -407,7 +407,16 @@ UPDATE TB_NIS_INDIV_A01 A
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 --> , A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 --> , A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --> , A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 -->
WHERE A.A01_ID = B.A01_ID</update> WHERE A.A01_ID = B.A01_ID</if>
<if test="_databaseId == 'oracle'">MERGE INTO TB_NIS_INDIV_A01 A USING
(<foreach collection="a01s" item="a01" separator=" UNION">
SELECT #{a01.a01Id} A01_ID, #{a01.response.resVo1.linkMngKey} LINK_MNG_KEY, #{a01.response.linkRstCd} LINK_RST_CD, #{a01.response.linkRstMsg} LINK_RST_MSG FROM DUAL</foreach>
) B ON (A.A01_ID = B.A01_ID)
WHEN MATCHED THEN UPDATE
SET A.LINK_RST_DT =<include refid="utility.now" /> <!-- 연계 결과 일시 -->
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --></if></update>
<resultMap id="a02Row" type="cokr.xit.interfaces.lntris.basic.a.LntrisA02"> <!-- 과태료 대장 전일자 변동자료 --> <resultMap id="a02Row" type="cokr.xit.interfaces.lntris.basic.a.LntrisA02"> <!-- 과태료 대장 전일자 변동자료 -->
<result property="a02Id" column="A02_ID" /> <!-- 일련번호 ID --> <result property="a02Id" column="A02_ID" /> <!-- 일련번호 ID -->

@ -387,7 +387,7 @@ INSERT INTO TB_NIS_INDIV_D01 (
)</insert> )</insert>
<update id="updateD01Status" parameterType="map">/* 부과정보 연계상태 수정(lntrisDMapper.updateD01) */ <update id="updateD01Status" parameterType="map">/* 부과정보 연계상태 수정(lntrisDMapper.updateD01) */
UPDATE TB_NIS_INDIV_D01 A <if test="_databaseId == 'mariadb'">UPDATE TB_NIS_INDIV_D01 A
, (<foreach collection="d01s" item="d01" separator=" UNION"> , (<foreach collection="d01s" item="d01" separator=" UNION">
SELECT #{d01.d01Id} D01_ID, #{d01.response.resVo.linkMngKey} LINK_MNG_KEY, #{d01.response.resVo.linkRstCd} LINK_RST_CD, #{d01.response.resVo.linkRstMsg} LINK_RST_MSG</foreach> SELECT #{d01.d01Id} D01_ID, #{d01.response.resVo.linkMngKey} LINK_MNG_KEY, #{d01.response.resVo.linkRstCd} LINK_RST_CD, #{d01.response.resVo.linkRstMsg} LINK_RST_MSG</foreach>
) B ) B
@ -395,7 +395,16 @@ UPDATE TB_NIS_INDIV_D01 A
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 --> , A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 --> , A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --> , A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 -->
WHERE A.D01_ID = B.D01_ID</update> WHERE A.D01_ID = B.D01_ID</if>
<if test="_databaseId == 'oracle'">MERGE INTO TB_NIS_INDIV_D01 A USING
(<foreach collection="d01s" item="d01" separator=" UNION">
SELECT #{d01.d01Id} D01_ID, #{d01.response.resVo.linkMngKey} LINK_MNG_KEY, #{d01.response.resVo.linkRstCd} LINK_RST_CD, #{d01.response.resVo.linkRstMsg} LINK_RST_MSG FROM DUAL</foreach>
) B ON (A.D01_ID = B.D01_ID)
WHEN MATCHED THEN UPDATE
SET A.LINK_RST_DT =<include refid="utility.now" /> <!-- 연계 결과 일시 -->
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --></if></update>
<resultMap id="d02Row" type="cokr.xit.interfaces.lntris.basic.d.LntrisD02"> <!-- 부과 수납정보 --> <resultMap id="d02Row" type="cokr.xit.interfaces.lntris.basic.d.LntrisD02"> <!-- 부과 수납정보 -->
<result property="d02Id" column="D02_ID" /> <!-- 일련번호 ID --> <result property="d02Id" column="D02_ID" /> <!-- 일련번호 ID -->
@ -801,14 +810,22 @@ INSERT INTO TB_NIS_INDIV_D02 (
)</insert> )</insert>
<update id="updateD02Status" parameterType="map">/* 부과수납 정보 연계상태 수정(lntrisDMapper.updateD02Status) */ <update id="updateD02Status" parameterType="map">/* 부과수납 정보 연계상태 수정(lntrisDMapper.updateD02Status) */
UPDATE TB_NIS_INDIV_D02 A <if test="_databaseId == 'mariadb'">UPDATE TB_NIS_INDIV_D02 A
, (<foreach collection="d02s" item="d02" separator=" UNION"> , (<foreach collection="d02s" item="d02" separator=" UNION">
SELECT #{d02.d02Id} D02_ID, #{d02.response.linkRstCd} LINK_RST_CD, #{d02.response.linkRstMsg} LINK_RST_MSG</foreach> SELECT #{d02.d02Id} D02_ID, #{d02.response.linkRstCd} LINK_RST_CD, #{d02.response.linkRstMsg} LINK_RST_MSG</foreach>
) B ) B
SET A.LINK_RST_DT =<include refid="utility.now" /> <!-- 연계 결과 일시 --> SET A.LINK_RST_DT =<include refid="utility.now" /> <!-- 연계 결과 일시 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 --> , A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --> , A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 -->
WHERE A.D02_ID = B.D02_ID</update> WHERE A.D02_ID = B.D02_ID</if>
<if test="_databaseId == 'oracle'">MERGE INTO TB_NIS_INDIV_D02 A USING
(<foreach collection="d02s" item="d02" separator=" UNION">
SELECT #{d02.d02Id} D02_ID, #{d02.response.linkRstCd} LINK_RST_CD, #{d02.response.linkRstMsg} LINK_RST_MSG FROM DUAL</foreach>
) B ON (A.D02_ID = B.D02_ID)
WHEN MATCHED THEN UPDATE
SET A.LINK_RST_DT =<include refid="utility.now" /> <!-- 연계 결과 일시 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, A.LINK_RST_MSG = B.LINK_RST_MSG <!-- 연계 결과 메시지 --></if></update>
<resultMap id="d03Row" type="cokr.xit.interfaces.lntris.basic.d.LntrisD03"> <!-- 부과결과정보 --> <resultMap id="d03Row" type="cokr.xit.interfaces.lntris.basic.d.LntrisD03"> <!-- 부과결과정보 -->
<result property="d03Id" column="D03_ID" /> <!-- 일련번호 ID --> <result property="d03Id" column="D03_ID" /> <!-- 일련번호 ID -->
@ -957,7 +974,7 @@ UPDATE TB_NIS_INDIV_D02 A
<include refid="utility.paging-prefix" /> <include refid="utility.paging-prefix" />
<include refid="selectD03" /> <include refid="selectD03" />
WHERE TASK_APLCN_CD = '999' WHERE TASK_APLCN_CD = '999'
<include refid="utility.paging-prefix" /></select> <include refid="utility.paging-suffix" /></select>
<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">

@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import cokr.xit.foundation.test.TestSupport; import cokr.xit.foundation.test.TestSupport;
@ -29,6 +30,11 @@ public class LntrisDServiceTest extends TestSupport {
@Resource(name = "lntrisDService") @Resource(name = "lntrisDService")
private LntrisDService dService; private LntrisDService dService;
@Test
void d01() {
dService.registerD01s();
}
@Test @Test
void d02() { void d02() {
dService.registerD02s(); dService.registerD02s();
@ -42,7 +48,8 @@ public class LntrisDServiceTest extends TestSupport {
String d07aIds = d07as.stream() String d07aIds = d07as.stream()
.map(d07a -> "'" + d07a.getD07aId() + "'") .map(d07a -> "'" + d07a.getD07aId() + "'")
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
// testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07A WHERE D07A_ID IN (" + d07aIds + ")"); int affected = testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07A WHERE D07A_ID IN (" + d07aIds + ")");
Assertions.assertEquals(affected, d07as.size());
} }
@Test @Test
@ -75,7 +82,8 @@ public class LntrisDServiceTest extends TestSupport {
String d07dIds = d07ds.stream() String d07dIds = d07ds.stream()
.map(d07d -> "'" + d07d.getD07dId() + "'") .map(d07d -> "'" + d07d.getD07dId() + "'")
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
// testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07D WHERE D07D_ID IN (" + d07dIds + ")"); int affected = testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07D WHERE D07D_ID IN (" + d07dIds + ")");
Assertions.assertEquals(affected, d07ds.size());
} }
@Test @Test
@ -86,6 +94,7 @@ public class LntrisDServiceTest extends TestSupport {
String d07eIds = d07es.stream() String d07eIds = d07es.stream()
.map(d07e -> "'" + d07e.getD07eId() + "'") .map(d07e -> "'" + d07e.getD07eId() + "'")
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
// testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07E WHERE D07E_ID IN (" + d07eIds + ")"); int affected = testMapper.execDelete("DELETE FROM TB_NIS_INDIV_D07E WHERE D07E_ID IN (" + d07eIds + ")");
Assertions.assertEquals(affected, d07es.size());
} }
} }

@ -62,14 +62,14 @@
<appender-ref ref="Error"/> <appender-ref ref="Error"/>
</root> </root>
<logger name="jdbc" level="OFF" additivity="false"/>
<logger name="jdbc.sqltiming" level="DEBUG" additivity="true"/>
<logger name="jdbc.resultsettable" level="OFF" additivity="false"/>
<logger name="jdbc.sqlonly" level="OFF"/>
<logger name="jdbc.resultset" level="OFF" additivity="false"/>
<logger name="jdbc.connection" level="OFF" additivity="false"/>
<logger name="jdbc.audit" level="DEBUG" additivity="true"/>
<logger name="org.apache.commons" level="OFF" additivity="false"/> <logger name="org.apache.commons" level="OFF" additivity="false"/>
<logger name="jdbc.connection" level="OFF" additivity="false"/>
<logger name="jdbc.sqlonly" level="OFF" additivity="false"/>
<logger name="jdbc.resultset" level="OFF" additivity="false"/>
<logger name="jdbc.resultsettable" level="OFF" additivity="false"/>
<logger name="jdbc.audit" level="OFF" additivity="false"/>
<logger name="com.zaxxer" level="OFF" additivity="false"/>
<logger name="jdbc.sqltiming" level="DEBUG" />
<logger name="org.quartz" level="Error" additivity="false"/> <logger name="org.quartz" level="Error" additivity="false"/>
<!-- 특정패키지 로깅레벨 설정 --> <!-- 특정패키지 로깅레벨 설정 -->

@ -51,16 +51,6 @@
<entry key="pageSize" value="10"/> <entry key="pageSize" value="10"/>
</map> </map>
</property> </property>
<property name="extFileName">
<set>
<map>
<entry key="encoding" value="UTF-8"/>
<entry key="filename" value="classpath*:properties/xit-lvis.properties"/>
</map>
</set>
</property>
</bean> </bean>
<bean id="leaveaTrace" class="org.egovframe.rte.fdl.cmmn.trace.LeaveaTrace" /> <bean id="leaveaTrace" class="org.egovframe.rte.fdl.cmmn.trace.LeaveaTrace" />

@ -10,13 +10,13 @@
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="net.sf.log4jdbc.sql.jdbcapi.DriverSpy"/> <property name="driverClassName" value="net.sf.log4jdbc.sql.jdbcapi.DriverSpy"/>
<property name="url" value="jdbc:log4jdbc:oracle:thin:@211.119.124.117:1521/ora11g" />
<property name="username" value="xit_traffic"/>
<property name="password" value="traffic5"/>
<!--
<property name="url" value="jdbc:log4jdbc:mariadb://211.119.124.9:4407/platform?useUnicode=true&amp;characterEncoding=utf8&amp;serverTimezone=Asia/Seoul&amp;useSSL=false" /> <property name="url" value="jdbc:log4jdbc:mariadb://211.119.124.9:4407/platform?useUnicode=true&amp;characterEncoding=utf8&amp;serverTimezone=Asia/Seoul&amp;useSSL=false" />
<property name="username" value="fimsweb"/> <property name="username" value="fimsweb"/>
<property name="password" value="fimsweb!@"/> <property name="password" value="fimsweb!@"/>
<!--
<property name="url" value="jdbc:log4jdbc:mariadb://localhost:3306/xit-base?useUnicode=true&amp;characterEncoding=utf8&amp;serverTimezone=Asia/Seoul&amp;useSSL=false" />
<property name="username" value="root"/>
<property name="password" value="mjkhan"/>
--> -->
</bean> </bean>

Loading…
Cancel
Save