Commit 9f0542f8 authored by hezhen's avatar hezhen

添加用户留言

parent 033aaf32
...@@ -23,4 +23,17 @@ public class UserCommentFindDTO extends PageParam{ ...@@ -23,4 +23,17 @@ public class UserCommentFindDTO extends PageParam{
private Integer userId; private Integer userId;
private Integer isGoods; private Integer isGoods;
private Long startTime;
private Long endTime;
private Integer soureType;
private String name;
private Integer isShow;
private Integer isDesc;
} }
...@@ -122,4 +122,12 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{ ...@@ -122,4 +122,12 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
} }
public PageDataVO<UserCommentVo> selectListV2(UserCommentFindDTO userCommentFindDTO){
PageHelper.startPage(userCommentFindDTO.getPage(), userCommentFindDTO.getLimit());
PageInfo<UserCommentVo> pageInfo = new PageInfo<>(getList(userCommentFindDTO));
PageDataVO<UserCommentVo> dataVO = PageDataVO.pageInfo(pageInfo);
return dataVO;
}
} }
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.UserCommentBiz;
import com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO;
import com.github.wxiaoqi.security.admin.entity.UserComment;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping("backstage/comment")
@Api(tags = {"评论"})
public class AdminUserCommentController extends BaseController<UserCommentBiz,UserComment> implements UserRestInterface {
@Autowired
UserFeign userFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
@GetMapping("selectList")
@ApiModelProperty("列表")
@IgnoreUserToken
public ObjectRestResponse selectList(UserCommentFindDTO commentFindDTO) {
commentFindDTO.setIsDesc(1);
return ObjectRestResponse.succ( baseBiz.selectListV2(commentFindDTO));
}
@PostMapping("del")
@ApiModelProperty("评论删除")
public ObjectRestResponse del(@RequestBody UserComment userComment) {
baseBiz.updateSelectiveById(userComment);
return ObjectRestResponse.succ();
}
}
...@@ -7,20 +7,47 @@ ...@@ -7,20 +7,47 @@
SELECT SELECT
c.*, c.*,
IFNULL(d1.realname,d1.nickname) as userName, IFNULL(d1.realname,d1.nickname) as userName,
IFNULL(d2.realname,d2.nickname) as toUserName IFNULL(d2.realname,d2.nickname) as toUserName,
b.`name`as companyName
FROM user_comment c FROM user_comment c
LEFT JOIN app_user_detail d1 ON c.user_id=d1.userid LEFT JOIN app_user_detail d1 ON c.user_id=d1.userid
LEFT JOIN app_user_detail d2 ON c.to_user_id=d2.userid LEFT JOIN app_user_detail d2 ON c.to_user_id=d2.userid
LEFT JOIN branch_company b ON c.company_id=b.id
<where> <where>
c.soure_id=#{soureId} <if test="soureId != null ">
AND c.soure_id=#{soureId}
</if>
<if test="parentId != null "> <if test="parentId != null ">
AND c.`parent_id`= #{parentId} AND c.`parent_id`= #{parentId}
</if> </if>
<if test="rootParentId != null and rootParentId > 0 "> <if test="rootParentId != null and rootParentId > 0 ">
AND ( c.`parent_id` > 0 and c.root_parent_id = #{rootParentId} ) AND ( c.`parent_id` > 0 and c.root_parent_id = #{rootParentId} )
</if> </if>
<if test="startTime != null and startTime > 0">
AND c.`create_time`>= #{startTime}
</if>
<if test="endTime != null and endTime > 0">
AND c.`create_time` &lt;= #{endTime}
</if>
<if test="soureType != null and soureType > 0">
AND c.`soure_type`= #{soureType}
</if>
<if test="isShow != null ">
AND c.`is_show`= #{isShow}
</if>
<if test="name != null and name != '' ">
AND IFNULL(d1.realname,d1.nickname) like concat('%', #{name}, '%')
</if>
</where> </where>
order by c.create_time ASC <choose>
<when test="isDesc != null and isDesc == 1">
order by c.create_time desc
</when>
<otherwise>
order by c.create_time ASC
</otherwise>
</choose>
</select> </select>
<select id="selectListByToUserId" resultType="com.github.wxiaoqi.security.admin.vo.UserCommentVo" parameterType="com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO"> <select id="selectListByToUserId" resultType="com.github.wxiaoqi.security.admin.vo.UserCommentVo" parameterType="com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment