1
This commit is contained in:
parent
36be32db88
commit
21ca4ce9bc
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiEvaluate;
|
||||
import com.ruoyi.busi.vo.BusiEvaluateVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -18,4 +19,14 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface BusiEvaluateMapper extends BaseMapper<BusiEvaluate>
|
||||
{
|
||||
IPage<BusiEvaluate> queryListPage(@Param("entity") BusiEvaluate entity, Page<BusiEvaluate> page);
|
||||
|
||||
/**
|
||||
* 通过用户id查询被评价情况
|
||||
* @author PQZ
|
||||
* @date 15:22 2025/3/21
|
||||
* @param userId 用户id
|
||||
* @return java.util.List<com.ruoyi.busi.domain.BusiEvaluate>
|
||||
**/
|
||||
List<BusiEvaluateVO> listByToUserId(@Param("userId") Long userId);
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.busi.domain.BusiEvaluate;
|
||||
import com.ruoyi.busi.vo.BusiEvaluateVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评价Service接口
|
||||
@ -24,5 +25,5 @@ public interface IBusiEvaluateService extends IService<BusiEvaluate> {
|
||||
* @author PQZ
|
||||
* @date 14:16 2025/3/21
|
||||
**/
|
||||
List<BusiEvaluate> listByToUserId(Long userId);
|
||||
List<BusiEvaluateVO> listByToUserId(Long userId);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.busi.domain.BusiEvaluate;
|
||||
import com.ruoyi.busi.mapper.BusiEvaluateMapper;
|
||||
import com.ruoyi.busi.service.IBusiEvaluateService;
|
||||
import com.ruoyi.busi.vo.BusiEvaluateVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -38,9 +39,7 @@ public class BusiEvaluateServiceImpl extends ServiceImpl<BusiEvaluateMapper,Busi
|
||||
* @date 14:16 2025/3/21
|
||||
**/
|
||||
@Override
|
||||
public List<BusiEvaluate> listByToUserId(Long userId) {
|
||||
LambdaUpdateWrapper<BusiEvaluate> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(BusiEvaluate::getToUserId,userId);
|
||||
return list(lambdaUpdateWrapper);
|
||||
public List<BusiEvaluateVO> listByToUserId(Long userId) {
|
||||
return busiEvaluateMapper.listByToUserId(userId);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusiEvaluateVO {
|
||||
/**评价内容**/
|
||||
private String evaluate;
|
||||
/**内容数量*/
|
||||
private int num;
|
||||
|
||||
}
|
@ -48,10 +48,12 @@ public class MemberCard extends DlBaseEntity
|
||||
|
||||
/** 生效日期(含) */
|
||||
@Excel(name = "生效日期", readConverterExp = "含=")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/** 失效日期(含) */
|
||||
@Excel(name = "失效日期", readConverterExp = "含=")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/** 关联订单id */
|
||||
|
@ -21,6 +21,6 @@ public interface IMemberCardService extends IService<MemberCard> {
|
||||
* @author PQZ
|
||||
* @date 14:24 2025/3/21
|
||||
**/
|
||||
List<MemberCard> listByUserId(Long userId);
|
||||
List<MemberCard> listByUserId(Long userId,String userType);
|
||||
|
||||
}
|
||||
|
@ -33,12 +33,13 @@ public class MemberCardServiceImpl extends ServiceImpl<MemberCardMapper,MemberCa
|
||||
* @date 14:24 2025/3/21
|
||||
**/
|
||||
@Override
|
||||
public List<MemberCard> listByUserId(Long userId) {
|
||||
public List<MemberCard> listByUserId(Long userId,String userType) {
|
||||
//查询列表
|
||||
LambdaUpdateWrapper<MemberCard> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper
|
||||
.eq(DlBaseEntity::getDelFlag,0)
|
||||
.eq(MemberCard::getUserId,userId)
|
||||
.eq(MemberCard::getUserType,userType)
|
||||
.orderByDesc(DlBaseEntity::getCreateTime);
|
||||
return list(lambdaUpdateWrapper);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper,MemberUs
|
||||
//评价信息
|
||||
result.setEvaluates(evaluateService.listByToUserId(userId));
|
||||
//会员开通记录
|
||||
result.setCards(cardService.listByUserId(userId));
|
||||
result.setCards(cardService.listByUserId(userId,"01"));
|
||||
//会员发布通告
|
||||
result.setNotices(noticeService.listByUserId(userId));
|
||||
return result;
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.member.vo;
|
||||
|
||||
import com.ruoyi.busi.domain.BusiEvaluate;
|
||||
import com.ruoyi.busi.domain.BusiNotice;
|
||||
import com.ruoyi.busi.vo.BusiEvaluateVO;
|
||||
import com.ruoyi.member.domain.MemberCard;
|
||||
import com.ruoyi.member.domain.MemberUser;
|
||||
import lombok.Data;
|
||||
@ -21,7 +22,7 @@ public class MemberUserVO extends MemberUser {
|
||||
/**头像地址*/
|
||||
String avatar;
|
||||
/**评价信息*/
|
||||
List<BusiEvaluate> evaluates;
|
||||
List<BusiEvaluateVO> evaluates;
|
||||
/**开卡记录*/
|
||||
List<MemberCard> cards;
|
||||
/**通告列表*/
|
||||
|
@ -1,36 +1,61 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.busi.mapper.BusiEvaluateMapper">
|
||||
|
||||
|
||||
<resultMap type="BusiEvaluate" id="BusiEvaluateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userType" column="user_type" />
|
||||
<result property="nickname" column="nickname" />
|
||||
<result property="toUserId" column="to_user_id" />
|
||||
<result property="toUserType" column="to_user_type" />
|
||||
<result property="evaluateCode" column="evaluate_code" />
|
||||
<result property="evaluate" column="evaluate" />
|
||||
<result property="creator" column="creator" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updater" column="updater" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userType" column="user_type"/>
|
||||
<result property="nickname" column="nickname"/>
|
||||
<result property="toUserId" column="to_user_id"/>
|
||||
<result property="toUserType" column="to_user_type"/>
|
||||
<result property="evaluateCode" column="evaluate_code"/>
|
||||
<result property="evaluate" column="evaluate"/>
|
||||
<result property="creator" column="creator"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updater" column="updater"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiEvaluateVo">
|
||||
select id, user_id, user_type, nickname, to_user_id, to_user_type, evaluate_code, evaluate, creator, create_time, updater, update_time, del_flag from dl_busi_evaluate
|
||||
select id,
|
||||
user_id,
|
||||
user_type,
|
||||
nickname,
|
||||
to_user_id,
|
||||
to_user_type,
|
||||
evaluate_code,
|
||||
evaluate,
|
||||
creator,
|
||||
create_time,
|
||||
updater,
|
||||
update_time,
|
||||
del_flag
|
||||
from dl_busi_evaluate
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BusiEvaluate" resultMap="BusiEvaluateResult">
|
||||
<include refid="selectBusiEvaluateVo"/>
|
||||
<where>
|
||||
<if test="entity.userType != null and entity.userType != ''"> and user_type = #{entity.userType}</if>
|
||||
<if test="entity.nickname != null and entity.nickname != ''"> and nickname like concat('%', #{entity.nickname}, '%')</if>
|
||||
<if test="entity.toUserId != null "> and to_user_id like concat('%', #{entity.toUserId}, '%')</if>
|
||||
<if test="entity.toUserType != null and entity.toUserType != ''"> and to_user_type = #{entity.toUserType}</if>
|
||||
<if test="entity.userType != null and entity.userType != ''">and user_type = #{entity.userType}</if>
|
||||
<if test="entity.nickname != null and entity.nickname != ''">and nickname like concat('%',
|
||||
#{entity.nickname}, '%')
|
||||
</if>
|
||||
<if test="entity.toUserId != null ">and to_user_id like concat('%', #{entity.toUserId}, '%')</if>
|
||||
<if test="entity.toUserType != null and entity.toUserType != ''">and to_user_type = #{entity.toUserType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="listByToUserId" resultType="com.ruoyi.busi.vo.BusiEvaluateVO">
|
||||
SELECT evaluate AS evaluate,
|
||||
COUNT(id) AS num
|
||||
FROM dl_busi_evaluate
|
||||
WHERE del_flag = 0
|
||||
and to_user_id = #{userId}
|
||||
GROUP BY evaluate
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user