动态置顶、好友、评论

main
linhw 2024-04-24 14:26:47 +08:00
parent 717d94c212
commit 741a6fb734
21 changed files with 1731 additions and 4 deletions

View File

@ -0,0 +1,116 @@
package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.service.IAppDynamicCommentService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wyh
* @date 2024-04-24
*/
@RestController
@RequestMapping("/comment")
public class AppDynamicCommentController extends BaseController
{
@Autowired
private IAppDynamicCommentService appDynamicCommentService;
/**
*
*/
@RequiresPermissions("app:comment:list")
@GetMapping("/list")
public TableDataInfo list(AppDynamicComment appDynamicComment)
{
startPage();
List<AppDynamicComment> list = appDynamicCommentService.selectAppDynamicCommentList(appDynamicComment);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("app:comment:export")
@Log(title = "动态评论", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppDynamicComment appDynamicComment)
{
List<AppDynamicComment> list = appDynamicCommentService.selectAppDynamicCommentList(appDynamicComment);
ExcelUtil<AppDynamicComment> util = new ExcelUtil<AppDynamicComment>(AppDynamicComment.class);
util.exportExcel(response, list, "动态评论数据");
}
/**
*
*/
@RequiresPermissions("app:comment:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appDynamicCommentService.selectAppDynamicCommentById(id));
}
/**
*
*/
@RequiresPermissions("app:comment:add")
@Log(title = "动态评论", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppDynamicComment appDynamicComment)
{
return toAjax(appDynamicCommentService.insertAppDynamicComment(appDynamicComment));
}
/**
*
*/
@RequiresPermissions("app:comment:edit")
@Log(title = "动态评论", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppDynamicComment appDynamicComment)
{
return toAjax(appDynamicCommentService.updateAppDynamicComment(appDynamicComment));
}
/**
*
*/
@RequiresPermissions("app:comment:remove")
@Log(title = "动态评论", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appDynamicCommentService.deleteAppDynamicCommentByIds(ids));
}
@RequiresPermissions("app:comment:list")
@GetMapping("/treeList")
public TableDataInfo treeList(AppDynamicComment appDynamicComment)
{
startPage();
List<AppDynamicCommentVo> list = appDynamicCommentService.treeList(appDynamicComment);
return getDataTable(list);
}
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.app.domain.AppDynamicLike;
import com.ruoyi.app.service.IAppDynamicLikeService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wyh
* @date 2024-04-24
*/
@RestController
@RequestMapping("/like")
public class AppDynamicLikeController extends BaseController
{
@Autowired
private IAppDynamicLikeService appDynamicLikeService;
/**
*
*/
@RequiresPermissions("app:like:list")
@GetMapping("/list")
public TableDataInfo list(AppDynamicLike appDynamicLike)
{
startPage();
List<AppDynamicLike> list = appDynamicLikeService.selectAppDynamicLikeList(appDynamicLike);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("app:like:export")
@Log(title = "动态点赞", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppDynamicLike appDynamicLike)
{
List<AppDynamicLike> list = appDynamicLikeService.selectAppDynamicLikeList(appDynamicLike);
ExcelUtil<AppDynamicLike> util = new ExcelUtil<AppDynamicLike>(AppDynamicLike.class);
util.exportExcel(response, list, "动态点赞数据");
}
/**
*
*/
@RequiresPermissions("app:like:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appDynamicLikeService.selectAppDynamicLikeById(id));
}
/**
*
*/
@RequiresPermissions("app:like:add")
@Log(title = "动态点赞", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppDynamicLike appDynamicLike)
{
return toAjax(appDynamicLikeService.insertAppDynamicLike(appDynamicLike));
}
/**
*
*/
@RequiresPermissions("app:like:edit")
@Log(title = "动态点赞", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppDynamicLike appDynamicLike)
{
return toAjax(appDynamicLikeService.updateAppDynamicLike(appDynamicLike));
}
/**
*
*/
@RequiresPermissions("app:like:remove")
@Log(title = "动态点赞", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appDynamicLikeService.deleteAppDynamicLikeByIds(ids));
}
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.app.domain.AppUserFriend;
import com.ruoyi.app.service.IAppUserFriendService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wyh
* @date 2024-04-24
*/
@RestController
@RequestMapping("/friend")
public class AppUserFriendController extends BaseController
{
@Autowired
private IAppUserFriendService appUserFriendService;
/**
*
*/
@RequiresPermissions("app:friend:list")
@GetMapping("/list")
public TableDataInfo list(AppUserFriend appUserFriend)
{
startPage();
List<AppUserFriend> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("app:friend:export")
@Log(title = "用户好友", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppUserFriend appUserFriend)
{
List<AppUserFriend> list = appUserFriendService.selectAppUserFriendList(appUserFriend);
ExcelUtil<AppUserFriend> util = new ExcelUtil<AppUserFriend>(AppUserFriend.class);
util.exportExcel(response, list, "用户好友数据");
}
/**
*
*/
@RequiresPermissions("app:friend:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appUserFriendService.selectAppUserFriendById(id));
}
/**
*
*/
@RequiresPermissions("app:friend:add")
@Log(title = "用户好友", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppUserFriend appUserFriend)
{
return toAjax(appUserFriendService.insertAppUserFriend(appUserFriend));
}
/**
*
*/
@RequiresPermissions("app:friend:edit")
@Log(title = "用户好友", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppUserFriend appUserFriend)
{
return toAjax(appUserFriendService.updateAppUserFriend(appUserFriend));
}
/**
*
*/
@RequiresPermissions("app:friend:remove")
@Log(title = "用户好友", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appUserFriendService.deleteAppUserFriendByIds(ids));
}
}

View File

@ -0,0 +1,120 @@
package com.ruoyi.app.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import java.util.ArrayList;
import java.util.List;
/**
* app_dynamic_comment
*
* @author wyh
* @date 2024-04-24
*/
public class AppDynamicComment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 父id */
@Excel(name = "父id")
private Long parentId;
/** 父ids */
@Excel(name = "父ids")
private String parentIds;
/** 评论用户id */
@Excel(name = "评论用户id")
private Long userId;
/** 动态id */
@Excel(name = "动态id")
private Long dynamicId;
/** 内容 */
@Excel(name = "内容")
private String content;
@Excel(name = "用户名")
private String username;
private List<AppDynamicComment> children = new ArrayList<>();
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setParentIds(String parentIds)
{
this.parentIds = parentIds;
}
public String getParentIds()
{
return parentIds;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setDynamicId(Long dynamicId)
{
this.dynamicId = dynamicId;
}
public Long getDynamicId()
{
return dynamicId;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("parentIds", getParentIds())
.append("userId", getUserId())
.append("dynamicId", getDynamicId())
.append("content", getContent())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,84 @@
package com.ruoyi.app.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* app_dynamic_like
*
* @author wyh
* @date 2024-04-24
*/
public class AppDynamicLike extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 点赞用户id */
@Excel(name = "点赞用户id")
private Long userId;
/** 动态id */
@Excel(name = "动态id")
private Long dynamicId;
/** 状态0好友1拉黑 */
@Excel(name = "状态0好友1拉黑")
private Long status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setDynamicId(Long dynamicId)
{
this.dynamicId = dynamicId;
}
public Long getDynamicId()
{
return dynamicId;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("dynamicId", getDynamicId())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -45,6 +45,20 @@ public class AppUserDynamic extends BaseEntity
@Excel(name = "文件地址,多个地址用逗号隔开") @Excel(name = "文件地址,多个地址用逗号隔开")
private String imgUrls; private String imgUrls;
/** 是否置顶0是1否 */
@Excel(name = "是否置顶0是1否")
private Long isTop;
public void setIsTop(Long isTop)
{
this.isTop = isTop;
}
public Long getIsTop()
{
return isTop;
}
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -133,6 +147,7 @@ public class AppUserDynamic extends BaseEntity
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("imgUrls", getImgUrls()) .append("imgUrls", getImgUrls())
.toString(); .append("isTop", getIsTop())
.toString();
} }
} }

View File

@ -0,0 +1,84 @@
package com.ruoyi.app.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* app_user_friend
*
* @author wyh
* @date 2024-04-24
*/
public class AppUserFriend extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 我的id */
@Excel(name = "我的id")
private Long userId;
/** 好友id */
@Excel(name = "好友id")
private Long friendId;
/** 状态0好友1拉黑 */
@Excel(name = "状态0好友1拉黑")
private Long status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setFriendId(Long friendId)
{
this.friendId = friendId;
}
public Long getFriendId()
{
return friendId;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("friendId", getFriendId())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,73 @@
package com.ruoyi.app.domain.vo;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.List;
/**
* app_dynamic_comment
*
* @author wyh
* @date 2024-04-24
*/
public class AppDynamicCommentVo extends AppDynamicComment
{
private static final long serialVersionUID = 1L;
@Excel(name = "用户名")
private String username;
@Excel(name = "用户头像")
private String avatarUrl;
private List<AppDynamicCommentVo> children = new ArrayList<>();
public void setChildren(List<AppDynamicCommentVo> children) {
this.children = children;
}
public List<AppDynamicCommentVo> getChildren() {
return children;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl;
}
public String getAvatarUrl() {
return avatarUrl;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("parentIds", getParentIds())
.append("userId", getUserId())
.append("dynamicId", getDynamicId())
.append("content", getContent())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.append("children", getChildren())
.append("username", getUsername())
.append("avatarUrl", getAvatarUrl())
.toString();
}
}

View File

@ -0,0 +1,66 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
/**
* Mapper
*
* @author wyh
* @date 2024-04-24
*/
public interface AppDynamicCommentMapper
{
/**
*
*
* @param id
* @return
*/
public AppDynamicComment selectAppDynamicCommentById(Long id);
/**
*
*
* @param appDynamicComment
* @return
*/
public List<AppDynamicComment> selectAppDynamicCommentList(AppDynamicComment appDynamicComment);
/**
*
*
* @param appDynamicComment
* @return
*/
public int insertAppDynamicComment(AppDynamicComment appDynamicComment);
/**
*
*
* @param appDynamicComment
* @return
*/
public int updateAppDynamicComment(AppDynamicComment appDynamicComment);
/**
*
*
* @param id
* @return
*/
public int deleteAppDynamicCommentById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAppDynamicCommentByIds(Long[] ids);
public int deleteAppDynamicCommentByParentId(Long parentId);
public List<AppDynamicCommentVo> selectCommentList(AppDynamicComment appDynamicComment);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppDynamicLike;
/**
* Mapper
*
* @author wyh
* @date 2024-04-24
*/
public interface AppDynamicLikeMapper
{
/**
*
*
* @param id
* @return
*/
public AppDynamicLike selectAppDynamicLikeById(Long id);
/**
*
*
* @param appDynamicLike
* @return
*/
public List<AppDynamicLike> selectAppDynamicLikeList(AppDynamicLike appDynamicLike);
/**
*
*
* @param appDynamicLike
* @return
*/
public int insertAppDynamicLike(AppDynamicLike appDynamicLike);
/**
*
*
* @param appDynamicLike
* @return
*/
public int updateAppDynamicLike(AppDynamicLike appDynamicLike);
/**
*
*
* @param id
* @return
*/
public int deleteAppDynamicLikeById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAppDynamicLikeByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppUserFriend;
/**
* Mapper
*
* @author wyh
* @date 2024-04-24
*/
public interface AppUserFriendMapper
{
/**
*
*
* @param id
* @return
*/
public AppUserFriend selectAppUserFriendById(Long id);
/**
*
*
* @param appUserFriend
* @return
*/
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend);
/**
*
*
* @param appUserFriend
* @return
*/
public int insertAppUserFriend(AppUserFriend appUserFriend);
/**
*
*
* @param appUserFriend
* @return
*/
public int updateAppUserFriend(AppUserFriend appUserFriend);
/**
*
*
* @param id
* @return
*/
public int deleteAppUserFriendById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAppUserFriendByIds(Long[] ids);
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
public interface IAppDynamicCommentService
{
/**
*
*
* @param id
* @return
*/
public AppDynamicComment selectAppDynamicCommentById(Long id);
/**
*
*
* @param appDynamicComment
* @return
*/
public List<AppDynamicComment> selectAppDynamicCommentList(AppDynamicComment appDynamicComment);
/**
*
*
* @param appDynamicComment
* @return
*/
public int insertAppDynamicComment(AppDynamicComment appDynamicComment);
/**
*
*
* @param appDynamicComment
* @return
*/
public int updateAppDynamicComment(AppDynamicComment appDynamicComment);
/**
*
*
* @param ids
* @return
*/
public int deleteAppDynamicCommentByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAppDynamicCommentById(Long id);
public List<AppDynamicCommentVo> treeList(AppDynamicComment appDynamicComment);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppDynamicLike;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
public interface IAppDynamicLikeService
{
/**
*
*
* @param id
* @return
*/
public AppDynamicLike selectAppDynamicLikeById(Long id);
/**
*
*
* @param appDynamicLike
* @return
*/
public List<AppDynamicLike> selectAppDynamicLikeList(AppDynamicLike appDynamicLike);
/**
*
*
* @param appDynamicLike
* @return
*/
public int insertAppDynamicLike(AppDynamicLike appDynamicLike);
/**
*
*
* @param appDynamicLike
* @return
*/
public int updateAppDynamicLike(AppDynamicLike appDynamicLike);
/**
*
*
* @param ids
* @return
*/
public int deleteAppDynamicLikeByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAppDynamicLikeById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppUserFriend;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
public interface IAppUserFriendService
{
/**
*
*
* @param id
* @return
*/
public AppUserFriend selectAppUserFriendById(Long id);
/**
*
*
* @param appUserFriend
* @return
*/
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend);
/**
*
*
* @param appUserFriend
* @return
*/
public int insertAppUserFriend(AppUserFriend appUserFriend);
/**
*
*
* @param appUserFriend
* @return
*/
public int updateAppUserFriend(AppUserFriend appUserFriend);
/**
*
*
* @param ids
* @return
*/
public int deleteAppUserFriendByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAppUserFriendById(Long id);
}

View File

@ -0,0 +1,162 @@
package com.ruoyi.app.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.app.domain.AppUser;
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
import com.ruoyi.app.mapper.AppUserMapper;
import com.ruoyi.common.core.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppDynamicCommentMapper;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.service.IAppDynamicCommentService;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
@Service
public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService
{
@Autowired
private AppDynamicCommentMapper appDynamicCommentMapper;
/**
*
*
* @param id
* @return
*/
@Override
public AppDynamicComment selectAppDynamicCommentById(Long id)
{
return appDynamicCommentMapper.selectAppDynamicCommentById(id);
}
/**
*
*
* @param appDynamicComment
* @return
*/
@Override
public List<AppDynamicComment> selectAppDynamicCommentList(AppDynamicComment appDynamicComment)
{
return appDynamicCommentMapper.selectAppDynamicCommentList(appDynamicComment);
}
/**
*
*
* @param appDynamicComment
* @return
*/
@Override
public int insertAppDynamicComment(AppDynamicComment appDynamicComment)
{
if (appDynamicComment.getParentId() > 0) {
AppDynamicComment entity = appDynamicCommentMapper.selectAppDynamicCommentById(appDynamicComment.getId());
appDynamicComment.setParentIds(entity.getParentIds() + "," + appDynamicComment.getParentId());
}
appDynamicComment.setCreateTime(DateUtils.getNowDate());
return appDynamicCommentMapper.insertAppDynamicComment(appDynamicComment);
}
/**
*
*
* @param appDynamicComment
* @return
*/
@Override
public int updateAppDynamicComment(AppDynamicComment appDynamicComment)
{
appDynamicComment.setUpdateTime(DateUtils.getNowDate());
return appDynamicCommentMapper.updateAppDynamicComment(appDynamicComment);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAppDynamicCommentByIds(Long[] ids)
{
for (Long id : ids) {
appDynamicCommentMapper.deleteAppDynamicCommentByParentId(id);
}
return appDynamicCommentMapper.deleteAppDynamicCommentByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAppDynamicCommentById(Long id)
{
appDynamicCommentMapper.deleteAppDynamicCommentByParentId(id);
return appDynamicCommentMapper.deleteAppDynamicCommentById(id);
}
@Override
public List<AppDynamicCommentVo> treeList(AppDynamicComment appDynamicComment) {
if (appDynamicComment.getDynamicId() == null) {
return new ArrayList<>();
}
List<AppDynamicCommentVo> appDynamicComments = appDynamicCommentMapper.selectCommentList(appDynamicComment);
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
return buildList(parentList,srcList);
}
public List<AppDynamicCommentVo> buildList(List<AppDynamicCommentVo> parentList,List<AppDynamicCommentVo> srcList){
for (AppDynamicCommentVo appDynamicCommentVo : parentList) {
buildTreeAppDynamicCommentVo(appDynamicCommentVo,srcList);
}
return parentList;
}
public static AppDynamicCommentVo buildTreeAppDynamicCommentVo(AppDynamicCommentVo AppDynamicCommentVo, List<AppDynamicCommentVo> srcList) {
//父节点
List<AppDynamicCommentVo> children = getChildrenAppDynamicCommentVoById(AppDynamicCommentVo.getId(), srcList);
AppDynamicCommentVo.setChildren(children);
if (children !=null && children.size() > 0) {
List<AppDynamicCommentVo> children2 = new ArrayList<AppDynamicCommentVo>();
for (AppDynamicCommentVo temp : children) {
//递归
AppDynamicCommentVo child = buildTreeAppDynamicCommentVo(temp, srcList);
children2.add(child);
}
AppDynamicCommentVo.setChildren(children2);
}
return AppDynamicCommentVo;
}
/**
* id
*
* @param parentId
* @param AppDynamicCommentVos
* @return
*/
public static List<AppDynamicCommentVo> getChildrenAppDynamicCommentVoById(Long parentId, List<AppDynamicCommentVo> AppDynamicCommentVos) {
List<AppDynamicCommentVo> children = new ArrayList<AppDynamicCommentVo>();
for (AppDynamicCommentVo node : AppDynamicCommentVos) {
if (node.getParentId() == parentId) {
//装载parentId对应的子节点
children.add(node);
}
}
return children;
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.app.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppDynamicLikeMapper;
import com.ruoyi.app.domain.AppDynamicLike;
import com.ruoyi.app.service.IAppDynamicLikeService;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
@Service
public class AppDynamicLikeServiceImpl implements IAppDynamicLikeService
{
@Autowired
private AppDynamicLikeMapper appDynamicLikeMapper;
/**
*
*
* @param id
* @return
*/
@Override
public AppDynamicLike selectAppDynamicLikeById(Long id)
{
return appDynamicLikeMapper.selectAppDynamicLikeById(id);
}
/**
*
*
* @param appDynamicLike
* @return
*/
@Override
public List<AppDynamicLike> selectAppDynamicLikeList(AppDynamicLike appDynamicLike)
{
return appDynamicLikeMapper.selectAppDynamicLikeList(appDynamicLike);
}
/**
*
*
* @param appDynamicLike
* @return
*/
@Override
public int insertAppDynamicLike(AppDynamicLike appDynamicLike)
{
appDynamicLike.setCreateTime(DateUtils.getNowDate());
return appDynamicLikeMapper.insertAppDynamicLike(appDynamicLike);
}
/**
*
*
* @param appDynamicLike
* @return
*/
@Override
public int updateAppDynamicLike(AppDynamicLike appDynamicLike)
{
appDynamicLike.setUpdateTime(DateUtils.getNowDate());
return appDynamicLikeMapper.updateAppDynamicLike(appDynamicLike);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAppDynamicLikeByIds(Long[] ids)
{
return appDynamicLikeMapper.deleteAppDynamicLikeByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAppDynamicLikeById(Long id)
{
return appDynamicLikeMapper.deleteAppDynamicLikeById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.app.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppUserFriendMapper;
import com.ruoyi.app.domain.AppUserFriend;
import com.ruoyi.app.service.IAppUserFriendService;
/**
* Service
*
* @author wyh
* @date 2024-04-24
*/
@Service
public class AppUserFriendServiceImpl implements IAppUserFriendService
{
@Autowired
private AppUserFriendMapper appUserFriendMapper;
/**
*
*
* @param id
* @return
*/
@Override
public AppUserFriend selectAppUserFriendById(Long id)
{
return appUserFriendMapper.selectAppUserFriendById(id);
}
/**
*
*
* @param appUserFriend
* @return
*/
@Override
public List<AppUserFriend> selectAppUserFriendList(AppUserFriend appUserFriend)
{
return appUserFriendMapper.selectAppUserFriendList(appUserFriend);
}
/**
*
*
* @param appUserFriend
* @return
*/
@Override
public int insertAppUserFriend(AppUserFriend appUserFriend)
{
appUserFriend.setCreateTime(DateUtils.getNowDate());
return appUserFriendMapper.insertAppUserFriend(appUserFriend);
}
/**
*
*
* @param appUserFriend
* @return
*/
@Override
public int updateAppUserFriend(AppUserFriend appUserFriend)
{
appUserFriend.setUpdateTime(DateUtils.getNowDate());
return appUserFriendMapper.updateAppUserFriend(appUserFriend);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAppUserFriendByIds(Long[] ids)
{
return appUserFriendMapper.deleteAppUserFriendByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAppUserFriendById(Long id)
{
return appUserFriendMapper.deleteAppUserFriendById(id);
}
}

View File

@ -0,0 +1,117 @@
<?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.ruoyi.app.mapper.AppDynamicCommentMapper">
<resultMap type="AppDynamicComment" id="AppDynamicCommentResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="parentIds" column="parent_ids" />
<result property="userId" column="user_id" />
<result property="dynamicId" column="dynamic_id" />
<result property="content" column="content" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppDynamicCommentVo">
select id, parent_id, parent_ids, user_id, dynamic_id, content, create_time, update_time, create_by, updateBy, remark from app_dynamic_comment
</sql>
<select id="selectCommentList" parameterType="AppDynamicComment" resultType="com.ruoyi.app.domain.vo.AppDynamicCommentVo">
select
a.id as "id",
a.parent_id as "parentId",
a.parent_ids as "parentIds",
a.user_id as "userId",
a.dynamic_id as "dynamicId",
a.content as "content",
a.create_time as "createTime",
u.username as "username",
u.avatar_url as "avatarUrl"
from app_dynamic_comment a
LEFT JOIN app_user u on u.id = a.user_id
where a.dynamic_id = #{dynamicId}
</select>
<select id="selectAppDynamicCommentList" parameterType="AppDynamicComment" resultMap="AppDynamicCommentResult">
<include refid="selectAppDynamicCommentVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="parentIds != null "> and parent_ids = #{parentIds}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="dynamicId != null "> and dynamic_id = #{dynamicId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
</where>
</select>
<select id="selectAppDynamicCommentById" parameterType="Long" resultMap="AppDynamicCommentResult">
<include refid="selectAppDynamicCommentVo"/>
where id = #{id}
</select>
<insert id="insertAppDynamicComment" parameterType="AppDynamicComment" useGeneratedKeys="true" keyProperty="id">
insert into app_dynamic_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="parentIds != null">parent_ids,</if>
<if test="userId != null">user_id,</if>
<if test="dynamicId != null">dynamic_id,</if>
<if test="content != null">content,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="parentIds != null">#{parentIds},</if>
<if test="userId != null">#{userId},</if>
<if test="dynamicId != null">#{dynamicId},</if>
<if test="content != null">#{content},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppDynamicComment" parameterType="AppDynamicComment">
update app_dynamic_comment
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="parentIds != null">parent_ids = #{parentIds},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="dynamicId != null">dynamic_id = #{dynamicId},</if>
<if test="content != null">content = #{content},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppDynamicCommentById" parameterType="Long">
delete from app_dynamic_comment where id = #{id}
</delete>
<delete id="deleteAppDynamicCommentByParentId" parameterType="Long">
delete from app_dynamic_comment where parent_ids LIKE CONCAT('%',#{parentId},'%'))
</delete>
<delete id="deleteAppDynamicCommentByIds" parameterType="String">
delete from app_dynamic_comment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,87 @@
<?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.ruoyi.app.mapper.AppDynamicLikeMapper">
<resultMap type="AppDynamicLike" id="AppDynamicLikeResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="dynamicId" column="dynamic_id" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppDynamicLikeVo">
select id, user_id, dynamic_id, status, create_time, update_time, create_by, updateBy, remark from app_dynamic_like
</sql>
<select id="selectAppDynamicLikeList" parameterType="AppDynamicLike" resultMap="AppDynamicLikeResult">
<include refid="selectAppDynamicLikeVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="dynamicId != null "> and dynamic_id = #{dynamicId}</if>
<if test="status != null "> and status = #{status}</if>
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
</where>
</select>
<select id="selectAppDynamicLikeById" parameterType="Long" resultMap="AppDynamicLikeResult">
<include refid="selectAppDynamicLikeVo"/>
where id = #{id}
</select>
<insert id="insertAppDynamicLike" parameterType="AppDynamicLike" useGeneratedKeys="true" keyProperty="id">
insert into app_dynamic_like
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="dynamicId != null">dynamic_id,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="dynamicId != null">#{dynamicId},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppDynamicLike" parameterType="AppDynamicLike">
update app_dynamic_like
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="dynamicId != null">dynamic_id = #{dynamicId},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppDynamicLikeById" parameterType="Long">
delete from app_dynamic_like where id = #{id}
</delete>
<delete id="deleteAppDynamicLikeByIds" parameterType="String">
delete from app_dynamic_like where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" /> <result property="updateBy" column="updateBy" />
<result property="isTop" column="is_top" />
</resultMap> </resultMap>
<sql id="selectAppUserDynamicVo"> <sql id="selectAppUserDynamicVo">
select id, user_id, content, video_url, topic_id, address, privacy_status, remark, create_time, update_time, create_by, updateBy from app_user_dynamic select id, user_id, content, video_url, topic_id, address, privacy_status, remark, create_time, update_time, create_by, updateBy,is_top from app_user_dynamic
</sql> </sql>
<select id="selectAppUserDynamicList" parameterType="AppUserDynamic" resultMap="AppUserDynamicResult"> <select id="selectAppUserDynamicList" parameterType="AppUserDynamic" resultMap="AppUserDynamicResult">
@ -33,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="privacyStatus != null "> and privacy_status = #{privacyStatus}</if> <if test="privacyStatus != null "> and privacy_status = #{privacyStatus}</if>
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if> <if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
<if test="isTop != null "> and is_top = #{isTop}</if>
</where> </where>
</select> </select>
@ -55,7 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if> <if test="updateBy != null">updateBy,</if>
</trim> <if test="isTop != null">is_top,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
<if test="content != null">#{content},</if> <if test="content != null">#{content},</if>
@ -68,7 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
</trim> <if test="isTop != null">#{isTop},</if>
</trim>
</insert> </insert>
<update id="updateAppUserDynamic" parameterType="AppUserDynamic"> <update id="updateAppUserDynamic" parameterType="AppUserDynamic">
@ -85,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if> <if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="isTop != null">is_top = #{isTop},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -0,0 +1,87 @@
<?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.ruoyi.app.mapper.AppUserFriendMapper">
<resultMap type="AppUserFriend" id="AppUserFriendResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="friendId" column="friend_id" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppUserFriendVo">
select id, user_id, friend_id, status, create_time, update_time, create_by, updateBy, remark from app_user_friend
</sql>
<select id="selectAppUserFriendList" parameterType="AppUserFriend" resultMap="AppUserFriendResult">
<include refid="selectAppUserFriendVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="friendId != null "> and friend_id = #{friendId}</if>
<if test="status != null "> and status = #{status}</if>
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
</where>
</select>
<select id="selectAppUserFriendById" parameterType="Long" resultMap="AppUserFriendResult">
<include refid="selectAppUserFriendVo"/>
where id = #{id}
</select>
<insert id="insertAppUserFriend" parameterType="AppUserFriend" useGeneratedKeys="true" keyProperty="id">
insert into app_user_friend
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="friendId != null">friend_id,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="friendId != null">#{friendId},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppUserFriend" parameterType="AppUserFriend">
update app_user_friend
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="friendId != null">friend_id = #{friendId},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppUserFriendById" parameterType="Long">
delete from app_user_friend where id = #{id}
</delete>
<delete id="deleteAppUserFriendByIds" parameterType="String">
delete from app_user_friend where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>