<?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.mzl.flower.mapper.film.CommentPoExMapper">
|
<resultMap id="BaseResultMap" type="com.mzl.flower.entity.film.CommentPo">
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
<result column="parent_id" jdbcType="INTEGER" property="parentId"/>
|
<result column="content" jdbcType="VARCHAR" property="content"/>
|
<result column="film_id" jdbcType="INTEGER" property="filmId"/>
|
<result column="state" jdbcType="BIT" property="state"/>
|
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
fs_comment.id, fs_comment.parent_id, fs_comment.content, fs_comment.film_id, fs_comment.`state`, fs_comment.deleted,
|
fs_comment.create_by, fs_comment.create_time, fs_comment.update_time
|
</sql>
|
|
<select id="selectLatestComments" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
|
where fs_comment.deleted = 0
|
and fs_comment.state = 1
|
and fs_article.state = 1
|
and fs_article.deleted = 0
|
order by fs_comment.id desc
|
</select>
|
|
<select id="getAllArticleComment" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
|
where fs_comment.deleted = 0
|
and fs_comment.state = 1
|
and fs_article.state = 1
|
and fs_comment.create_time between #{startTime} and #{endTime}
|
and fs_comment.parent_id = 0
|
</select>
|
|
<select id="getAllCommentReply" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
|
where fs_comment.deleted = 0
|
and fs_comment.state = 1
|
and fs_article.state = 1
|
and fs_comment.create_time between #{startTime} and #{endTime}
|
and fs_comment.parent_id != 0
|
</select>
|
|
</mapper>
|