From a2c792ee79e69224d71dc6204c6cc01f92b9384e Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期一, 23 八月 2021 16:14:46 +0800 Subject: [PATCH] [新增]整理代码规范 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussCommentDAO.java | 60 ++++++++++++++++++++++-------------------------------------- 1 files changed, 22 insertions(+), 38 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussCommentDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussCommentDAO.java index c16b240..28f7319 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussCommentDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussCommentDAO.java @@ -1,12 +1,13 @@ package com.panzhihua.service_community.dao; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; -import com.panzhihua.service_community.model.dos.ComActDiscussCommentDO; +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; -import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; +import com.panzhihua.service_community.model.dos.ComActDiscussCommentDO; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -16,39 +17,22 @@ **/ @Mapper public interface ComActDiscussCommentDAO extends BaseMapper<ComActDiscussCommentDO> { - // @Select("<script> " + -// " <where>" + -// "<if test='nameCn != null and nameCn.trim() != ""'>" + -// " </if> " + -// "<if test='nameCn != null and nameCn.trim() != ""'>" + -// " </if> " + -// "<if test='nameCn != null and nameCn.trim() != ""'>" + -// " </if> " + -// " </where>" + -// "</script>") - @Select("" + - "SELECT\n" + - "u.`name` userName,\n" + - "u.`nick_name` userNickName,\n" + - "u.`image_url`,\n" + - "u.phone,\n" + - "c.`comment`,\n" + - "c.`parent_id`,\n" + - "c.`is_author`,\n" + - "c.`is_topping`,\n" + - "COUNT( cu.id ) num,\n" + - "c.create_at,\n" + - "c.id \n" + - "FROM\n" + - "com_act_discuss_comment c\n" + - "JOIN sys_user u ON c.user_id = u.user_id\n" + - "LEFT JOIN com_act_discuss_comment_user cu on c.id=cu.disscuss_comment_id\n" + - "WHERE\n" + - "FIND_IN_SET(\n" + - "\tc.id,\n" + - "getChildren ( #{id} )) and c.parent_id !=0 \n" + - "GROUP BY c.id\n" + - "ORDER BY\n" + - "create_at desc") + // @Select("<script> " + + // " <where>" + + // "<if test='nameCn != null and nameCn.trim() != ""'>" + + // " </if> " + + // "<if test='nameCn != null and nameCn.trim() != ""'>" + + // " </if> " + + // "<if test='nameCn != null and nameCn.trim() != ""'>" + + // " </if> " + + // " </where>" + + // "</script>") + @Select("" + "SELECT\n" + "u.`name` userName,\n" + "u.`nick_name` userNickName,\n" + "u.`image_url`,\n" + + "u.phone,\n" + "c.`comment`,\n" + "c.`parent_id`,\n" + "c.`is_author`,\n" + "c.`is_topping`,\n" + + "COUNT( cu.id ) num,\n" + "c.create_at,\n" + "c.id \n" + "FROM\n" + "com_act_discuss_comment c\n" + + "JOIN sys_user u ON c.user_id = u.user_id\n" + + "LEFT JOIN com_act_discuss_comment_user cu on c.id=cu.disscuss_comment_id\n" + "WHERE\n" + "FIND_IN_SET(\n" + + "\tc.id,\n" + "getChildren ( #{id} )) and c.parent_id !=0 \n" + "GROUP BY c.id\n" + "ORDER BY\n" + + "create_at desc") List<ComActDiscussCommentVO> selectChilds(Long id); } -- Gitblit v1.7.1