|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
<?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-jar">
|
|
|
|
|
<mapper namespace="utility">
|
|
|
|
|
|
|
|
|
|
<!-- For Maria DB -->
|
|
|
|
|
<sql id="paging-prefix">
|
|
|
|
|
<if test="fetchSize != null and fetchSize > 0">
|
|
|
|
|
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.*
|
|
|
|
|
FROM (</if>
|
|
|
|
|
</sql>
|
|
|
|
@ -17,7 +17,7 @@ SELECT QROWS.* FROM (
|
|
|
|
|
WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize})</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="foundRows" resultType="dataobject">/* 전체 결과수 가져오기(utility-jar.foundRows) */
|
|
|
|
|
<select id="foundRows" resultType="dataobject">/* 전체 결과수 가져오기(utility.foundRows) */
|
|
|
|
|
SELECT FOUND_ROWS() TOT_CNT
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ SELECT FOUND_ROWS() TOT_CNT
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="orderBy">
|
|
|
|
|
<if test="fetchSize == null or fetchSize < 1"><include refid="utility-jar.sortBy" /></if>
|
|
|
|
|
<if test="fetchSize == null or fetchSize < 1"><include refid="utility.sortBy" /></if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="now">
|
|
|
|
@ -34,7 +34,7 @@ SELECT FOUND_ROWS() TOT_CNT
|
|
|
|
|
<if test="_databaseId == 'oracle'">TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS')</if>
|
|
|
|
|
</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">
|
|
|
|
|
<if test="_databaseId == 'mariadb'">DATE_FORMAT(CURRENT_DATE, '%Y%m%d')</if>
|
|
|
|
@ -42,15 +42,15 @@ SELECT FOUND_ROWS() TOT_CNT
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="selectToday">
|
|
|
|
|
SELECT<include refid="utility-jar.today" />TODAY FROM DUAL
|
|
|
|
|
SELECT<include refid="utility.today" />TODAY FROM DUAL
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="thisDay">
|
|
|
|
|
NVL(#{thisDay},<include refid="utility-jar.today" />)
|
|
|
|
|
NVL(#{thisDay},<include refid="utility.today" />)
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="selectThisDay">
|
|
|
|
|
SELECT<include refid="utility-jar.thisDay" />THIS_DAY FROM DUAL
|
|
|
|
|
SELECT<include refid="utility.thisDay" />THIS_DAY FROM DUAL
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="currentYear">
|