<?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="com.its.web.mapper.its.notice.NoticeMapper">
    <select id="findNoticeById" parameterType="java.util.HashMap">
        select
            A.idx,
            A.title,
            A.contents,
            A.u_idx,
            A.file_name,
            A.reg_dte,
            A.mod_dte,
            A.hit
         from
            tbl_board A
         where A.idx = #{idx}
    </select>

    <select id="findAllNotice" parameterType="java.util.HashMap">
        select
            AA.idx,
            AA.title,
            AA.contents,
            AA.u_idx,
            AA.file_name,
            AA.reg_dte,
            AA.mod_dte,
            AA.hit
        from (select
                  A.*,
                  ROWNUM AS rownum
                from (select
                          idx,
                          title,
                          contents,
                          u_idx,
                          file_name,
                          reg_dte,
                          mod_dte,
                          hit
                        from tbl_board
                       order by idx, reg_dte desc) A
            ) AA
        where AA.rownum BETWEEN #{fromPage} AND #{toPage}
    </select>

</mapper>