feat(dormitory): 添加宿舍床位、楼栋、楼层和记录管理模块
- 新增宿舍床位实体类及关联的控制器、Mapper和XML文件 - 新增宿舍楼栋实体类及关联的控制器、Mapper和XML文件 - 新增宿舍楼层实体类及关联的控制器、Mapper和XML文件 - 新增宿舍记录实体类及关联的控制器、Mapper和XML文件 - 实现各模块的分页查询、列表查询、详情查询、增删改查功能- 配置Swagger注解用于接口文档说明- 添加权限控制和操作日志记录注解- 实现批量添加、修改和删除功能 - 添加关联查询SQL以支持联表查询展示信息
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
package com.gxwebsoft.dormitory.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryBedService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryBed;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBedParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 10:49:27
|
||||
*/
|
||||
@Tag(name = "宿舍床位管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/dormitory/dormitory-bed")
|
||||
public class DormitoryBedController extends BaseController {
|
||||
@Resource
|
||||
private DormitoryBedService dormitoryBedService;
|
||||
|
||||
@Operation(summary = "分页查询宿舍床位")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DormitoryBed>> page(DormitoryBedParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBedService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部宿舍床位")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DormitoryBed>> list(DormitoryBedParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBedService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询宿舍床位")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DormitoryBed> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBedService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加宿舍床位")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DormitoryBed dormitoryBed) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
// dormitoryBed实体类没有userId字段,所以不设置
|
||||
}
|
||||
if (dormitoryBedService.save(dormitoryBed)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改宿舍床位")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DormitoryBed dormitoryBed) {
|
||||
if (dormitoryBedService.updateById(dormitoryBed)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除宿舍床位")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dormitoryBedService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加宿舍床位")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DormitoryBed> list) {
|
||||
if (dormitoryBedService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改宿舍床位")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DormitoryBed> batchParam) {
|
||||
if (batchParam.update(dormitoryBedService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBed:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除宿舍床位")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dormitoryBedService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.gxwebsoft.dormitory.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryBuildingService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryBuilding;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBuildingParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 10:49:27
|
||||
*/
|
||||
@Tag(name = "宿舍楼栋管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/dormitory/dormitory-building")
|
||||
public class DormitoryBuildingController extends BaseController {
|
||||
@Resource
|
||||
private DormitoryBuildingService dormitoryBuildingService;
|
||||
|
||||
@Operation(summary = "分页查询宿舍楼栋")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DormitoryBuilding>> page(DormitoryBuildingParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBuildingService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部宿舍楼栋")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DormitoryBuilding>> list(DormitoryBuildingParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBuildingService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询宿舍楼栋")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DormitoryBuilding> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryBuildingService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加宿舍楼栋")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DormitoryBuilding dormitoryBuilding) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
// dormitoryBuilding实体类没有userId字段,所以不设置
|
||||
}
|
||||
if (dormitoryBuildingService.save(dormitoryBuilding)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改宿舍楼栋")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DormitoryBuilding dormitoryBuilding) {
|
||||
if (dormitoryBuildingService.updateById(dormitoryBuilding)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除宿舍楼栋")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dormitoryBuildingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加宿舍楼栋")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DormitoryBuilding> list) {
|
||||
if (dormitoryBuildingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改宿舍楼栋")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DormitoryBuilding> batchParam) {
|
||||
if (batchParam.update(dormitoryBuildingService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除宿舍楼栋")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dormitoryBuildingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.gxwebsoft.dormitory.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryFloorService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryFloor;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryFloorParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 10:49:27
|
||||
*/
|
||||
@Tag(name = "宿舍楼层管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/dormitory/dormitory-floor")
|
||||
public class DormitoryFloorController extends BaseController {
|
||||
@Resource
|
||||
private DormitoryFloorService dormitoryFloorService;
|
||||
|
||||
@Operation(summary = "分页查询宿舍楼层")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DormitoryFloor>> page(DormitoryFloorParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryFloorService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部宿舍楼层")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DormitoryFloor>> list(DormitoryFloorParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryFloorService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询宿舍楼层")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DormitoryFloor> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryFloorService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加宿舍楼层")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DormitoryFloor dormitoryFloor) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
// dormitoryFloor实体类没有userId字段,所以不设置
|
||||
}
|
||||
if (dormitoryFloorService.save(dormitoryFloor)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改宿舍楼层")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DormitoryFloor dormitoryFloor) {
|
||||
if (dormitoryFloorService.updateById(dormitoryFloor)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除宿舍楼层")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dormitoryFloorService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加宿舍楼层")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DormitoryFloor> list) {
|
||||
if (dormitoryFloorService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改宿舍楼层")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DormitoryFloor> batchParam) {
|
||||
if (batchParam.update(dormitoryFloorService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryFloor:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除宿舍楼层")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dormitoryFloorService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.gxwebsoft.dormitory.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryRecordService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryRecord;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryRecordParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 10:49:27
|
||||
*/
|
||||
@Tag(name = "宿舍记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/dormitory/dormitory-record")
|
||||
public class DormitoryRecordController extends BaseController {
|
||||
@Resource
|
||||
private DormitoryRecordService dormitoryRecordService;
|
||||
|
||||
@Operation(summary = "分页查询宿舍记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DormitoryRecord>> page(DormitoryRecordParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryRecordService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部宿舍记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DormitoryRecord>> list(DormitoryRecordParam param) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryRecordService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询宿舍记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DormitoryRecord> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dormitoryRecordService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加宿舍记录")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DormitoryRecord dormitoryRecord) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
// dormitoryRecord实体类没有userId字段,所以不设置
|
||||
}
|
||||
if (dormitoryRecordService.save(dormitoryRecord)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改宿舍记录")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DormitoryRecord dormitoryRecord) {
|
||||
if (dormitoryRecordService.updateById(dormitoryRecord)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除宿舍记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dormitoryRecordService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加宿舍记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DormitoryRecord> list) {
|
||||
if (dormitoryRecordService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改宿舍记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DormitoryRecord> batchParam) {
|
||||
if (batchParam.update(dormitoryRecordService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('dormitory:dormitoryRecord:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除宿舍记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dormitoryRecordService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.dormitory.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍床位
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "宿舍床位")
|
||||
public class DormitoryBed implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "宿舍名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "楼栋名称")
|
||||
@TableField(exist = false)
|
||||
private String buildingName;
|
||||
|
||||
@Schema(description = "楼层ID")
|
||||
private Integer floorId;
|
||||
|
||||
@Schema(description = "楼层名称")
|
||||
@TableField(exist = false)
|
||||
private String floorName;
|
||||
|
||||
@Schema(description = "宿舍ID")
|
||||
private Integer recordId;
|
||||
|
||||
@Schema(description = "宿舍名称")
|
||||
@TableField(exist = false)
|
||||
private String recordName;
|
||||
|
||||
@Schema(description = "学生ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "上下铺 1下铺 2上铺 0无")
|
||||
private Boolean bunk;
|
||||
|
||||
@Schema(description = "充电口")
|
||||
private Boolean chargingPort;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1报修")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.gxwebsoft.dormitory.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼栋
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "宿舍楼栋")
|
||||
public class DormitoryBuilding implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "楼栋名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "楼栋编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gxwebsoft.dormitory.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼层
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "宿舍楼层")
|
||||
public class DormitoryFloor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "楼层")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋")
|
||||
@TableField(exist = false)
|
||||
private String buildingName;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gxwebsoft.dormitory.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "宿舍记录")
|
||||
public class DormitoryRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "宿舍名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "楼栋名称")
|
||||
@TableField(exist = false)
|
||||
private String buildingName;
|
||||
|
||||
@Schema(description = "楼层ID")
|
||||
private Integer floorId;
|
||||
|
||||
@Schema(description = "楼层名称")
|
||||
@TableField(exist = false)
|
||||
private String floorName;
|
||||
|
||||
@Schema(description = "床位数")
|
||||
private Integer beds;
|
||||
|
||||
@Schema(description = "独立卫生间")
|
||||
private Boolean toilet;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -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.DormitoryBed;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBedParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍床位Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryBedMapper extends BaseMapper<DormitoryBed> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryBed>
|
||||
*/
|
||||
List<DormitoryBed> selectPageRel(@Param("page") IPage<DormitoryBed> page,
|
||||
@Param("param") DormitoryBedParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DormitoryBed> selectListRel(@Param("param") DormitoryBedParam param);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryBuilding;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBuildingParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼栋Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryBuildingMapper extends BaseMapper<DormitoryBuilding> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryBuilding>
|
||||
*/
|
||||
List<DormitoryBuilding> selectPageRel(@Param("page") IPage<DormitoryBuilding> page,
|
||||
@Param("param") DormitoryBuildingParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DormitoryBuilding> selectListRel(@Param("param") DormitoryBuildingParam param);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryFloor;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryFloorParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼层Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryFloorMapper extends BaseMapper<DormitoryFloor> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryFloor>
|
||||
*/
|
||||
List<DormitoryFloor> selectPageRel(@Param("page") IPage<DormitoryFloor> page,
|
||||
@Param("param") DormitoryFloorParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DormitoryFloor> selectListRel(@Param("param") DormitoryFloorParam param);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryRecord;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍记录Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryRecordMapper extends BaseMapper<DormitoryRecord> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryRecord>
|
||||
*/
|
||||
List<DormitoryRecord> selectPageRel(@Param("page") IPage<DormitoryRecord> page,
|
||||
@Param("param") DormitoryRecordParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DormitoryRecord> selectListRel(@Param("param") DormitoryRecordParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.DormitoryBedMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.name AS buildingName, c.name AS floorName, d.name AS recordName
|
||||
FROM dormitory_bed a
|
||||
LEFT JOIN dormitory_building b ON a.building_id = b.id
|
||||
LEFT JOIN dormitory_floor c ON a.floor_id = c.id
|
||||
LEFT JOIN dormitory_record d ON a.record_id = d.id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.buildingId != null">
|
||||
AND a.building_id = #{param.buildingId}
|
||||
</if>
|
||||
<if test="param.floorId != null">
|
||||
AND a.floor_id = #{param.floorId}
|
||||
</if>
|
||||
<if test="param.recordId != null">
|
||||
AND a.record_id = #{param.recordId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.bunk != null">
|
||||
AND a.bunk = #{param.bunk}
|
||||
</if>
|
||||
<if test="param.chargingPort != null">
|
||||
AND a.charging_port = #{param.chargingPort}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</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.DormitoryBed">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryBed">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?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.DormitoryBuildingMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM dormitory_building a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</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.DormitoryBuilding">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryBuilding">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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.DormitoryFloorMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.name AS buildingName
|
||||
FROM dormitory_floor a
|
||||
LEFT JOIN dormitory_building b ON a.building_id = b.id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.buildingId != null">
|
||||
AND a.building_id = #{param.buildingId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</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.DormitoryFloor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryFloor">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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.DormitoryRecordMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.name AS buildingName, c.name AS floorName
|
||||
FROM dormitory_record a
|
||||
LEFT JOIN dormitory_building b ON a.building_id = b.id
|
||||
LEFT JOIN dormitory_floor c ON a.floor_id = c.id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.buildingId != null">
|
||||
AND a.building_id = #{param.buildingId}
|
||||
</if>
|
||||
<if test="param.floorId != null">
|
||||
AND a.floor_id = #{param.floorId}
|
||||
</if>
|
||||
<if test="param.beds != null">
|
||||
AND a.beds = #{param.beds}
|
||||
</if>
|
||||
<if test="param.toilet != null">
|
||||
AND a.toilet = #{param.toilet}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</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.DormitoryRecord">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.dormitory.entity.DormitoryRecord">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gxwebsoft.dormitory.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍床位查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(description = "宿舍床位查询参数")
|
||||
public class DormitoryBedParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "宿舍名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "楼层ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer floorId;
|
||||
|
||||
@Schema(description = "宿舍ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recordId;
|
||||
|
||||
@Schema(description = "学生ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "上下铺 1下铺 2上铺 0无")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean bunk;
|
||||
|
||||
@Schema(description = "充电口")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean chargingPort;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1报修")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gxwebsoft.dormitory.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼栋查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(description = "宿舍楼栋查询参数")
|
||||
public class DormitoryBuildingParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "楼栋名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "楼栋编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gxwebsoft.dormitory.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍楼层查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(description = "宿舍楼层查询参数")
|
||||
public class DormitoryFloorParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "楼层")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gxwebsoft.dormitory.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 宿舍记录查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(description = "宿舍记录查询参数")
|
||||
public class DormitoryRecordParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "宿舍名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "楼栋ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer buildingId;
|
||||
|
||||
@Schema(description = "楼层ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer floorId;
|
||||
|
||||
@Schema(description = "床位数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer beds;
|
||||
|
||||
@Schema(description = "独立卫生间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean toilet;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -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.DormitoryBed;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBedParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍床位Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryBedService extends IService<DormitoryBed> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DormitoryBed>
|
||||
*/
|
||||
PageResult<DormitoryBed> pageRel(DormitoryBedParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryBed>
|
||||
*/
|
||||
List<DormitoryBed> listRel(DormitoryBedParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return DormitoryBed
|
||||
*/
|
||||
DormitoryBed getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryBuilding;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBuildingParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼栋Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryBuildingService extends IService<DormitoryBuilding> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DormitoryBuilding>
|
||||
*/
|
||||
PageResult<DormitoryBuilding> pageRel(DormitoryBuildingParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryBuilding>
|
||||
*/
|
||||
List<DormitoryBuilding> listRel(DormitoryBuildingParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return DormitoryBuilding
|
||||
*/
|
||||
DormitoryBuilding getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryFloor;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryFloorParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼层Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryFloorService extends IService<DormitoryFloor> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DormitoryFloor>
|
||||
*/
|
||||
PageResult<DormitoryFloor> pageRel(DormitoryFloorParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryFloor>
|
||||
*/
|
||||
List<DormitoryFloor> listRel(DormitoryFloorParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return DormitoryFloor
|
||||
*/
|
||||
DormitoryFloor getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -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.DormitoryRecord;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryRecordParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍记录Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
public interface DormitoryRecordService extends IService<DormitoryRecord> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DormitoryRecord>
|
||||
*/
|
||||
PageResult<DormitoryRecord> pageRel(DormitoryRecordParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DormitoryRecord>
|
||||
*/
|
||||
List<DormitoryRecord> listRel(DormitoryRecordParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return DormitoryRecord
|
||||
*/
|
||||
DormitoryRecord getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.dormitory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.dormitory.mapper.DormitoryBedMapper;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryBedService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryBed;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBedParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍床位Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Service
|
||||
public class DormitoryBedServiceImpl extends ServiceImpl<DormitoryBedMapper, DormitoryBed> implements DormitoryBedService {
|
||||
|
||||
@Override
|
||||
public PageResult<DormitoryBed> pageRel(DormitoryBedParam param) {
|
||||
PageParam<DormitoryBed, DormitoryBedParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DormitoryBed> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DormitoryBed> listRel(DormitoryBedParam param) {
|
||||
List<DormitoryBed> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DormitoryBed, DormitoryBedParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DormitoryBed getByIdRel(Integer id) {
|
||||
DormitoryBedParam param = new DormitoryBedParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.dormitory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.dormitory.mapper.DormitoryBuildingMapper;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryBuildingService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryBuilding;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryBuildingParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼栋Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Service
|
||||
public class DormitoryBuildingServiceImpl extends ServiceImpl<DormitoryBuildingMapper, DormitoryBuilding> implements DormitoryBuildingService {
|
||||
|
||||
@Override
|
||||
public PageResult<DormitoryBuilding> pageRel(DormitoryBuildingParam param) {
|
||||
PageParam<DormitoryBuilding, DormitoryBuildingParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DormitoryBuilding> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DormitoryBuilding> listRel(DormitoryBuildingParam param) {
|
||||
List<DormitoryBuilding> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DormitoryBuilding, DormitoryBuildingParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DormitoryBuilding getByIdRel(Integer id) {
|
||||
DormitoryBuildingParam param = new DormitoryBuildingParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.dormitory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.dormitory.mapper.DormitoryFloorMapper;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryFloorService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryFloor;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryFloorParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍楼层Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Service
|
||||
public class DormitoryFloorServiceImpl extends ServiceImpl<DormitoryFloorMapper, DormitoryFloor> implements DormitoryFloorService {
|
||||
|
||||
@Override
|
||||
public PageResult<DormitoryFloor> pageRel(DormitoryFloorParam param) {
|
||||
PageParam<DormitoryFloor, DormitoryFloorParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DormitoryFloor> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DormitoryFloor> listRel(DormitoryFloorParam param) {
|
||||
List<DormitoryFloor> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DormitoryFloor, DormitoryFloorParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DormitoryFloor getByIdRel(Integer id) {
|
||||
DormitoryFloorParam param = new DormitoryFloorParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.dormitory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.dormitory.mapper.DormitoryRecordMapper;
|
||||
import com.gxwebsoft.dormitory.service.DormitoryRecordService;
|
||||
import com.gxwebsoft.dormitory.entity.DormitoryRecord;
|
||||
import com.gxwebsoft.dormitory.param.DormitoryRecordParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍记录Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 10:49:27
|
||||
*/
|
||||
@Service
|
||||
public class DormitoryRecordServiceImpl extends ServiceImpl<DormitoryRecordMapper, DormitoryRecord> implements DormitoryRecordService {
|
||||
|
||||
@Override
|
||||
public PageResult<DormitoryRecord> pageRel(DormitoryRecordParam param) {
|
||||
PageParam<DormitoryRecord, DormitoryRecordParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DormitoryRecord> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DormitoryRecord> listRel(DormitoryRecordParam param) {
|
||||
List<DormitoryRecord> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DormitoryRecord, DormitoryRecordParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DormitoryRecord getByIdRel(Integer id) {
|
||||
DormitoryRecordParam param = new DormitoryRecordParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.gxwebsoft.shop.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.shop.entity.ShopUser;
|
||||
import com.gxwebsoft.shop.param.ShopUserParam;
|
||||
import com.gxwebsoft.shop.service.ShopUserService;
|
||||
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 13:41:09
|
||||
*/
|
||||
@Tag(name = "用户记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-user")
|
||||
public class ShopUserController extends BaseController {
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:list')")
|
||||
@Operation(summary = "分页查询用户记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopUser>> page(ShopUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:list')")
|
||||
@Operation(summary = "查询全部用户记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopUser>> list(ShopUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopUserService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:list')")
|
||||
@Operation(summary = "根据id查询用户记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopUserService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加用户记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopUser shopUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
shopUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (shopUserService.save(shopUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改用户记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopUser shopUser) {
|
||||
if (shopUserService.updateById(shopUser)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除用户记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (shopUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加用户记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopUser> list) {
|
||||
if (shopUserService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改用户记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopUser> batchParam) {
|
||||
if (batchParam.update(shopUserService, "user_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除用户记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (shopUserService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.ShopUsersService;
|
||||
import com.gxwebsoft.shop.entity.ShopUsers;
|
||||
import com.gxwebsoft.shop.param.ShopUsersParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
*/
|
||||
@Tag(name = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-users")
|
||||
public class ShopUsersController extends BaseController {
|
||||
@Resource
|
||||
private ShopUsersService shopUsersService;
|
||||
|
||||
@Operation(summary = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopUsers>> page(ShopUsersParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopUsersService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopUsers>> list(ShopUsersParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopUsersService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUsers:list')")
|
||||
@Operation(summary = "根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopUsers> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopUsersService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopUsers shopUsers) {
|
||||
if (shopUsersService.save(shopUsers)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopUsers shopUsers) {
|
||||
if (shopUsersService.updateById(shopUsers)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (shopUsersService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopUsers> list) {
|
||||
if (shopUsersService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopUsers> batchParam) {
|
||||
if (batchParam.update(shopUsersService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (shopUsersService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
251
src/main/java/com/gxwebsoft/shop/entity/ShopUser.java
Normal file
251
src/main/java/com/gxwebsoft/shop/entity/ShopUser.java
Normal file
@@ -0,0 +1,251 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
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.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 13:41:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "用户记录表")
|
||||
public class ShopUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@TableId(value = "user_id", type = IdType.AUTO)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "用户类型 0个人用户 1企业用户 2其他")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "账号")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "注册来源客户端 (APP、H5、MP-WEIXIN等)")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "邮箱是否验证, 0否, 1是")
|
||||
private Integer emailVerified;
|
||||
|
||||
@Schema(description = "别名")
|
||||
private String alias;
|
||||
|
||||
@Schema(description = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "街道地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "用户可用余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "已提现金额")
|
||||
private BigDecimal cashedMoney;
|
||||
|
||||
@Schema(description = "用户可用积分")
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "用户总支付的金额")
|
||||
private BigDecimal payMoney;
|
||||
|
||||
@Schema(description = "实际消费的金额(不含退款)")
|
||||
private BigDecimal expendMoney;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String payPassword;
|
||||
|
||||
@Schema(description = "会员等级ID")
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "个人简介")
|
||||
private String introduction;
|
||||
|
||||
@Schema(description = "机构id")
|
||||
private Integer organizationId;
|
||||
|
||||
@Schema(description = "会员分组ID")
|
||||
private Integer groupId;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "背景图")
|
||||
private String bgImage;
|
||||
|
||||
@Schema(description = "用户编码")
|
||||
private String userCode;
|
||||
|
||||
@Schema(description = "是否已实名认证")
|
||||
private Integer certification;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "是否线下会员")
|
||||
private Boolean offline;
|
||||
|
||||
@Schema(description = "关注数")
|
||||
private Integer followers;
|
||||
|
||||
@Schema(description = "粉丝数")
|
||||
private Integer fans;
|
||||
|
||||
@Schema(description = "点赞数")
|
||||
private Integer likes;
|
||||
|
||||
@Schema(description = "评论数")
|
||||
private Integer commentNumbers;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "微信openid")
|
||||
private String openid;
|
||||
|
||||
@Schema(description = "微信公众号openid")
|
||||
private String officeOpenid;
|
||||
|
||||
@Schema(description = "微信unionID")
|
||||
private String unionid;
|
||||
|
||||
@Schema(description = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
@Schema(description = "不允许办卡")
|
||||
private Boolean notAllowVip;
|
||||
|
||||
@Schema(description = "是否管理员")
|
||||
private Boolean isAdmin;
|
||||
|
||||
@Schema(description = "是否企业管理员")
|
||||
private Boolean isOrganizationAdmin;
|
||||
|
||||
@Schema(description = "累计登录次数")
|
||||
private Integer loginNum;
|
||||
|
||||
@Schema(description = "企业ID")
|
||||
private Integer companyId;
|
||||
|
||||
@Schema(description = "可管理的场馆")
|
||||
private String merchants;
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@Schema(description = "商户头像")
|
||||
private String merchantAvatar;
|
||||
|
||||
@Schema(description = "第三方系统的用户ID")
|
||||
private Integer uid;
|
||||
|
||||
@Schema(description = "专家角色")
|
||||
private Boolean expertType;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
private Integer expireTime;
|
||||
|
||||
@Schema(description = "最后结算时间")
|
||||
private LocalDateTime settlementTime;
|
||||
|
||||
@Schema(description = "资质")
|
||||
private String aptitude;
|
||||
|
||||
@Schema(description = "行业类型(父级)")
|
||||
private String industryParent;
|
||||
|
||||
@Schema(description = "行业类型(子级)")
|
||||
private String industryChild;
|
||||
|
||||
@Schema(description = "头衔")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "安装的产品ID")
|
||||
private Integer templateId;
|
||||
|
||||
@Schema(description = "插件安装状态(仅对超超管判断) 0未安装 1已安装 ")
|
||||
private Integer installed;
|
||||
|
||||
@Schema(description = "特长")
|
||||
private String speciality;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0在线, 1离线")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ShopUsers对象", description = "")
|
||||
public class ShopUsers implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "用户唯一小程序id")
|
||||
private String openId;
|
||||
|
||||
@Schema(description = "小程序用户秘钥")
|
||||
private String sessionKey;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "1男,2女")
|
||||
private Boolean gender;
|
||||
|
||||
@Schema(description = "国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "积分")
|
||||
private BigDecimal integral;
|
||||
|
||||
@Schema(description = "余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "注册时间")
|
||||
private Integer createTime;
|
||||
|
||||
private String idCard;
|
||||
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "是否管理员:1是;2否")
|
||||
private Boolean isAdmin;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -2,29 +2,29 @@ package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.ShopUsers;
|
||||
import com.gxwebsoft.shop.param.ShopUsersParam;
|
||||
import com.gxwebsoft.shop.entity.ShopUser;
|
||||
import com.gxwebsoft.shop.param.ShopUserParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper
|
||||
* 用户记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
* @since 2025-10-03 13:41:09
|
||||
*/
|
||||
public interface ShopUsersMapper extends BaseMapper<ShopUsers> {
|
||||
public interface ShopUserMapper extends BaseMapper<ShopUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ShopUsers>
|
||||
* @return List<ShopUser>
|
||||
*/
|
||||
List<ShopUsers> selectPageRel(@Param("page") IPage<ShopUsers> page,
|
||||
@Param("param") ShopUsersParam param);
|
||||
List<ShopUser> selectPageRel(@Param("page") IPage<ShopUser> page,
|
||||
@Param("param") ShopUserParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
@@ -32,6 +32,6 @@ public interface ShopUsersMapper extends BaseMapper<ShopUsers> {
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ShopUsers> selectListRel(@Param("param") ShopUsersParam param);
|
||||
List<ShopUser> selectListRel(@Param("param") ShopUserParam param);
|
||||
|
||||
}
|
||||
249
src/main/java/com/gxwebsoft/shop/mapper/xml/ShopUserMapper.xml
Normal file
249
src/main/java/com/gxwebsoft/shop/mapper/xml/ShopUserMapper.xml
Normal file
@@ -0,0 +1,249 @@
|
||||
<?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.shop.mapper.ShopUserMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_user a
|
||||
<where>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.username != null">
|
||||
AND a.username LIKE CONCAT('%', #{param.username}, '%')
|
||||
</if>
|
||||
<if test="param.password != null">
|
||||
AND a.password LIKE CONCAT('%', #{param.password}, '%')
|
||||
</if>
|
||||
<if test="param.nickname != null">
|
||||
AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.sex != null">
|
||||
AND a.sex = #{param.sex}
|
||||
</if>
|
||||
<if test="param.position != null">
|
||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||
</if>
|
||||
<if test="param.platform != null">
|
||||
AND a.platform LIKE CONCAT('%', #{param.platform}, '%')
|
||||
</if>
|
||||
<if test="param.email != null">
|
||||
AND a.email LIKE CONCAT('%', #{param.email}, '%')
|
||||
</if>
|
||||
<if test="param.emailVerified != null">
|
||||
AND a.email_verified = #{param.emailVerified}
|
||||
</if>
|
||||
<if test="param.alias != null">
|
||||
AND a.alias LIKE CONCAT('%', #{param.alias}, '%')
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.idCard != null">
|
||||
AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%')
|
||||
</if>
|
||||
<if test="param.birthday != null">
|
||||
AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%')
|
||||
</if>
|
||||
<if test="param.country != null">
|
||||
AND a.country LIKE CONCAT('%', #{param.country}, '%')
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
</if>
|
||||
<if test="param.city != null">
|
||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||
</if>
|
||||
<if test="param.region != null">
|
||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||
</if>
|
||||
<if test="param.address != null">
|
||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||
</if>
|
||||
<if test="param.longitude != null">
|
||||
AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%')
|
||||
</if>
|
||||
<if test="param.latitude != null">
|
||||
AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%')
|
||||
</if>
|
||||
<if test="param.balance != null">
|
||||
AND a.balance = #{param.balance}
|
||||
</if>
|
||||
<if test="param.cashedMoney != null">
|
||||
AND a.cashed_money = #{param.cashedMoney}
|
||||
</if>
|
||||
<if test="param.points != null">
|
||||
AND a.points = #{param.points}
|
||||
</if>
|
||||
<if test="param.payMoney != null">
|
||||
AND a.pay_money = #{param.payMoney}
|
||||
</if>
|
||||
<if test="param.expendMoney != null">
|
||||
AND a.expend_money = #{param.expendMoney}
|
||||
</if>
|
||||
<if test="param.payPassword != null">
|
||||
AND a.pay_password LIKE CONCAT('%', #{param.payPassword}, '%')
|
||||
</if>
|
||||
<if test="param.gradeId != null">
|
||||
AND a.grade_id = #{param.gradeId}
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||
</if>
|
||||
<if test="param.introduction != null">
|
||||
AND a.introduction LIKE CONCAT('%', #{param.introduction}, '%')
|
||||
</if>
|
||||
<if test="param.organizationId != null">
|
||||
AND a.organization_id = #{param.organizationId}
|
||||
</if>
|
||||
<if test="param.groupId != null">
|
||||
AND a.group_id = #{param.groupId}
|
||||
</if>
|
||||
<if test="param.avatar != null">
|
||||
AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%')
|
||||
</if>
|
||||
<if test="param.bgImage != null">
|
||||
AND a.bg_image LIKE CONCAT('%', #{param.bgImage}, '%')
|
||||
</if>
|
||||
<if test="param.userCode != null">
|
||||
AND a.user_code LIKE CONCAT('%', #{param.userCode}, '%')
|
||||
</if>
|
||||
<if test="param.certification != null">
|
||||
AND a.certification = #{param.certification}
|
||||
</if>
|
||||
<if test="param.age != null">
|
||||
AND a.age = #{param.age}
|
||||
</if>
|
||||
<if test="param.offline != null">
|
||||
AND a.offline = #{param.offline}
|
||||
</if>
|
||||
<if test="param.followers != null">
|
||||
AND a.followers = #{param.followers}
|
||||
</if>
|
||||
<if test="param.fans != null">
|
||||
AND a.fans = #{param.fans}
|
||||
</if>
|
||||
<if test="param.likes != null">
|
||||
AND a.likes = #{param.likes}
|
||||
</if>
|
||||
<if test="param.commentNumbers != null">
|
||||
AND a.comment_numbers = #{param.commentNumbers}
|
||||
</if>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</if>
|
||||
<if test="param.openid != null">
|
||||
AND a.openid LIKE CONCAT('%', #{param.openid}, '%')
|
||||
</if>
|
||||
<if test="param.officeOpenid != null">
|
||||
AND a.office_openid LIKE CONCAT('%', #{param.officeOpenid}, '%')
|
||||
</if>
|
||||
<if test="param.unionid != null">
|
||||
AND a.unionid LIKE CONCAT('%', #{param.unionid}, '%')
|
||||
</if>
|
||||
<if test="param.clientId != null">
|
||||
AND a.client_id LIKE CONCAT('%', #{param.clientId}, '%')
|
||||
</if>
|
||||
<if test="param.notAllowVip != null">
|
||||
AND a.not_allow_vip = #{param.notAllowVip}
|
||||
</if>
|
||||
<if test="param.isAdmin != null">
|
||||
AND a.is_admin = #{param.isAdmin}
|
||||
</if>
|
||||
<if test="param.isOrganizationAdmin != null">
|
||||
AND a.is_organization_admin = #{param.isOrganizationAdmin}
|
||||
</if>
|
||||
<if test="param.loginNum != null">
|
||||
AND a.login_num = #{param.loginNum}
|
||||
</if>
|
||||
<if test="param.companyId != null">
|
||||
AND a.company_id = #{param.companyId}
|
||||
</if>
|
||||
<if test="param.merchants != null">
|
||||
AND a.merchants LIKE CONCAT('%', #{param.merchants}, '%')
|
||||
</if>
|
||||
<if test="param.merchantId != null">
|
||||
AND a.merchant_id = #{param.merchantId}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantAvatar != null">
|
||||
AND a.merchant_avatar LIKE CONCAT('%', #{param.merchantAvatar}, '%')
|
||||
</if>
|
||||
<if test="param.uid != null">
|
||||
AND a.uid = #{param.uid}
|
||||
</if>
|
||||
<if test="param.expertType != null">
|
||||
AND a.expert_type = #{param.expertType}
|
||||
</if>
|
||||
<if test="param.expireTime != null">
|
||||
AND a.expire_time = #{param.expireTime}
|
||||
</if>
|
||||
<if test="param.settlementTime != null">
|
||||
AND a.settlement_time LIKE CONCAT('%', #{param.settlementTime}, '%')
|
||||
</if>
|
||||
<if test="param.aptitude != null">
|
||||
AND a.aptitude LIKE CONCAT('%', #{param.aptitude}, '%')
|
||||
</if>
|
||||
<if test="param.industryParent != null">
|
||||
AND a.industry_parent LIKE CONCAT('%', #{param.industryParent}, '%')
|
||||
</if>
|
||||
<if test="param.industryChild != null">
|
||||
AND a.industry_child LIKE CONCAT('%', #{param.industryChild}, '%')
|
||||
</if>
|
||||
<if test="param.title != null">
|
||||
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||
</if>
|
||||
<if test="param.templateId != null">
|
||||
AND a.template_id = #{param.templateId}
|
||||
</if>
|
||||
<if test="param.installed != null">
|
||||
AND a.installed = #{param.installed}
|
||||
</if>
|
||||
<if test="param.speciality != null">
|
||||
AND a.speciality LIKE CONCAT('%', #{param.speciality}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</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.shop.entity.ShopUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,81 +0,0 @@
|
||||
<?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.shop.mapper.ShopUsersMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_users a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.openId != null">
|
||||
AND a.open_id LIKE CONCAT('%', #{param.openId}, '%')
|
||||
</if>
|
||||
<if test="param.sessionKey != null">
|
||||
AND a.session_key LIKE CONCAT('%', #{param.sessionKey}, '%')
|
||||
</if>
|
||||
<if test="param.username != null">
|
||||
AND a.username LIKE CONCAT('%', #{param.username}, '%')
|
||||
</if>
|
||||
<if test="param.avatarUrl != null">
|
||||
AND a.avatar_url LIKE CONCAT('%', #{param.avatarUrl}, '%')
|
||||
</if>
|
||||
<if test="param.gender != null">
|
||||
AND a.gender = #{param.gender}
|
||||
</if>
|
||||
<if test="param.country != null">
|
||||
AND a.country LIKE CONCAT('%', #{param.country}, '%')
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
</if>
|
||||
<if test="param.city != null">
|
||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.integral != null">
|
||||
AND a.integral = #{param.integral}
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</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.idCard != null">
|
||||
AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%')
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.isAdmin != null">
|
||||
AND a.is_admin = #{param.isAdmin}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopUsers">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopUsers">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
272
src/main/java/com/gxwebsoft/shop/param/ShopUserParam.java
Normal file
272
src/main/java/com/gxwebsoft/shop/param/ShopUserParam.java
Normal file
@@ -0,0 +1,272 @@
|
||||
package com.gxwebsoft.shop.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 13:41:08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(description = "用户记录表查询参数")
|
||||
public class ShopUserParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "用户类型 0个人用户 1企业用户 2其他")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "账号")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "注册来源客户端 (APP、H5、MP-WEIXIN等)")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "邮箱是否验证, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer emailVerified;
|
||||
|
||||
@Schema(description = "别名")
|
||||
private String alias;
|
||||
|
||||
@Schema(description = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "证件号码")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
private String birthday;
|
||||
|
||||
@Schema(description = "所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "街道地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "用户可用余额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "已提现金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal cashedMoney;
|
||||
|
||||
@Schema(description = "用户可用积分")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "用户总支付的金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal payMoney;
|
||||
|
||||
@Schema(description = "实际消费的金额(不含退款)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal expendMoney;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String payPassword;
|
||||
|
||||
@Schema(description = "会员等级ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "行业分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "个人简介")
|
||||
private String introduction;
|
||||
|
||||
@Schema(description = "机构id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer organizationId;
|
||||
|
||||
@Schema(description = "会员分组ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer groupId;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "背景图")
|
||||
private String bgImage;
|
||||
|
||||
@Schema(description = "用户编码")
|
||||
private String userCode;
|
||||
|
||||
@Schema(description = "是否已实名认证")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer certification;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "是否线下会员")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean offline;
|
||||
|
||||
@Schema(description = "关注数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer followers;
|
||||
|
||||
@Schema(description = "粉丝数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer fans;
|
||||
|
||||
@Schema(description = "点赞数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer likes;
|
||||
|
||||
@Schema(description = "评论数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer commentNumbers;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "微信openid")
|
||||
private String openid;
|
||||
|
||||
@Schema(description = "微信公众号openid")
|
||||
private String officeOpenid;
|
||||
|
||||
@Schema(description = "微信unionID")
|
||||
private String unionid;
|
||||
|
||||
@Schema(description = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
@Schema(description = "不允许办卡")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean notAllowVip;
|
||||
|
||||
@Schema(description = "是否管理员")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isAdmin;
|
||||
|
||||
@Schema(description = "是否企业管理员")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isOrganizationAdmin;
|
||||
|
||||
@Schema(description = "累计登录次数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer loginNum;
|
||||
|
||||
@Schema(description = "企业ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer companyId;
|
||||
|
||||
@Schema(description = "可管理的场馆")
|
||||
private String merchants;
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@Schema(description = "商户头像")
|
||||
private String merchantAvatar;
|
||||
|
||||
@Schema(description = "第三方系统的用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer uid;
|
||||
|
||||
@Schema(description = "专家角色")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean expertType;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer expireTime;
|
||||
|
||||
@Schema(description = "最后结算时间")
|
||||
private String settlementTime;
|
||||
|
||||
@Schema(description = "资质")
|
||||
private String aptitude;
|
||||
|
||||
@Schema(description = "行业类型(父级)")
|
||||
private String industryParent;
|
||||
|
||||
@Schema(description = "行业类型(子级)")
|
||||
private String industryChild;
|
||||
|
||||
@Schema(description = "头衔")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "安装的产品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer templateId;
|
||||
|
||||
@Schema(description = "插件安装状态(仅对超超管判断) 0未安装 1已安装 ")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer installed;
|
||||
|
||||
@Schema(description = "特长")
|
||||
private String speciality;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0在线, 1离线")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "ShopUsersParam对象", description = "查询参数")
|
||||
public class ShopUsersParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "用户唯一小程序id")
|
||||
private String openId;
|
||||
|
||||
@Schema(description = "小程序用户秘钥")
|
||||
private String sessionKey;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "1男,2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean gender;
|
||||
|
||||
@Schema(description = "国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "积分")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal integral;
|
||||
|
||||
@Schema(description = "余额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
private String idCard;
|
||||
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "是否管理员:1是;2否")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isAdmin;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopUser;
|
||||
import com.gxwebsoft.shop.param.ShopUserParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 13:41:09
|
||||
*/
|
||||
public interface ShopUserService extends IService<ShopUser> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<ShopUser>
|
||||
*/
|
||||
PageResult<ShopUser> pageRel(ShopUserParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<ShopUser>
|
||||
*/
|
||||
List<ShopUser> listRel(ShopUserParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return ShopUser
|
||||
*/
|
||||
ShopUser getByIdRel(Integer userId);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopUsers;
|
||||
import com.gxwebsoft.shop.param.ShopUsersParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
*/
|
||||
public interface ShopUsersService extends IService<ShopUsers> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<ShopUsers>
|
||||
*/
|
||||
PageResult<ShopUsers> pageRel(ShopUsersParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<ShopUsers>
|
||||
*/
|
||||
List<ShopUsers> listRel(ShopUsersParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return ShopUsers
|
||||
*/
|
||||
ShopUsers getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.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.shop.entity.ShopUser;
|
||||
import com.gxwebsoft.shop.mapper.ShopUserMapper;
|
||||
import com.gxwebsoft.shop.param.ShopUserParam;
|
||||
import com.gxwebsoft.shop.service.ShopUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户记录表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-10-03 13:41:09
|
||||
*/
|
||||
@Service
|
||||
public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> implements ShopUserService {
|
||||
|
||||
@Override
|
||||
public PageResult<ShopUser> pageRel(ShopUserParam param) {
|
||||
PageParam<ShopUser, ShopUserParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<ShopUser> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopUser> listRel(ShopUserParam param) {
|
||||
List<ShopUser> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<ShopUser, ShopUserParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopUser getByIdRel(Integer userId) {
|
||||
ShopUserParam param = new ShopUserParam();
|
||||
param.setUserId(userId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.ShopUsersMapper;
|
||||
import com.gxwebsoft.shop.service.ShopUsersService;
|
||||
import com.gxwebsoft.shop.entity.ShopUsers;
|
||||
import com.gxwebsoft.shop.param.ShopUsersParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-11 10:45:13
|
||||
*/
|
||||
@Service
|
||||
public class ShopUsersServiceImpl extends ServiceImpl<ShopUsersMapper, ShopUsers> implements ShopUsersService {
|
||||
|
||||
@Override
|
||||
public PageResult<ShopUsers> pageRel(ShopUsersParam param) {
|
||||
PageParam<ShopUsers, ShopUsersParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<ShopUsers> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopUsers> listRel(ShopUsersParam param) {
|
||||
List<ShopUsers> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<ShopUsers, ShopUsersParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopUsers getByIdRel(Integer id) {
|
||||
ShopUsersParam param = new ShopUsersParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user