huanghongfa
2021-04-28 f1cee812a4cd17e02895a00bbabb009b1b4e67e9
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -6,6 +6,7 @@
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -19,7 +20,44 @@
@Mapper
public interface ComActNeighborCircleDAO extends BaseMapper<ComActNeighborCircleDO> {
    @Select("")
    @Select("<script> " +
            "SELECT " +
            "canc.id," +
            "canc.release_content," +
            "canc.release_images," +
            "canc.comment_num," +
            "canc.fabulous_num," +
            "canc.forward_num," +
            "canc.views_num," +
            "canc.is_boutique," +
            "canc.create_at," +
            "canc.reply_at," +
            "canc.last_comment_num," +
            "canc.last_fabulous_num," +
            "canc.last_views_num," +
            "su.nick_name as name," +
            "su.image_url as headUrl " +
            " FROM " +
            " com_act_neighbor_circle AS canc" +
            " left join sys_user as su on su.user_id = canc.release_id" +
            " where canc.status = 2 and canc.community_id = #{communityId} " +
            "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 1'>" +
            " order by (canc.last_views_num + canc.last_comment_num + canc.last_fabulous_num) desc " +
            " </if> " +
            "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 2'>" +
            " order by canc.reply_at desc,canc.create_at desc " +
            " </if> " +
            "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 3'>" +
            " order by (canc.views_num + canc.comment_num + canc.fabulous_num) desc " +
            " </if> " +
            " </script>")
    IPage<ComActNeighborCircleAppVO> pageNeighborByApp(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleAppDTO neighborCircleAppDTO);
    @Select("<script> " +
            "select canc.id,su.nick_name as name,su.image_url as headUrl,canc.release_content " +
            ",canc.release_images,canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num " +
            ",canc.is_boutique,canc.create_at,canc.reply_at from com_act_neighbor_circle as canc " +
            " left join sys_user as su on su.user_id = canc.release_id where id = #{circleId}"+
            " </script>")
    ComActNeighborCircleDetailAppVO neighborDetailByApp(@Param("circleId") Long circleId);
}