项目十二:分享营销所有功能
parent
05aa00791e
commit
31017f2e63
@ -0,0 +1,254 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodsShareDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author whb
|
||||
* stu_goods_share_info
|
||||
*/
|
||||
@Data
|
||||
public class StuGoodsShareInfo {
|
||||
@ApiModelProperty(notes = "ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(notes = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(notes = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(notes = "商品类型")
|
||||
private String goodsType;
|
||||
|
||||
@ApiModelProperty(notes = "商品图片")
|
||||
private String goodsImg;
|
||||
|
||||
@ApiModelProperty(notes = "分享者名称")
|
||||
private String sharerName;
|
||||
|
||||
@ApiModelProperty(notes = "分享者头像")
|
||||
private String sharerProfile;
|
||||
|
||||
@ApiModelProperty(notes = "评论时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date commentTime;
|
||||
|
||||
@ApiModelProperty(notes = "评论内容")
|
||||
private String commentContent;
|
||||
|
||||
@ApiModelProperty(notes = "评论的图片或视频(逗号隔开)")
|
||||
private String commentFile;
|
||||
|
||||
@ApiModelProperty(notes = "综合得分")
|
||||
private String comprehensiveScore;
|
||||
|
||||
@ApiModelProperty(notes = "商品链接")
|
||||
private String goodsUrl;
|
||||
|
||||
@ApiModelProperty(notes = "被浏览次数")
|
||||
private Integer browseNumber;
|
||||
|
||||
@ApiModelProperty(notes = "被评论次数")
|
||||
private Integer commentNumber;
|
||||
|
||||
@ApiModelProperty(notes = "点赞次数 (默认为0 未点赞)")
|
||||
private Integer giveTheThumbsUp;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(notes = "关注数")
|
||||
private Integer attentionNumber;
|
||||
|
||||
@ApiModelProperty(notes = "粉丝数")
|
||||
private Integer fansNumber;
|
||||
|
||||
@ApiModelProperty(notes = "评论ID")
|
||||
private Integer commentId;
|
||||
|
||||
@ApiModelProperty(notes = "评论层级(默认为0)")
|
||||
private Integer commentHierarchy;
|
||||
|
||||
@ApiModelProperty(notes = "规格与包装")
|
||||
private String specificationPackaging;
|
||||
|
||||
@ApiModelProperty(notes = "评论集")
|
||||
private List<StuGoodsShareDTO> shareDTOS;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName == null ? null : goodsName.trim();
|
||||
}
|
||||
|
||||
public String getGoodsType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
||||
public void setGoodsType(String goodsType) {
|
||||
this.goodsType = goodsType == null ? null : goodsType.trim();
|
||||
}
|
||||
|
||||
public String getGoodsImg() {
|
||||
return goodsImg;
|
||||
}
|
||||
|
||||
public void setGoodsImg(String goodsImg) {
|
||||
this.goodsImg = goodsImg == null ? null : goodsImg.trim();
|
||||
}
|
||||
|
||||
public String getSharerName() {
|
||||
return sharerName;
|
||||
}
|
||||
|
||||
public void setSharerName(String sharerName) {
|
||||
this.sharerName = sharerName == null ? null : sharerName.trim();
|
||||
}
|
||||
|
||||
public String getSharerProfile() {
|
||||
return sharerProfile;
|
||||
}
|
||||
|
||||
public void setSharerProfile(String sharerProfile) {
|
||||
this.sharerProfile = sharerProfile == null ? null : sharerProfile.trim();
|
||||
}
|
||||
|
||||
public Date getCommentTime() {
|
||||
return commentTime;
|
||||
}
|
||||
|
||||
public void setCommentTime(Date commentTime) {
|
||||
this.commentTime = commentTime;
|
||||
}
|
||||
|
||||
public String getCommentContent() {
|
||||
return commentContent;
|
||||
}
|
||||
|
||||
public void setCommentContent(String commentContent) {
|
||||
this.commentContent = commentContent == null ? null : commentContent.trim();
|
||||
}
|
||||
|
||||
public String getCommentFile() {
|
||||
return commentFile;
|
||||
}
|
||||
|
||||
public void setCommentFile(String commentFile) {
|
||||
this.commentFile = commentFile == null ? null : commentFile.trim();
|
||||
}
|
||||
|
||||
public String getComprehensiveScore() {
|
||||
return comprehensiveScore;
|
||||
}
|
||||
|
||||
public void setComprehensiveScore(String comprehensiveScore) {
|
||||
this.comprehensiveScore = comprehensiveScore == null ? null : comprehensiveScore.trim();
|
||||
}
|
||||
|
||||
public String getGoodsUrl() {
|
||||
return goodsUrl;
|
||||
}
|
||||
|
||||
public void setGoodsUrl(String goodsUrl) {
|
||||
this.goodsUrl = goodsUrl == null ? null : goodsUrl.trim();
|
||||
}
|
||||
|
||||
public Integer getBrowseNumber() {
|
||||
return browseNumber;
|
||||
}
|
||||
|
||||
public void setBrowseNumber(Integer browseNumber) {
|
||||
this.browseNumber = browseNumber;
|
||||
}
|
||||
|
||||
public Integer getCommentNumber() {
|
||||
return commentNumber;
|
||||
}
|
||||
|
||||
public void setCommentNumber(Integer commentNumber) {
|
||||
this.commentNumber = commentNumber;
|
||||
}
|
||||
|
||||
public Integer getGiveTheThumbsUp() {
|
||||
return giveTheThumbsUp;
|
||||
}
|
||||
|
||||
public void setGiveTheThumbsUp(Integer giveTheThumbsUp) {
|
||||
this.giveTheThumbsUp = giveTheThumbsUp;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public Integer getAttentionNumber() {
|
||||
return attentionNumber;
|
||||
}
|
||||
|
||||
public void setAttentionNumber(Integer attentionNumber) {
|
||||
this.attentionNumber = attentionNumber;
|
||||
}
|
||||
|
||||
public Integer getFansNumber() {
|
||||
return fansNumber;
|
||||
}
|
||||
|
||||
public void setFansNumber(Integer fansNumber) {
|
||||
this.fansNumber = fansNumber;
|
||||
}
|
||||
|
||||
public Integer getCommentId() {
|
||||
return commentId;
|
||||
}
|
||||
|
||||
public void setCommentId(Integer commentId) {
|
||||
this.commentId = commentId;
|
||||
}
|
||||
|
||||
public Integer getCommentHierarchy() {
|
||||
return commentHierarchy;
|
||||
}
|
||||
|
||||
public void setCommentHierarchy(Integer commentHierarchy) {
|
||||
this.commentHierarchy = commentHierarchy;
|
||||
}
|
||||
|
||||
public String getSpecificationPackaging() {
|
||||
return specificationPackaging;
|
||||
}
|
||||
|
||||
public void setSpecificationPackaging(String specificationPackaging) {
|
||||
this.specificationPackaging = specificationPackaging == null ? null : specificationPackaging.trim();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
package com.sztzjy.trade.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/7 11:18
|
||||
*/
|
||||
@Data
|
||||
public class StuGoodThingsDTO {
|
||||
@ApiModelProperty(notes = "订单ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(notes = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(notes = "评论内容")
|
||||
private String commentContent;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.sztzjy.trade.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/6 11:36
|
||||
*/
|
||||
//分享营销展示返回
|
||||
@Data
|
||||
public class StuGoodsShareDTO {
|
||||
|
||||
@ApiModelProperty(notes = "分享者名称")
|
||||
private String sharerName;
|
||||
|
||||
@ApiModelProperty(notes = "评论时间")
|
||||
private Date commentTime;
|
||||
|
||||
@ApiModelProperty(notes = "评论内容")
|
||||
private String commentContent;
|
||||
|
||||
@ApiModelProperty(notes = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(notes = "评论ID")
|
||||
private Integer commentId;
|
||||
|
||||
@ApiModelProperty(notes = "评论层级(默认为0)")
|
||||
private Integer commentHierarchy;
|
||||
|
||||
@ApiModelProperty(notes = "评论集")
|
||||
private List<StuGoodsShareDTO> shareDTOS;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.sztzjy.trade.mapper;
|
||||
|
||||
import com.sztzjy.trade.entity.StuGoodsShareInfo;
|
||||
import com.sztzjy.trade.entity.StuGoodsShareInfoExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface StuGoodsShareInfoMapper {
|
||||
long countByExample(StuGoodsShareInfoExample example);
|
||||
|
||||
int deleteByExample(StuGoodsShareInfoExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(StuGoodsShareInfo record);
|
||||
|
||||
int insertSelective(StuGoodsShareInfo record);
|
||||
|
||||
List<StuGoodsShareInfo> selectByExampleWithBLOBs(StuGoodsShareInfoExample example);
|
||||
|
||||
List<StuGoodsShareInfo> selectByExample(StuGoodsShareInfoExample example);
|
||||
|
||||
StuGoodsShareInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") StuGoodsShareInfo record, @Param("example") StuGoodsShareInfoExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") StuGoodsShareInfo record, @Param("example") StuGoodsShareInfoExample example);
|
||||
|
||||
int updateByExample(@Param("record") StuGoodsShareInfo record, @Param("example") StuGoodsShareInfoExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(StuGoodsShareInfo record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(StuGoodsShareInfo record);
|
||||
|
||||
int updateByPrimaryKey(StuGoodsShareInfo record);
|
||||
|
||||
List<StuGoodsShareInfo> selectCommentById(Integer id);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.sztzjy.trade.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.trade.entity.StuGoodsOrderInfo;
|
||||
import com.sztzjy.trade.entity.StuGoodsShareInfo;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodThingsDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/6 10:59
|
||||
*/
|
||||
public interface StuGoodsMarketingCenterService {
|
||||
PageInfo<StuGoodsShareInfo> getShareMarketing(Integer index, Integer size, String sortType, String goodsType,Integer type);
|
||||
|
||||
List<StuGoodsOrderInfo> getOrderInfo(String userId);
|
||||
|
||||
|
||||
Integer add(StuGoodThingsDTO stuGoodThingsDTO, List<MultipartFile> files);
|
||||
|
||||
Integer operate(Integer id, String userId, String operateType, String content);
|
||||
}
|
@ -0,0 +1,281 @@
|
||||
package com.sztzjy.trade.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sztzjy.trade.config.Constant;
|
||||
import com.sztzjy.trade.entity.*;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodThingsDTO;
|
||||
import com.sztzjy.trade.entity.dto.StuGoodsShareDTO;
|
||||
import com.sztzjy.trade.mapper.*;
|
||||
import com.sztzjy.trade.util.BigDecimalUtils;
|
||||
import com.sztzjy.trade.util.ConvertUtil;
|
||||
import com.sztzjy.trade.util.PageUtil;
|
||||
import com.sztzjy.trade.util.file.IFileUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/11/6 11:00
|
||||
*/
|
||||
@Service
|
||||
public class StuGoodsMarketingCenterServiceImpl implements StuGoodsMarketingCenterService{
|
||||
@Resource
|
||||
StuGoodsShareInfoMapper shareInfoMapper;
|
||||
@Resource
|
||||
ConvertUtil convertUtil;
|
||||
@Resource
|
||||
StuGoodsOrderInfoMapper orderInfoMapper;
|
||||
@Resource
|
||||
StuGoodsCommentInfoMapper commentInfoMapper;
|
||||
@Resource
|
||||
StuTradeAccountInfoMapper tradeAccountInfoMapper;
|
||||
@Resource
|
||||
StuGoodsInfoMapper goodsInfoMapper;
|
||||
@Resource
|
||||
IFileUtil fileUtil;
|
||||
@Resource
|
||||
BigDecimalUtils bigDecimalUtils;
|
||||
@Override
|
||||
public PageInfo getShareMarketing(Integer index, Integer size, String sortType, String goodsType,Integer type) {
|
||||
|
||||
StuGoodsShareInfoExample goodsShareInfoExample=new StuGoodsShareInfoExample();
|
||||
|
||||
if(!sortType.isEmpty()){
|
||||
if(sortType.equals(Constant.COMMENT_NUMBER)){ //按照评论数排序
|
||||
if(type==1){ //降序
|
||||
goodsShareInfoExample.setOrderByClause("desc comment_number");
|
||||
}else { //升序
|
||||
goodsShareInfoExample.setOrderByClause("asc comment_number");
|
||||
}
|
||||
}
|
||||
|
||||
if(sortType.equals(Constant.BROWSE_NUMBER)){ //按照被浏览数排序
|
||||
if(type==1){ //降序
|
||||
goodsShareInfoExample.setOrderByClause("desc browse_number");
|
||||
}else { //升序
|
||||
goodsShareInfoExample.setOrderByClause("asc browse_number");
|
||||
}
|
||||
}
|
||||
}
|
||||
StuGoodsShareInfoExample.Criteria criteria = goodsShareInfoExample.createCriteria();
|
||||
criteria.andCommentHierarchyEqualTo(0); //分享评论层级
|
||||
if(!goodsType.isEmpty()){
|
||||
criteria.andGoodsTypeEqualTo(goodsType);
|
||||
}
|
||||
List<StuGoodsShareInfo> stuGoodsShareInfos = shareInfoMapper.selectByExampleWithBLOBs(goodsShareInfoExample);
|
||||
|
||||
|
||||
|
||||
if(!stuGoodsShareInfos.isEmpty()){
|
||||
//查询出所有回复
|
||||
StuGoodsShareInfoExample replyShareInfoExample=new StuGoodsShareInfoExample();
|
||||
replyShareInfoExample.createCriteria().andCommentHierarchyNotEqualTo(0);
|
||||
List<StuGoodsShareInfo> replyShareInfos = shareInfoMapper.selectByExampleWithBLOBs(replyShareInfoExample);
|
||||
|
||||
for (StuGoodsShareInfo stuGoodsShareInfo: stuGoodsShareInfos) {
|
||||
//查询用户的关注和粉丝数更新
|
||||
StuTradeAccountInfoExample tradeAccountInfoExample=new StuTradeAccountInfoExample();
|
||||
tradeAccountInfoExample.createCriteria().andUserIdEqualTo(stuGoodsShareInfo.getUserId());
|
||||
List<StuTradeAccountInfo> stuTradeAccountInfos = tradeAccountInfoMapper.selectByExample(tradeAccountInfoExample);
|
||||
|
||||
if(stuTradeAccountInfos.isEmpty()){
|
||||
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(stuGoodsShareInfo.getUserId());
|
||||
tradeAccountInfoMapper.insert(stuTradeAccountInfo);
|
||||
stuTradeAccountInfos.add(stuTradeAccountInfo);
|
||||
}
|
||||
stuGoodsShareInfo.setAttentionNumber(stuTradeAccountInfos.get(0).getAttentionNumber());
|
||||
stuGoodsShareInfo.setFansNumber(stuTradeAccountInfos.get(0).getFansNumber());
|
||||
|
||||
List<StuGoodsShareDTO> shareDTOS=new ArrayList<>();
|
||||
|
||||
if(!replyShareInfos.isEmpty()){
|
||||
|
||||
for (StuGoodsShareInfo replyShareInfo:replyShareInfos){
|
||||
|
||||
//根据分享id 递归查询该分享下的评论
|
||||
if(Objects.equals(stuGoodsShareInfo.getId(), replyShareInfo.getCommentId())){
|
||||
shareDTOS.add(convertUtil.entityToDTO(replyShareInfo, StuGoodsShareDTO.class));
|
||||
//剔除该数据,防止重复遍历
|
||||
stuGoodsShareInfos.remove(replyShareInfo);
|
||||
shareDTOS.addAll(recursion(replyShareInfo,stuGoodsShareInfos));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
stuGoodsShareInfo.setShareDTOS(shareDTOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return PageUtil.pageHelper(stuGoodsShareInfos,index,size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StuGoodsOrderInfo> getOrderInfo(String userId) {
|
||||
StuGoodsOrderInfoExample orderInfoExample=new StuGoodsOrderInfoExample();
|
||||
orderInfoExample.createCriteria().andUserIdEqualTo(userId);
|
||||
List<StuGoodsOrderInfo> stuGoodsOrderInfos = orderInfoMapper.selectByExample(orderInfoExample);
|
||||
|
||||
//查询评分为5以上的商品评论信息
|
||||
StuGoodsCommentInfoExample commentInfoExample=new StuGoodsCommentInfoExample();
|
||||
commentInfoExample.createCriteria().andUserIdEqualTo(userId)
|
||||
.andCommentHierarchyEqualTo(0);
|
||||
List<StuGoodsCommentInfo> stuGoodsCommentInfos = commentInfoMapper.selectByExampleWithBLOBs(commentInfoExample);
|
||||
|
||||
//根据订单编号剔除不符合条件的订单信息
|
||||
for (int i = 0; i < stuGoodsOrderInfos.size(); i++) {
|
||||
for (int j = 0; j < stuGoodsCommentInfos.size(); j++) {
|
||||
if(stuGoodsOrderInfos.get(i).getOrderNumber().equals(stuGoodsCommentInfos.get(j).getOrderNumber())){
|
||||
break;
|
||||
}
|
||||
if(j==stuGoodsCommentInfos.size()-1){
|
||||
stuGoodsOrderInfos.remove(stuGoodsOrderInfos.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stuGoodsOrderInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer add(StuGoodThingsDTO stuGoodThingsDTO, List<MultipartFile> files) {
|
||||
//批量上传
|
||||
String string = insertBatch(files);
|
||||
|
||||
//查询账户信息
|
||||
StuTradeAccountInfoExample tradeAccountInfoExample=new StuTradeAccountInfoExample();
|
||||
tradeAccountInfoExample.createCriteria().andUserIdEqualTo(stuGoodThingsDTO.getUserId());
|
||||
List<StuTradeAccountInfo> stuTradeAccountInfos = tradeAccountInfoMapper.selectByExample(tradeAccountInfoExample);
|
||||
|
||||
if(stuTradeAccountInfos.isEmpty()){
|
||||
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(stuGoodThingsDTO.getUserId());
|
||||
tradeAccountInfoMapper.insert(stuTradeAccountInfo);
|
||||
stuTradeAccountInfos.add(stuTradeAccountInfo);
|
||||
}
|
||||
StuTradeAccountInfo stuTradeAccountInfo = stuTradeAccountInfos.get(0);
|
||||
|
||||
//查询商品信息
|
||||
StuGoodsInfo stuGoodsInfo = goodsInfoMapper.selectByPrimaryKey(stuGoodThingsDTO.getGoodsId());
|
||||
|
||||
//查询商品评价,计算出商品综合得分
|
||||
StuGoodsCommentInfoExample commentInfoExample=new StuGoodsCommentInfoExample();
|
||||
commentInfoExample.createCriteria().andGoodsIdEqualTo(stuGoodThingsDTO.getGoodsId()).andCommentHierarchyEqualTo(0);
|
||||
List<StuGoodsCommentInfo> stuGoodsCommentInfos = commentInfoMapper.selectByExampleWithBLOBs(commentInfoExample);
|
||||
|
||||
//得分累加
|
||||
int score=0;
|
||||
for (StuGoodsCommentInfo stuGoodsCommentInfo:stuGoodsCommentInfos) {
|
||||
score=stuGoodsCommentInfo.getGoodsRating()+score;
|
||||
}
|
||||
|
||||
//综合得分
|
||||
Double div = bigDecimalUtils.div(Double.parseDouble(String.valueOf(score)), Double.parseDouble(String.valueOf(stuGoodsCommentInfos.size())));
|
||||
|
||||
//创建对象 赋值
|
||||
StuGoodsShareInfo stuGoodsShareInfo=new StuGoodsShareInfo();
|
||||
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
||||
stuGoodsShareInfo.setId(uuid);
|
||||
stuGoodsShareInfo.setGoodsId(stuGoodThingsDTO.getGoodsId());
|
||||
stuGoodsShareInfo.setGoodsName(stuGoodsInfo.getGoodsName());
|
||||
stuGoodsShareInfo.setGoodsType(stuGoodsInfo.getGoodsType());
|
||||
stuGoodsShareInfo.setGoodsImg(stuGoodsInfo.getGoodsMainImage());
|
||||
stuGoodsShareInfo.setSpecificationPackaging(stuGoodsInfo.getSpecificationPackaging());
|
||||
stuGoodsShareInfo.setSharerName(stuTradeAccountInfo.getAccountName());
|
||||
stuGoodsShareInfo.setSharerProfile(stuTradeAccountInfo.getSharerProfile());
|
||||
stuGoodsShareInfo.setCommentTime(new Date());
|
||||
stuGoodsShareInfo.setCommentContent(stuGoodThingsDTO.getCommentContent());
|
||||
stuGoodsShareInfo.setCommentFile(string);
|
||||
stuGoodsShareInfo.setComprehensiveScore(String.valueOf(div));
|
||||
stuGoodsShareInfo.setGoodsUrl(stuGoodsInfo.getGoodsUrl());
|
||||
stuGoodsShareInfo.setBrowseNumber(0);
|
||||
stuGoodsShareInfo.setCommentNumber(0);
|
||||
stuGoodsShareInfo.setGiveTheThumbsUp(0);
|
||||
stuGoodsShareInfo.setUserId(stuGoodThingsDTO.getUserId());
|
||||
stuGoodsShareInfo.setAttentionNumber(stuTradeAccountInfo.getAttentionNumber());
|
||||
stuGoodsShareInfo.setFansNumber(stuTradeAccountInfo.getFansNumber());
|
||||
stuGoodsShareInfo.setCommentHierarchy(0);
|
||||
|
||||
return shareInfoMapper.insert(stuGoodsShareInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer operate(Integer id, String userId, String operateType, String content) {
|
||||
StuGoodsShareInfo stuGoodsShareInfo = shareInfoMapper.selectByPrimaryKey(id);
|
||||
if(operateType.equals("点赞")){
|
||||
stuGoodsShareInfo.setGiveTheThumbsUp(stuGoodsShareInfo.getGiveTheThumbsUp()+1);
|
||||
}
|
||||
if(operateType.equals("浏览")){
|
||||
stuGoodsShareInfo.setBrowseNumber(stuGoodsShareInfo.getBrowseNumber()+1);
|
||||
}
|
||||
if(operateType.equals("评论") && !content.isEmpty()){
|
||||
//查询评论用户的信息
|
||||
StuTradeAccountInfoExample tradeAccountInfoExample=new StuTradeAccountInfoExample();
|
||||
tradeAccountInfoExample.createCriteria().andUserIdEqualTo(userId);
|
||||
List<StuTradeAccountInfo> stuTradeAccountInfos = tradeAccountInfoMapper.selectByExample(tradeAccountInfoExample);
|
||||
|
||||
if(stuTradeAccountInfos.isEmpty()){
|
||||
StuTradeAccountInfo stuTradeAccountInfo=new StuTradeAccountInfo(userId);
|
||||
tradeAccountInfoMapper.insert(stuTradeAccountInfo);
|
||||
stuTradeAccountInfos.add(stuTradeAccountInfo);
|
||||
}
|
||||
StuTradeAccountInfo stuTradeAccountInfo = stuTradeAccountInfos.get(0);
|
||||
|
||||
|
||||
StuGoodsShareInfo stuGoodsShareInfo1=new StuGoodsShareInfo();
|
||||
Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();
|
||||
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
||||
stuGoodsShareInfo1.setId(uuid);
|
||||
stuGoodsShareInfo1.setSharerName(stuTradeAccountInfo.getAccountName());
|
||||
stuGoodsShareInfo1.setSharerProfile(stuTradeAccountInfo.getSharerProfile());
|
||||
stuGoodsShareInfo1.setCommentTime(new Date());
|
||||
stuGoodsShareInfo1.setCommentContent(content);
|
||||
stuGoodsShareInfo1.setCommentNumber(0);
|
||||
stuGoodsShareInfo1.setGiveTheThumbsUp(0);
|
||||
stuGoodsShareInfo1.setUserId(userId);
|
||||
stuGoodsShareInfo1.setCommentId(id);
|
||||
stuGoodsShareInfo1.setCommentHierarchy(stuGoodsShareInfo.getCommentHierarchy()+1);
|
||||
|
||||
shareInfoMapper.insert(stuGoodsShareInfo1);
|
||||
|
||||
stuGoodsShareInfo.setCommentNumber(stuGoodsShareInfo.getCommentNumber()+1);
|
||||
}
|
||||
return shareInfoMapper.updateByPrimaryKeyWithBLOBs(stuGoodsShareInfo);
|
||||
}
|
||||
|
||||
//递归查询分享下的评论
|
||||
public List<StuGoodsShareDTO> recursion(StuGoodsShareInfo replyShareInfo,List<StuGoodsShareInfo> stuGoodsShareInfos){
|
||||
List<StuGoodsShareDTO> shareDTOS=new ArrayList<>();
|
||||
for (StuGoodsShareInfo stuGoodsShareInfo: stuGoodsShareInfos){
|
||||
if(Objects.equals(replyShareInfo.getId(), stuGoodsShareInfo.getCommentId())){
|
||||
shareDTOS.add(convertUtil.entityToDTO(stuGoodsShareInfo, StuGoodsShareDTO.class));
|
||||
//剔除该数据,防止重复遍历
|
||||
stuGoodsShareInfos.remove(replyShareInfo);
|
||||
shareDTOS.addAll(recursion(stuGoodsShareInfo,stuGoodsShareInfos));
|
||||
}
|
||||
}
|
||||
return shareDTOS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 评价订单-批量上传
|
||||
* @param files
|
||||
*/
|
||||
private String insertBatch(List<MultipartFile> files) {
|
||||
StringBuilder imageUpload = new StringBuilder();
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String upload = fileUtil.upload(files.get(i));
|
||||
if(i==files.size()-1){
|
||||
imageUpload.append(upload);
|
||||
}else {
|
||||
imageUpload.append(upload).append(",");
|
||||
}
|
||||
}
|
||||
return String.valueOf(imageUpload);
|
||||
}
|
||||
}
|
@ -0,0 +1,542 @@
|
||||
<?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.sztzjy.trade.mapper.StuGoodsShareInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
|
||||
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
|
||||
<result column="goods_type" jdbcType="VARCHAR" property="goodsType" />
|
||||
<result column="goods_img" jdbcType="VARCHAR" property="goodsImg" />
|
||||
<result column="sharer_name" jdbcType="VARCHAR" property="sharerName" />
|
||||
<result column="sharer_profile" jdbcType="VARCHAR" property="sharerProfile" />
|
||||
<result column="comment_time" jdbcType="TIMESTAMP" property="commentTime" />
|
||||
<result column="comment_content" jdbcType="VARCHAR" property="commentContent" />
|
||||
<result column="comment_file" jdbcType="VARCHAR" property="commentFile" />
|
||||
<result column="comprehensive_score" jdbcType="VARCHAR" property="comprehensiveScore" />
|
||||
<result column="goods_url" jdbcType="VARCHAR" property="goodsUrl" />
|
||||
<result column="browse_number" jdbcType="INTEGER" property="browseNumber" />
|
||||
<result column="comment_number" jdbcType="INTEGER" property="commentNumber" />
|
||||
<result column="give_the_thumbs_up" jdbcType="INTEGER" property="giveTheThumbsUp" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="attention_number" jdbcType="INTEGER" property="attentionNumber" />
|
||||
<result column="fans_number" jdbcType="INTEGER" property="fansNumber" />
|
||||
<result column="comment_id" jdbcType="INTEGER" property="commentId" />
|
||||
<result column="comment_hierarchy" jdbcType="INTEGER" property="commentHierarchy" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
<result column="specification_packaging" jdbcType="LONGVARCHAR" property="specificationPackaging" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, goods_id, goods_name, goods_type, goods_img, sharer_name, sharer_profile, comment_time,
|
||||
comment_content, comment_file, comprehensive_score, goods_url, browse_number, comment_number,
|
||||
give_the_thumbs_up, user_id, attention_number, fans_number, comment_id, comment_hierarchy
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
specification_packaging
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfoExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from stu_goods_share_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfoExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_goods_share_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from stu_goods_share_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from stu_goods_share_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfoExample">
|
||||
delete from stu_goods_share_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
insert into stu_goods_share_info (id, goods_id, goods_name,
|
||||
goods_type, goods_img, sharer_name,
|
||||
sharer_profile, comment_time, comment_content,
|
||||
comment_file, comprehensive_score, goods_url,
|
||||
browse_number, comment_number, give_the_thumbs_up,
|
||||
user_id, attention_number, fans_number,
|
||||
comment_id, comment_hierarchy, specification_packaging
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{goodsName,jdbcType=VARCHAR},
|
||||
#{goodsType,jdbcType=VARCHAR}, #{goodsImg,jdbcType=VARCHAR}, #{sharerName,jdbcType=VARCHAR},
|
||||
#{sharerProfile,jdbcType=VARCHAR}, #{commentTime,jdbcType=TIMESTAMP}, #{commentContent,jdbcType=VARCHAR},
|
||||
#{commentFile,jdbcType=VARCHAR}, #{comprehensiveScore,jdbcType=VARCHAR}, #{goodsUrl,jdbcType=VARCHAR},
|
||||
#{browseNumber,jdbcType=INTEGER}, #{commentNumber,jdbcType=INTEGER}, #{giveTheThumbsUp,jdbcType=INTEGER},
|
||||
#{userId,jdbcType=VARCHAR}, #{attentionNumber,jdbcType=INTEGER}, #{fansNumber,jdbcType=INTEGER},
|
||||
#{commentId,jdbcType=INTEGER}, #{commentHierarchy,jdbcType=INTEGER}, #{specificationPackaging,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
insert into stu_goods_share_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
goods_id,
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
goods_name,
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
goods_type,
|
||||
</if>
|
||||
<if test="goodsImg != null">
|
||||
goods_img,
|
||||
</if>
|
||||
<if test="sharerName != null">
|
||||
sharer_name,
|
||||
</if>
|
||||
<if test="sharerProfile != null">
|
||||
sharer_profile,
|
||||
</if>
|
||||
<if test="commentTime != null">
|
||||
comment_time,
|
||||
</if>
|
||||
<if test="commentContent != null">
|
||||
comment_content,
|
||||
</if>
|
||||
<if test="commentFile != null">
|
||||
comment_file,
|
||||
</if>
|
||||
<if test="comprehensiveScore != null">
|
||||
comprehensive_score,
|
||||
</if>
|
||||
<if test="goodsUrl != null">
|
||||
goods_url,
|
||||
</if>
|
||||
<if test="browseNumber != null">
|
||||
browse_number,
|
||||
</if>
|
||||
<if test="commentNumber != null">
|
||||
comment_number,
|
||||
</if>
|
||||
<if test="giveTheThumbsUp != null">
|
||||
give_the_thumbs_up,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="attentionNumber != null">
|
||||
attention_number,
|
||||
</if>
|
||||
<if test="fansNumber != null">
|
||||
fans_number,
|
||||
</if>
|
||||
<if test="commentId != null">
|
||||
comment_id,
|
||||
</if>
|
||||
<if test="commentHierarchy != null">
|
||||
comment_hierarchy,
|
||||
</if>
|
||||
<if test="specificationPackaging != null">
|
||||
specification_packaging,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
#{goodsId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
#{goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
#{goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsImg != null">
|
||||
#{goodsImg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sharerName != null">
|
||||
#{sharerName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sharerProfile != null">
|
||||
#{sharerProfile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commentTime != null">
|
||||
#{commentTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="commentContent != null">
|
||||
#{commentContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commentFile != null">
|
||||
#{commentFile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="comprehensiveScore != null">
|
||||
#{comprehensiveScore,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsUrl != null">
|
||||
#{goodsUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="browseNumber != null">
|
||||
#{browseNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentNumber != null">
|
||||
#{commentNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="giveTheThumbsUp != null">
|
||||
#{giveTheThumbsUp,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attentionNumber != null">
|
||||
#{attentionNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fansNumber != null">
|
||||
#{fansNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentId != null">
|
||||
#{commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentHierarchy != null">
|
||||
#{commentHierarchy,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="specificationPackaging != null">
|
||||
#{specificationPackaging,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfoExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_goods_share_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_goods_share_info
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.goodsId != null">
|
||||
goods_id = #{record.goodsId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.goodsName != null">
|
||||
goods_name = #{record.goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsType != null">
|
||||
goods_type = #{record.goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsImg != null">
|
||||
goods_img = #{record.goodsImg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.sharerName != null">
|
||||
sharer_name = #{record.sharerName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.sharerProfile != null">
|
||||
sharer_profile = #{record.sharerProfile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.commentTime != null">
|
||||
comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.commentContent != null">
|
||||
comment_content = #{record.commentContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.commentFile != null">
|
||||
comment_file = #{record.commentFile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.comprehensiveScore != null">
|
||||
comprehensive_score = #{record.comprehensiveScore,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.goodsUrl != null">
|
||||
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.browseNumber != null">
|
||||
browse_number = #{record.browseNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.commentNumber != null">
|
||||
comment_number = #{record.commentNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.giveTheThumbsUp != null">
|
||||
give_the_thumbs_up = #{record.giveTheThumbsUp,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.attentionNumber != null">
|
||||
attention_number = #{record.attentionNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.fansNumber != null">
|
||||
fans_number = #{record.fansNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.commentId != null">
|
||||
comment_id = #{record.commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.commentHierarchy != null">
|
||||
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.specificationPackaging != null">
|
||||
specification_packaging = #{record.specificationPackaging,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update stu_goods_share_info
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
goods_id = #{record.goodsId,jdbcType=INTEGER},
|
||||
goods_name = #{record.goodsName,jdbcType=VARCHAR},
|
||||
goods_type = #{record.goodsType,jdbcType=VARCHAR},
|
||||
goods_img = #{record.goodsImg,jdbcType=VARCHAR},
|
||||
sharer_name = #{record.sharerName,jdbcType=VARCHAR},
|
||||
sharer_profile = #{record.sharerProfile,jdbcType=VARCHAR},
|
||||
comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
|
||||
comment_content = #{record.commentContent,jdbcType=VARCHAR},
|
||||
comment_file = #{record.commentFile,jdbcType=VARCHAR},
|
||||
comprehensive_score = #{record.comprehensiveScore,jdbcType=VARCHAR},
|
||||
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
|
||||
browse_number = #{record.browseNumber,jdbcType=INTEGER},
|
||||
comment_number = #{record.commentNumber,jdbcType=INTEGER},
|
||||
give_the_thumbs_up = #{record.giveTheThumbsUp,jdbcType=INTEGER},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
attention_number = #{record.attentionNumber,jdbcType=INTEGER},
|
||||
fans_number = #{record.fansNumber,jdbcType=INTEGER},
|
||||
comment_id = #{record.commentId,jdbcType=INTEGER},
|
||||
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER},
|
||||
specification_packaging = #{record.specificationPackaging,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_goods_share_info
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
goods_id = #{record.goodsId,jdbcType=INTEGER},
|
||||
goods_name = #{record.goodsName,jdbcType=VARCHAR},
|
||||
goods_type = #{record.goodsType,jdbcType=VARCHAR},
|
||||
goods_img = #{record.goodsImg,jdbcType=VARCHAR},
|
||||
sharer_name = #{record.sharerName,jdbcType=VARCHAR},
|
||||
sharer_profile = #{record.sharerProfile,jdbcType=VARCHAR},
|
||||
comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
|
||||
comment_content = #{record.commentContent,jdbcType=VARCHAR},
|
||||
comment_file = #{record.commentFile,jdbcType=VARCHAR},
|
||||
comprehensive_score = #{record.comprehensiveScore,jdbcType=VARCHAR},
|
||||
goods_url = #{record.goodsUrl,jdbcType=VARCHAR},
|
||||
browse_number = #{record.browseNumber,jdbcType=INTEGER},
|
||||
comment_number = #{record.commentNumber,jdbcType=INTEGER},
|
||||
give_the_thumbs_up = #{record.giveTheThumbsUp,jdbcType=INTEGER},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
attention_number = #{record.attentionNumber,jdbcType=INTEGER},
|
||||
fans_number = #{record.fansNumber,jdbcType=INTEGER},
|
||||
comment_id = #{record.commentId,jdbcType=INTEGER},
|
||||
comment_hierarchy = #{record.commentHierarchy,jdbcType=INTEGER}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
update stu_goods_share_info
|
||||
<set>
|
||||
<if test="goodsId != null">
|
||||
goods_id = #{goodsId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="goodsName != null">
|
||||
goods_name = #{goodsName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsType != null">
|
||||
goods_type = #{goodsType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsImg != null">
|
||||
goods_img = #{goodsImg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sharerName != null">
|
||||
sharer_name = #{sharerName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sharerProfile != null">
|
||||
sharer_profile = #{sharerProfile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commentTime != null">
|
||||
comment_time = #{commentTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="commentContent != null">
|
||||
comment_content = #{commentContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commentFile != null">
|
||||
comment_file = #{commentFile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="comprehensiveScore != null">
|
||||
comprehensive_score = #{comprehensiveScore,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="goodsUrl != null">
|
||||
goods_url = #{goodsUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="browseNumber != null">
|
||||
browse_number = #{browseNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentNumber != null">
|
||||
comment_number = #{commentNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="giveTheThumbsUp != null">
|
||||
give_the_thumbs_up = #{giveTheThumbsUp,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attentionNumber != null">
|
||||
attention_number = #{attentionNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="fansNumber != null">
|
||||
fans_number = #{fansNumber,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentId != null">
|
||||
comment_id = #{commentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="commentHierarchy != null">
|
||||
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="specificationPackaging != null">
|
||||
specification_packaging = #{specificationPackaging,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
update stu_goods_share_info
|
||||
set goods_id = #{goodsId,jdbcType=INTEGER},
|
||||
goods_name = #{goodsName,jdbcType=VARCHAR},
|
||||
goods_type = #{goodsType,jdbcType=VARCHAR},
|
||||
goods_img = #{goodsImg,jdbcType=VARCHAR},
|
||||
sharer_name = #{sharerName,jdbcType=VARCHAR},
|
||||
sharer_profile = #{sharerProfile,jdbcType=VARCHAR},
|
||||
comment_time = #{commentTime,jdbcType=TIMESTAMP},
|
||||
comment_content = #{commentContent,jdbcType=VARCHAR},
|
||||
comment_file = #{commentFile,jdbcType=VARCHAR},
|
||||
comprehensive_score = #{comprehensiveScore,jdbcType=VARCHAR},
|
||||
goods_url = #{goodsUrl,jdbcType=VARCHAR},
|
||||
browse_number = #{browseNumber,jdbcType=INTEGER},
|
||||
comment_number = #{commentNumber,jdbcType=INTEGER},
|
||||
give_the_thumbs_up = #{giveTheThumbsUp,jdbcType=INTEGER},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
attention_number = #{attentionNumber,jdbcType=INTEGER},
|
||||
fans_number = #{fansNumber,jdbcType=INTEGER},
|
||||
comment_id = #{commentId,jdbcType=INTEGER},
|
||||
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER},
|
||||
specification_packaging = #{specificationPackaging,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
update stu_goods_share_info
|
||||
set goods_id = #{goodsId,jdbcType=INTEGER},
|
||||
goods_name = #{goodsName,jdbcType=VARCHAR},
|
||||
goods_type = #{goodsType,jdbcType=VARCHAR},
|
||||
goods_img = #{goodsImg,jdbcType=VARCHAR},
|
||||
sharer_name = #{sharerName,jdbcType=VARCHAR},
|
||||
sharer_profile = #{sharerProfile,jdbcType=VARCHAR},
|
||||
comment_time = #{commentTime,jdbcType=TIMESTAMP},
|
||||
comment_content = #{commentContent,jdbcType=VARCHAR},
|
||||
comment_file = #{commentFile,jdbcType=VARCHAR},
|
||||
comprehensive_score = #{comprehensiveScore,jdbcType=VARCHAR},
|
||||
goods_url = #{goodsUrl,jdbcType=VARCHAR},
|
||||
browse_number = #{browseNumber,jdbcType=INTEGER},
|
||||
comment_number = #{commentNumber,jdbcType=INTEGER},
|
||||
give_the_thumbs_up = #{giveTheThumbsUp,jdbcType=INTEGER},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
attention_number = #{attentionNumber,jdbcType=INTEGER},
|
||||
fans_number = #{fansNumber,jdbcType=INTEGER},
|
||||
comment_id = #{commentId,jdbcType=INTEGER},
|
||||
comment_hierarchy = #{commentHierarchy,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectCommentById" resultType="com.sztzjy.trade.entity.StuGoodsShareInfo">
|
||||
SELECT sharer_name,comment_time,comment_content,user_id,comment_id,comment_hierarchy
|
||||
from stu_goods_share_info
|
||||
where comment_id=#{id} and comment_hierarchy!=0
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue