오라클 SQL 지원

master
mjkhan21 11 months ago
parent 143595a4e4
commit 0b21254640

@ -52,6 +52,15 @@
<artifactId>xit-lntris</artifactId>
<version>23.04.01-SNAPSHOT</version>
</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>
<build>

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

@ -50,7 +50,12 @@ public class LntrisA03Bean extends ScheduledBean {
* @return
*/
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() {

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

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

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

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

@ -399,7 +399,7 @@ INSERT INTO TB_NIS_INDIV_A01 (
)</insert>
<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">
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
@ -407,7 +407,16 @@ UPDATE TB_NIS_INDIV_A01 A
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, 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"> <!-- 과태료 대장 전일자 변동자료 -->
<result property="a02Id" column="A02_ID" /> <!-- 일련번호 ID -->

@ -387,7 +387,7 @@ INSERT INTO TB_NIS_INDIV_D01 (
)</insert>
<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">
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
@ -395,7 +395,16 @@ UPDATE TB_NIS_INDIV_D01 A
, A.LINK_MNG_KEY = B.LINK_MNG_KEY <!-- 연계 관리키 -->
, A.LINK_RST_CD = B.LINK_RST_CD <!-- 연계 결과 코드 -->
, 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"> <!-- 부과 수납정보 -->
<result property="d02Id" column="D02_ID" /> <!-- 일련번호 ID -->
@ -801,14 +810,22 @@ INSERT INTO TB_NIS_INDIV_D02 (
)</insert>
<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">
SELECT #{d02.d02Id} D02_ID, #{d02.response.linkRstCd} LINK_RST_CD, #{d02.response.linkRstMsg} LINK_RST_MSG</foreach>
) B
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 <!-- 연계 결과 메시지 -->
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"> <!-- 부과결과정보 -->
<result property="d03Id" column="D03_ID" /> <!-- 일련번호 ID -->
@ -957,7 +974,7 @@ UPDATE TB_NIS_INDIV_D02 A
<include refid="utility.paging-prefix" />
<include refid="selectD03" />
WHERE TASK_APLCN_CD = '999'
<include refid="utility.paging-prefix" /></select>
<include refid="utility.paging-suffix" /></select>
<insert id="insertD03" parameterType="map">/* 부과결과정보 등록(lntrisDMapper.insertD03) */
<selectKey keyProperty="d03.d03Id" keyColumn="NEW_ID" resultType="string" order="BEFORE">
@ -1041,7 +1058,7 @@ INSERT INTO TB_NIS_INDIV_D03 (
, #{req.taxnNo} <!-- 과세번호 -->
, #{req.untyTaxnNo} <!-- 통합과세번호 -->
, #{req.dptCd} <!-- 부서코드 -->
, #{req.spclFisBizCd} <!-- 특별회계사업코드 -->
, #{req.spclFisBizCd} <!-- 특별회계사업코드 -->
, #{req.fyr} <!-- 회계연도 -->
, #{req.actSeCd} <!-- 회계구분코드 -->
, #{req.rprsTxmCd} <!-- 대표세입과목코드 -->
@ -1587,35 +1604,35 @@ INSERT INTO TB_NIS_INDIV_D06 (
, MDFR <!-- 수정자 -->
) VALUES (
#{d06.d06Id} <!-- 일련번호 ID -->
, #{req.sgbCd} <!-- 자치단체코드 -->
, #{req.sgbNm} <!-- 자치단체명 -->
, #{req.linkMngKey} <!-- 연계관리키 -->
, #{req.taxnNo} <!-- 과세번호 -->
, #{req.untyTaxnNo} <!-- 통합과세번호 -->
, #{req.dptCd} <!-- 부서코드 -->
, #{req.dptNm} <!-- 부서명 -->
, #{req.spclFisBizCd} <!-- 특별회계사업코드 -->
, #{req.spclFisBizNm} <!-- 특별회계사업명 -->
, #{req.fyr} <!-- 회계연도 -->
, #{req.actSeCd} <!-- 회계구분코드 -->
, #{req.actSeNm} <!-- 회계구분명 -->
, #{req.rprsTxmCd} <!-- 대표세입과목코드 -->
, #{req.rprsTxmNm} <!-- 세입과목명 -->
, #{req.operItemCd} <!-- 운영항목코드 -->
, #{req.operItemNm} <!-- 운영항목명 -->
, #{req.lvyNo} <!-- 부과번호 -->
, #{req.itmNo} <!-- 분납번호 -->
, #{req.rdcYmd} <!-- 감액일자 -->
, #{req.rdcPctAmt} <!-- 감액본세금액 -->
, #{req.rdcAdtnAmt} <!-- 감액가산금액 -->
, #{req.rdcIntrAmt} <!-- 감액이자금액 -->
, #{req.rdcAmt} <!-- 감액금액 -->
, #{req.rdcRsnCn} <!-- 감액사유내용 -->
, #{req.rsveItem1} <!-- 예비항목1 -->
, #{req.rsveItem2} <!-- 예비항목2 -->
, #{req.rsveItem3} <!-- 예비항목3 -->
, #{req.rsveItem4} <!-- 예비항목4 -->
, #{req.rsveItem5} <!-- 예비항목5 -->
, #{req.sgbCd} <!-- 자치단체코드 -->
, #{req.sgbNm} <!-- 자치단체명 -->
, #{req.linkMngKey} <!-- 연계관리키 -->
, #{req.taxnNo} <!-- 과세번호 -->
, #{req.untyTaxnNo} <!-- 통합과세번호 -->
, #{req.dptCd} <!-- 부서코드 -->
, #{req.dptNm} <!-- 부서명 -->
, #{req.spclFisBizCd} <!-- 특별회계사업코드 -->
, #{req.spclFisBizNm} <!-- 특별회계사업명 -->
, #{req.fyr} <!-- 회계연도 -->
, #{req.actSeCd} <!-- 회계구분코드 -->
, #{req.actSeNm} <!-- 회계구분명 -->
, #{req.rprsTxmCd} <!-- 대표세입과목코드 -->
, #{req.rprsTxmNm} <!-- 세입과목명 -->
, #{req.operItemCd} <!-- 운영항목코드 -->
, #{req.operItemNm} <!-- 운영항목명 -->
, #{req.lvyNo} <!-- 부과번호 -->
, #{req.itmNo} <!-- 분납번호 -->
, #{req.rdcYmd} <!-- 감액일자 -->
, #{req.rdcPctAmt} <!-- 감액본세금액 -->
, #{req.rdcAdtnAmt} <!-- 감액가산금액 -->
, #{req.rdcIntrAmt} <!-- 감액이자금액 -->
, #{req.rdcAmt} <!-- 감액금액 -->
, #{req.rdcRsnCn} <!-- 감액사유내용 -->
, #{req.rsveItem1} <!-- 예비항목1 -->
, #{req.rsveItem2} <!-- 예비항목2 -->
, #{req.rsveItem3} <!-- 예비항목3 -->
, #{req.rsveItem4} <!-- 예비항목4 -->
, #{req.rsveItem5} <!-- 예비항목5 -->
, #{d06.linkRsltDt} <!-- 연계 결과 일시 -->
, #{d06.response.resVo.linkRstCd} <!-- 연계 결과 코드 -->
, #{d06.response.resVo.linkRstMsg} <!-- 연계 결과 메시지 -->

@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import cokr.xit.foundation.test.TestSupport;
@ -29,6 +30,11 @@ public class LntrisDServiceTest extends TestSupport {
@Resource(name = "lntrisDService")
private LntrisDService dService;
@Test
void d01() {
dService.registerD01s();
}
@Test
void d02() {
dService.registerD02s();
@ -42,7 +48,8 @@ public class LntrisDServiceTest extends TestSupport {
String d07aIds = d07as.stream()
.map(d07a -> "'" + d07a.getD07aId() + "'")
.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
@ -75,7 +82,8 @@ public class LntrisDServiceTest extends TestSupport {
String d07dIds = d07ds.stream()
.map(d07d -> "'" + d07d.getD07dId() + "'")
.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
@ -86,6 +94,7 @@ public class LntrisDServiceTest extends TestSupport {
String d07eIds = d07es.stream()
.map(d07e -> "'" + d07e.getD07eId() + "'")
.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"/>
</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="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"/>
<!-- 특정패키지 로깅레벨 설정 -->

@ -51,16 +51,6 @@
<entry key="pageSize" value="10"/>
</map>
</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 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">
<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="username" 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>

Loading…
Cancel
Save