refactor : sql mapper파일 위치 변경

main
이범준 2 years ago
parent 9a96a810cc
commit 661b819a63

@ -749,7 +749,8 @@
<include>spring/*.xml</include>
<include>spring/*/*.xml</include>
<include>spring/service/cache/*.xml</include>
<include>sqlmapper/**/*</include>
<include>sql/mybatis-config.xml</include>
<include>sql/mapper/**/*</include>
<include>validator/**/*</include>
<include>template/**/*</include>
<include>templates/thymeleaf/**/*</include>

@ -2,18 +2,12 @@
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
<!-- SqlSession setup for MyBatis Database Layer -->
<!-- 운영서버 배포 시 설정 -->
<!-- <bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean"> -->
<!-- <property name="dataSource" ref="dataSource-${Globals.DbType}" /> -->
<!-- <property name="configLocation" value="classpath:/framework/sqlmap/xit/config/sql-mapper-config.xml" /> -->
<!-- <property name="mapperLocations" value="classpath:/framework/sqlmap/**/sql/${Globals.DbType}/**/*.xml" /> -->
<!-- </bean> -->
<!-- 개발환경 시 설정 [2020.10.14. 박민규] - auto deploy 적용(개발환경 편의를 위한 설정이며, 운영환경에서는 성능저하 발생 우려가 있으므로 사용 지양, 재로딩 term을 지정하고 싶을 경우 p:interval="1000" 사용. 단위(ms))-->
<bean id="sqlSession" class="kr.xit.fims.framework.core.utils.XitRefreshableSqlSessionFactoryBean"
p:dataSource-ref="dataSource-${Globals.DbType}"
p:configLocation="classpath:/sqlmapper/sql-mapper-config.xml"
p:mapperLocations="classpath:/sqlmapper/**/*-${Globals.DbType}-mapper.xml"
p:configLocation="classpath:/sql/mybatis-config.xml"
p:mapperLocations="classpath:/sql/mapper/**/*-${Globals.DbType}-mapper.xml"
/>
<!-- SqlSessionTemplate setup for MyBatis Database Layer -->

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="utility">
<!-- For Maria DB -->
<sql id="paging-prefix">
<if test="fetchSize != null and fetchSize &gt; 0">
SELECT QROWS.* FROM (
SELECT ROW_NUMBER() OVER(<include refid="utility.sortBy" />) ROW_NUM
, COUNT(*) OVER() TOT_CNT, QBODY.*
FROM (</if>
</sql>
<sql id="paging-suffix">
<if test="fetchSize != null and fetchSize &gt; 0"> ) QBODY
) QROWS
WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize})
</if>
</sql>
<select id="foundRows" resultType="dataobject">/* 전체 결과수 가져오기(utility.foundRows) */
SELECT FOUND_ROWS() TOT_CNT
</select>
<sql id="sortBy"><if test="orderBy != null and orderBy != ''">ORDER BY ${orderBy}</if></sql>
<sql id="orderBy"><if test="fetchSize == null or fetchSize &lt; 1"><include refid="utility.sortBy" /></if></sql>
<sql id="thisDay">IFNULL(#{thisDay}, TO_CHAR(CURRENT_DATE, 'YYYYMMDD'))</sql>
<sql id="selectThisDay">SELECT<include refid="utility.thisDay" />THIS_DAY</sql>
</mapper>

@ -48,6 +48,7 @@
</settings>
<typeAliases>
<typeAlias alias="egovMap" type="org.egovframe.rte.psl.dataaccess.util.EgovMap"/>
<typeAlias alias="dataobject" type="cokr.xit.foundation.data.DataObject"/>
<typeAlias alias="xitMap" type="kr.xit.fims.framework.core.utils.XitMap"/>
<!-- Parameter에 선언시 Key 대소문자 구분X / resultType에 선언하면 Key가 소문자로 mapping -->
@ -66,6 +67,8 @@
<typeHandler javaType="java.sql.Time" handler="org.apache.ibatis.type.DateTypeHandler"/>
<typeHandler javaType="java.sql.Date" handler="org.apache.ibatis.type.DateTypeHandler"/>
<typeHandler handler="kr.xit.fims.framework.support.mybatis.ObjectTypeHandler" javaType="java.lang.Object"/>
<typeHandler handler="cokr.xit.foundation.data.RowValueHandler" javaType="java.lang.Object"/>
</typeHandlers>
<plugins>
Loading…
Cancel
Save