<resultMap id="queryOrderListResultMap" type="com.rs.modules.system.entity.AppCommentDO">
</resultMap>
<select id="getEndComment" resultMap="queryOrderListResultMap">
SELECT comenet.id, comenet.user_id,comenet.object_id,comenet.type,comenet.content,comenet.status,comenet.create_time FROM ( SELECT a.id, a.user_id,a.object_id,a.type,a.content,a.status,a.create_time FROM app_comment a WHERE EXISTS (
SELECT 1 FROM app_chapter_sub cs WHERE a.object_id = cs.id AND a.type = 1
) OR EXISTS (
SELECT 1 FROM app_thematic_sub ts WHERE a.object_id = ts.id AND a.type = 2
) ORDER BY a.create_time DESC ) AS comenet
<where>
<if test="appCommentDO.status !=null" > AND comenet.status=#{appCommentDO.status}</if>
<if test="appCommentDO.type !=null" > AND comenet.type=#{appCommentDO.type}</if>
<if test="appCommentDO.content !=null" > AND comenet.content like concat('%', #{appCommentDO.content}, '%')</if>
</where>
LIMIT #{pageNo},#{pageSize}
</select>