SPRING/chapter04_MVC

BoardAttachMapper.xml

GAWON 2023. 7. 18. 09:26
<?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="org.joonzis.mapper.BoardAttachMapper">
	
	<insert id="insert" parameterType="org.joonzis.domain.BoardAttachVO">
		INSERT INTO tbl_attach(uuid, uploadPath, fileName, fileType, bno)
		VALUES(
			#{uuid},
			#{uploadPath},
			#{fileName},
			'',
			#{bno}
		)
	</insert>
	<delete id="delete">
	 	delete from tbl_attach where uuid=#{uuid}
	</delete>
	
	<select id="findByBno" resultType="org.joonzis.domain.BoardAttachVO">
			SELECT * FROM tbl_attach where bno=#{bno} 
	</select>
	<delete id="deleteAll">
		delete tbl_attach where bno=#{bno}
	</delete>
	
</mapper>