forked from EnjoyTripKorea/EnjoyTripBackend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
EnjoyTripBackend/src/main/resources/mapper/board-query.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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.example.EnjoyTripBackend.repository.BoardRepository"> | ||
<insert id="save" parameterType="com.example.EnjoyTripBackend.dto.Board.BoardDto"> | ||
insert | ||
into board | ||
values (#{id}, #{memberId}, #{title}, #{content}, now(), now()) | ||
</insert> | ||
|
||
<select id="findById" parameterType="long" resultType="com.example.EnjoyTripBackend.dto.Board.BoardDto"> | ||
select * | ||
from board | ||
where id = #{id} | ||
</select> | ||
|
||
<select id="findAll" resultType="com.example.EnjoyTripBackend.dto.Board.BoardDto"> | ||
select id, member_id, title, content, createdDate, modifiedDate | ||
from board | ||
</select> | ||
|
||
<update id="update" parameterType="map"> | ||
update board | ||
set member_id = #{boardDto.memberId},title = #{boardDto.title},content = #{boardDto.content},modifiedDate = now() | ||
where id = #{id} | ||
</update> | ||
|
||
<delete id="delete"> | ||
delete | ||
from board | ||
where id = #{id} | ||
</delete> | ||
</mapper> |