refactor : sql mapper파일 위치 변경
parent
9a96a810cc
commit
661b819a63
@ -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 > 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 > 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 < 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>
|
Loading…
Reference in New Issue