ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [게시판] DataBase
    프로젝트 2022. 7. 21. 12:43

    BoardMapper.xml

    <?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.ptsd.model.BoardDAO">
    	<insert id="boardinsert" parameterType="BoardVO">
    		insert into PTSD_BOARD values(#{TAXI_NUM}, ptsd_seq.nextval, #{TAXI_COMMENT_TITLE}, 
    		#{TAXI_COMMENT_WRITER}, #{TAXI_COMMENT_COMMENT}, sysdate, #{BOARDLIST_NUM}, #{RATING})
    	</insert>
    	
    	<select id="boardselect"  resultType="BoardVO">
    	
    	<!--select * from 
        (select  rank() over(order by taxi_comment_date desc) rank, ptsd_board.taxi_comment_title, ptsd_board.taxi_comment_writer,ptsd_board.taxi_comment_date
        from ptsd_board)
    <![CDATA[where rank <=10]]>  -->
    	
    <!-- select * from 
        (select  rank() over(order by taxi_comment_date desc) rank, ptsd_board.taxi_comment_title, ptsd_board.taxi_comment_writer,ptsd_board.taxi_comment_date
        from ptsd_board)
    <![CDATA[where rank >= 11 and rank <= 20]]> -->
    	
    		
    		<!--  select * from (select ROWNUM as rn from PTSD_BOARD where ROWNUM <= 20) where rn >10  -->
    	
    		<!-- select * from PTSD_BOARD order by TAXI_COMMENT_DATE desc limit 0,5  -->
    		
    		<!-- select * from PTSD_BOARD order by TAXI_COMMENT_DATE desc limit #{pageStart}, #{perPageNum}  -->
    		
    		 select * from PTSD_BOARD order by TAXI_COMMENT_DATE desc  
    	</select>
    	
    	<select id="boarddetail" parameterType="int" resultType="BoardVO">
    		select * from PTSD_BOARD where TAXI_COMMENT_SEQ=#{TAXI_COMMENT_SEQ}
    	</select>
    	
    	<delete id="boarddelete">
    		delete from PTSD_BOARD where TAXI_COMMENT_SEQ=#{TAXI_COMMENT_SEQ}
    	</delete>
    	
    	
    </mapper>

    '프로젝트' 카테고리의 다른 글

    [ jsp ] board.jsp  (0) 2022.07.21
    [게시판] Model  (0) 2022.07.21
    [게시판] Controller  (0) 2022.07.21
    [로그인/로그아웃] Controller  (0) 2022.07.21
    [회원 가입, 로그인] Model  (0) 2022.07.21

    댓글

Designed by Tistory.