feat(dormitory): 添加宿舍申请审批管理模块
- 新增审批管理实体类 DormitoryApply 及其对应字段和注释 - 创建 DormitoryApplyController 控制器,实现完整的 CRUD 接口 - 实现分页查询、列表查询、详情查询、新增、修改、删除等功能 - 支持批量添加、修改和删除操作- 添加权限控制和操作日志记录功能 - 实现与用户信息的关联查询逻辑 - 提供 MyBatis Mapper 接口及 XML 查询语句定义- 定义 DormitoryApplyParam 查询参数类支持条件查询 - 实现 Service 层接口及默认排序逻辑处理
This commit is contained in:
@@ -0,0 +1,128 @@
|
|||||||
|
package com.gxwebsoft.dormitory.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.dormitory.entity.DormitoryApply;
|
||||||
|
import com.gxwebsoft.dormitory.param.DormitoryApplyParam;
|
||||||
|
import com.gxwebsoft.dormitory.service.DormitoryApplyService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
@Tag(name = "审批管理管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/dormitory/dormitory-apply")
|
||||||
|
public class DormitoryApplyController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DormitoryApplyService dormitoryApplyService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')")
|
||||||
|
@Operation(summary = "分页查询审批管理")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DormitoryApply>> page(DormitoryApplyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(dormitoryApplyService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')")
|
||||||
|
@Operation(summary = "查询全部审批管理")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DormitoryApply>> list(DormitoryApplyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(dormitoryApplyService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')")
|
||||||
|
@Operation(summary = "根据id查询审批管理")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DormitoryApply> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(dormitoryApplyService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "添加审批管理")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DormitoryApply dormitoryApply) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
dormitoryApply.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (dormitoryApplyService.save(dormitoryApply)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "修改审批管理")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DormitoryApply dormitoryApply) {
|
||||||
|
if (dormitoryApplyService.updateById(dormitoryApply)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "删除审批管理")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (dormitoryApplyService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:save')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量添加审批管理")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DormitoryApply> list) {
|
||||||
|
if (dormitoryApplyService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:update')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量修改审批管理")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DormitoryApply> batchParam) {
|
||||||
|
if (batchParam.update(dormitoryApplyService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('dormitory:dormitoryApply:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@Operation(summary = "批量删除审批管理")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (dormitoryApplyService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.gxwebsoft.dormitory.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "审批管理")
|
||||||
|
public class DormitoryApply implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(description = "手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
private String dealerName;
|
||||||
|
|
||||||
|
@Schema(description = "客户编号")
|
||||||
|
private String dealerCode;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "签约价格")
|
||||||
|
private BigDecimal money;
|
||||||
|
|
||||||
|
@Schema(description = "推荐人用户ID")
|
||||||
|
private Integer refereeId;
|
||||||
|
|
||||||
|
@Schema(description = "申请方式(10需后台审核 20无需审核)")
|
||||||
|
private Integer applyType;
|
||||||
|
|
||||||
|
@Schema(description = "审核状态 (10待审核 20审核通过 30驳回)")
|
||||||
|
private Integer applyStatus;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "审核时间")
|
||||||
|
private LocalDateTime auditTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同时间")
|
||||||
|
private LocalDateTime contractTime;
|
||||||
|
|
||||||
|
@Schema(description = "过期时间")
|
||||||
|
private LocalDateTime expirationTime;
|
||||||
|
|
||||||
|
@Schema(description = "驳回原因")
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "商城ID")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.dormitory.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.dormitory.entity.DormitoryApply;
|
||||||
|
import com.gxwebsoft.dormitory.param.DormitoryApplyParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
public interface DormitoryApplyMapper extends BaseMapper<DormitoryApply> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DormitoryApply>
|
||||||
|
*/
|
||||||
|
List<DormitoryApply> selectPageRel(@Param("page") IPage<DormitoryApply> page,
|
||||||
|
@Param("param") DormitoryApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DormitoryApply> selectListRel(@Param("param") DormitoryApplyParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.gxwebsoft.dormitory.mapper.DormitoryApplyMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM dormitory_apply a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.realName != null">
|
||||||
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.mobile != null">
|
||||||
|
AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dealerName != null">
|
||||||
|
AND a.dealer_name LIKE CONCAT('%', #{param.dealerName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dealerCode != null">
|
||||||
|
AND a.dealer_code LIKE CONCAT('%', #{param.dealerCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.address != null">
|
||||||
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.money != null">
|
||||||
|
AND a.money = #{param.money}
|
||||||
|
</if>
|
||||||
|
<if test="param.refereeId != null">
|
||||||
|
AND a.referee_id = #{param.refereeId}
|
||||||
|
</if>
|
||||||
|
<if test="param.applyType != null">
|
||||||
|
AND a.apply_type = #{param.applyType}
|
||||||
|
</if>
|
||||||
|
<if test="param.applyStatus != null">
|
||||||
|
AND a.apply_status = #{param.applyStatus}
|
||||||
|
</if>
|
||||||
|
<if test="param.applyTime != null">
|
||||||
|
AND a.apply_time LIKE CONCAT('%', #{param.applyTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.auditTime != null">
|
||||||
|
AND a.audit_time LIKE CONCAT('%', #{param.auditTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.contractTime != null">
|
||||||
|
AND a.contract_time LIKE CONCAT('%', #{param.contractTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.expirationTime != null">
|
||||||
|
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.rejectReason != null">
|
||||||
|
AND a.reject_reason LIKE CONCAT('%', #{param.rejectReason}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryApply">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryApply">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.gxwebsoft.dormitory.param;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@Schema(description = "审批管理查询参数")
|
||||||
|
public class DormitoryApplyParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "类型")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
@Schema(description = "手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
private String dealerName;
|
||||||
|
|
||||||
|
@Schema(description = "客户编号")
|
||||||
|
private String dealerCode;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "签约价格")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal money;
|
||||||
|
|
||||||
|
@Schema(description = "推荐人用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer refereeId;
|
||||||
|
|
||||||
|
@Schema(description = "申请方式(10需后台审核 20无需审核)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer applyType;
|
||||||
|
|
||||||
|
@Schema(description = "审核状态 (10待审核 20审核通过 30驳回)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer applyStatus;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
private String applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "审核时间")
|
||||||
|
private String auditTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同时间")
|
||||||
|
private String contractTime;
|
||||||
|
|
||||||
|
@Schema(description = "过期时间")
|
||||||
|
private String expirationTime;
|
||||||
|
|
||||||
|
@Schema(description = "驳回原因")
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.dormitory.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.dormitory.entity.DormitoryApply;
|
||||||
|
import com.gxwebsoft.dormitory.param.DormitoryApplyParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
public interface DormitoryApplyService extends IService<DormitoryApply> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<DormitoryApply>
|
||||||
|
*/
|
||||||
|
PageResult<DormitoryApply> pageRel(DormitoryApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DormitoryApply>
|
||||||
|
*/
|
||||||
|
List<DormitoryApply> listRel(DormitoryApplyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id 主键ID
|
||||||
|
* @return DormitoryApply
|
||||||
|
*/
|
||||||
|
DormitoryApply getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.dormitory.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.dormitory.entity.DormitoryApply;
|
||||||
|
import com.gxwebsoft.dormitory.mapper.DormitoryApplyMapper;
|
||||||
|
import com.gxwebsoft.dormitory.param.DormitoryApplyParam;
|
||||||
|
import com.gxwebsoft.dormitory.service.DormitoryApplyService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批管理Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-10-03 15:54:30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DormitoryApplyServiceImpl extends ServiceImpl<DormitoryApplyMapper, DormitoryApply> implements DormitoryApplyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DormitoryApply> pageRel(DormitoryApplyParam param) {
|
||||||
|
PageParam<DormitoryApply, DormitoryApplyParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<DormitoryApply> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DormitoryApply> listRel(DormitoryApplyParam param) {
|
||||||
|
List<DormitoryApply> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<DormitoryApply, DormitoryApplyParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DormitoryApply getByIdRel(Integer id) {
|
||||||
|
DormitoryApplyParam param = new DormitoryApplyParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user