2a2f81dc32
- com.sb.web 패키지로 재구성: account / auth / board / user / admin / common - 가계부(account): 내역(필터), 계좌·순자산, 예산, 분류, 정기 거래, 투자 포트폴리오 (종목·매매 이력, 이동평균 평단·실현/평가손익) - MyBatis + MariaDB + Redis 세션, BCrypt - 스키마 자동 초기화(db/*.sql, 멱등), 사용자별 데이터 격리(member_id) - 문서: docs/BACKEND.md, .env.example Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 lines
1.6 KiB
XML
43 lines
1.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.sb.web.board.mapper.CommentMapper">
|
|
|
|
<resultMap id="commentResultMap" type="com.sb.web.board.domain.Comment">
|
|
<id property="id" column="id"/>
|
|
<result property="postId" column="post_id"/>
|
|
<result property="authorId" column="author_id"/>
|
|
<result property="authorName" column="author_name"/>
|
|
<result property="content" column="content"/>
|
|
<result property="createdAt" column="created_at"/>
|
|
</resultMap>
|
|
|
|
<select id="findByPostId" parameterType="long" resultMap="commentResultMap">
|
|
SELECT id, post_id, author_id, author_name, content, created_at
|
|
FROM comment
|
|
WHERE post_id = #{postId}
|
|
ORDER BY id ASC
|
|
</select>
|
|
|
|
<select id="findById" parameterType="long" resultMap="commentResultMap">
|
|
SELECT id, post_id, author_id, author_name, content, created_at
|
|
FROM comment
|
|
WHERE id = #{id}
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="com.sb.web.board.domain.Comment"
|
|
useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO comment (post_id, author_id, author_name, content, created_at)
|
|
VALUES (#{postId}, #{authorId}, #{authorName}, #{content}, NOW())
|
|
</insert>
|
|
|
|
<delete id="delete" parameterType="long">
|
|
DELETE FROM comment WHERE id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteByPostId" parameterType="long">
|
|
DELETE FROM comment WHERE post_id = #{postId}
|
|
</delete>
|
|
|
|
</mapper>
|