23.09.09

mingu·2023년 9월 8일

mapper

<select id="select" parameterType="int" resultType="BoardDto">
	<include refid="selectFromBoard"/>
     WHERE bno = #{bno}
</select>

dao

BoardDto select(int bno) {
	return session.selectOne("select", bno);
}

  • mapper에서 두개의 값을 받는 경우 parameterType="map"을 사용한다.

mapper

<select id="selectPage" parameterType="map" resultType="BoardDto">
	<include refid="selectFromBoard"/>
	 ORDER BY reg_date DESC, bno DESC
     LIMIT #{offset}, #{pageSize}
</select>

dao

@Override
public List<BoardDto> selectPage(Map map) throws Exception {
	return session.selectList(namespace+"selectPage", map);
} // List<E> selectList(String statement, Object parameter)

0개의 댓글