This commit is contained in:
PQZ 2025-03-17 15:47:03 +08:00
parent 67ccc2d69f
commit 24a670e9e7
5 changed files with 70 additions and 18 deletions
ruoyi-admin/src/main

View File

@ -4,16 +4,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.security.access.prepost.PreAuthorize;
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 org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -36,18 +32,23 @@ public class MemberUserController extends BaseController
@Autowired
private IMemberUserService memberUserService;
/**
* 查询会员列表
*/
@PreAuthorize("@ss.hasPermi('member:member:list')")
@PreAuthorize("@ss.hasPermi('base:user:list')")
@GetMapping("/list")
public AjaxResult list(MemberUser memberUser)
public AjaxResult list(MemberUser memberUser,
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
{
List<MemberUser> list = memberUserService.list();
Page<MemberUser> page = new Page<>(pageNum, pageSize);
IPage<MemberUser> list = memberUserService.queryListPage(memberUser,page);
return success(list);
}
/**
* 导出会员列表
*/

View File

@ -1,18 +1,31 @@
package com.ruoyi.member.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.member.domain.MemberUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 会员Mapper接口
*
*
* @author pqz
* @date 2025-03-17
*/
@Mapper
public interface MemberUserMapper extends BaseMapper<MemberUser>
{
public interface MemberUserMapper extends BaseMapper<MemberUser> {
/**
* 分页查询会员
*
* @param entity {@link MemberUser}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberUser>
* @author PQZ
* @date 15:34 2025/3/17
**/
IPage<MemberUser> queryListPage(@Param("entity") MemberUser entity, Page<MemberUser> page);
}

View File

@ -1,16 +1,29 @@
package com.ruoyi.member.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.member.domain.MemberUser;
/**
* 会员Service接口
*
*
* @author pqz
* @date 2025-03-17
*/
public interface IMemberUserService extends IService<MemberUser>
{
public interface IMemberUserService extends IService<MemberUser> {
/**
* 分页列表查询
*
* @param pageReqVO {@link MemberUser}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberUser>
* @author PQZ
* @date 15:32 2025/3/17
**/
IPage<MemberUser> queryListPage(MemberUser pageReqVO, Page<MemberUser> page);
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.member.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -22,4 +25,17 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper,MemberUs
private MemberUserMapper memberUserMapper;
/**
* 分页列表查询
*
* @param pageReqVO {@link MemberUser}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberUser>
* @author PQZ
* @date 15:32 2025/3/17
**/
@Override
public IPage<MemberUser> queryListPage(MemberUser pageReqVO, Page<MemberUser> page) {
return memberUserMapper.queryListPage(pageReqVO, page);
}
}

View File

@ -28,5 +28,14 @@
select id, user_type, identity_type, user_id, tel, t_remaining, t_total_num, t_fans_num, t_open_disturb, t_recipient_name, t_recipient_image, b_points, creator, create_time, updater, update_time, del_flag from dl_member_user
</sql>
<select id="queryListPage" parameterType="MemberUser" resultMap="MemberUserResult">
<include refid="selectMemberUserVo"/>
<where>
<if test="entity.userType != null and entity.userType != ''"> and user_type = #{entity.userType}</if>
<if test="entity.identityType != null and entity.identityType != ''"> and identity_type = #{entity.identityType}</if>
<if test="entity.bPoints != null "> and b_points = #{entity.bPoints}</if>
</where>
</select>
</mapper>