BoardMapper.xml
bitcocom opened this issue · 0 comments
bitcocom commented
<?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="kr.gsm.dao.BoardMapper">
<select id="getList" resultType="kr.gsm.entity.Board">
select * from board order by idx desc
</select>
<insert id="boardInsert" parameterType="kr.gsm.entity.Board">
insert into board(title,content,writer)
values(#{title},#{content},#{writer})
</insert>
<select id="boardContent" resultType="kr.gsm.entity.Board"
parameterType="int">
select * from board where idx=#{idx}
</select>
<delete id="boardDelete" parameterType="int">
delete from board where idx=#{idx}
</delete>
<update id="boardUpdate" parameterType="kr.gsm.entity.Board">
update board set title=#{title}, content=#{content}
where idx=#{idx}
</update>
<update id="addCount" parameterType="int">
update board set count=count+1 where idx=#{idx}
</update>
</mapper>