utility.xml 수정

main
이범준 2 months ago
parent 1b6841ae90
commit 9ce3ea357c

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="utility-jar"> <mapper namespace="utility">
<!-- For Maria DB --> <!-- For Maria DB -->
<sql id="paging-prefix"> <sql id="paging-prefix">
<if test="fetchSize != null and fetchSize &gt; 0"> <if test="fetchSize != null and fetchSize &gt; 0">
SELECT QROWS.* FROM ( SELECT QROWS.* FROM (
SELECT ROW_NUMBER() OVER(<include refid="utility-jar.sortBy" />) ROW_NUM SELECT ROW_NUMBER() OVER(<include refid="utility.sortBy" />) ROW_NUM
, COUNT(*) OVER() TOT_CNT, QBODY.* , COUNT(*) OVER() TOT_CNT, QBODY.*
FROM (</if> FROM (</if>
</sql> </sql>
@ -17,7 +17,7 @@ SELECT QROWS.* FROM (
WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize})</if> WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize})</if>
</sql> </sql>
<select id="foundRows" resultType="dataobject">/* 전체 결과수 가져오기(utility-jar.foundRows) */ <select id="foundRows" resultType="dataobject">/* 전체 결과수 가져오기(utility.foundRows) */
SELECT FOUND_ROWS() TOT_CNT SELECT FOUND_ROWS() TOT_CNT
</select> </select>
@ -26,7 +26,7 @@ SELECT FOUND_ROWS() TOT_CNT
</sql> </sql>
<sql id="orderBy"> <sql id="orderBy">
<if test="fetchSize == null or fetchSize &lt; 1"><include refid="utility-jar.sortBy" /></if> <if test="fetchSize == null or fetchSize &lt; 1"><include refid="utility.sortBy" /></if>
</sql> </sql>
<sql id="now"> <sql id="now">
@ -34,7 +34,7 @@ SELECT FOUND_ROWS() TOT_CNT
<if test="_databaseId == 'oracle'">TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS')</if> <if test="_databaseId == 'oracle'">TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS')</if>
</sql> </sql>
<sql id="selectNow">SELECT<include refid="utility-jar.now" />NOW FROM DUAL</sql> <sql id="selectNow">SELECT<include refid="utility.now" />NOW FROM DUAL</sql>
<sql id="today"> <sql id="today">
<if test="_databaseId == 'mariadb'">DATE_FORMAT(CURRENT_DATE, '%Y%m%d')</if> <if test="_databaseId == 'mariadb'">DATE_FORMAT(CURRENT_DATE, '%Y%m%d')</if>
@ -42,15 +42,15 @@ SELECT FOUND_ROWS() TOT_CNT
</sql> </sql>
<sql id="selectToday"> <sql id="selectToday">
SELECT<include refid="utility-jar.today" />TODAY FROM DUAL SELECT<include refid="utility.today" />TODAY FROM DUAL
</sql> </sql>
<sql id="thisDay"> <sql id="thisDay">
NVL(#{thisDay},<include refid="utility-jar.today" />) NVL(#{thisDay},<include refid="utility.today" />)
</sql> </sql>
<sql id="selectThisDay"> <sql id="selectThisDay">
SELECT<include refid="utility-jar.thisDay" />THIS_DAY FROM DUAL SELECT<include refid="utility.thisDay" />THIS_DAY FROM DUAL
</sql> </sql>
<sql id="currentYear"> <sql id="currentYear">
Loading…
Cancel
Save