|
|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
package com.zbkj.modules.autogencode.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.zbkj.common.request.PageParamRequest;
|
|
|
|
|
@ -8,31 +11,21 @@ import com.zbkj.common.page.CommonPage;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.zbkj.modules.autogencode.entity.PmOwnerHouseRel;
|
|
|
|
|
import com.zbkj.modules.autogencode.service.PmOwnerHouseRelService;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 业主房屋关联表 控制器
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | Author: 大粽子
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | @date Thu Oct 09 15:29:10 CST 2025
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
* | @date stivepeim@outlook.com
|
|
|
|
|
* +----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("api/autogencode/pmownerhouserel")
|
|
|
|
|
@ -43,10 +36,95 @@ public class PmOwnerHouseRelController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页显示业主房屋关联列表
|
|
|
|
|
* 条件设置
|
|
|
|
|
* 根据实体类字段自动生成查询条件
|
|
|
|
|
*/
|
|
|
|
|
private void condition(LambdaQueryWrapper<PmOwnerHouseRel> queryWrapper, PmOwnerHouseRel request) {
|
|
|
|
|
if (request == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据实体类字段自动生成查询条件
|
|
|
|
|
|
|
|
|
|
// id
|
|
|
|
|
if (request.getId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getId, request.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 业主id
|
|
|
|
|
if (request.getOwnerId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getOwnerId, request.getOwnerId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 房屋id
|
|
|
|
|
if (request.getHouseId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getHouseId, request.getHouseId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 关联类型
|
|
|
|
|
if (StrUtil.isNotBlank(request.getRelType())) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getRelType, request.getRelType());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 绑定时间
|
|
|
|
|
if (request.getBindTime() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getBindTime, request.getBindTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解绑时间
|
|
|
|
|
if (request.getUnbindTime() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getUnbindTime, request.getUnbindTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 备注
|
|
|
|
|
if (StrUtil.isNotBlank(request.getRemark())) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getRemark, request.getRemark());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除标志(0代表存在 2代表删除)
|
|
|
|
|
if (StrUtil.isNotBlank(request.getDelFlag())) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getDelFlag, request.getDelFlag());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建部门
|
|
|
|
|
if (request.getCreateDept() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getCreateDept, request.getCreateDept());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建人
|
|
|
|
|
if (request.getCreateBy() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getCreateBy, request.getCreateBy());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建时间
|
|
|
|
|
if (request.getCreateTime() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getCreateTime, request.getCreateTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改人
|
|
|
|
|
if (request.getUpdateBy() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getUpdateBy, request.getUpdateBy());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改时间
|
|
|
|
|
if (request.getUpdateTime() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getUpdateTime, request.getUpdateTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 租户ID
|
|
|
|
|
if (StrUtil.isNotBlank(request.getTenantId())) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getTenantId, request.getTenantId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页显示业主房屋关联表
|
|
|
|
|
* @param request 搜索条件
|
|
|
|
|
* @param pageParamRequest 分页参数
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "分页列表")
|
|
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
|
|
public CommonResult<CommonPage<PmOwnerHouseRel>> getList(@Validated PmOwnerHouseRel request, @Validated PageParamRequest pageParamRequest) {
|
|
|
|
|
LambdaQueryWrapper<PmOwnerHouseRel> queryWrapper = new LambdaQueryWrapper();
|
|
|
|
|
@ -54,16 +132,15 @@ public class PmOwnerHouseRelController {
|
|
|
|
|
// 应用搜索条件
|
|
|
|
|
condition(queryWrapper, request);
|
|
|
|
|
|
|
|
|
|
CommonPage<PmOwnerHouseRel> storeProductRuleCommonPage =
|
|
|
|
|
CommonPage.restPage(pmOwnerHouseRelService.pageList(queryWrapper, pageParamRequest));
|
|
|
|
|
return CommonResult.success(storeProductRuleCommonPage);
|
|
|
|
|
CommonPage<PmOwnerHouseRel> page = CommonPage.restPage(pmOwnerHouseRelService.pageList(queryWrapper, pageParamRequest));
|
|
|
|
|
return CommonResult.success(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 详情数据
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/info/{id}")
|
|
|
|
|
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
|
|
|
|
public CommonResult<PmOwnerHouseRel> info(@PathVariable("id") Long id){
|
|
|
|
|
PmOwnerHouseRel pmOwnerHouseRel = pmOwnerHouseRelService.getById(id);
|
|
|
|
|
|
|
|
|
|
@ -84,7 +161,7 @@ public class PmOwnerHouseRelController {
|
|
|
|
|
/**
|
|
|
|
|
* 修改数据
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/update")
|
|
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
|
|
public CommonResult<String> update(@RequestBody PmOwnerHouseRel pmOwnerHouseRel){
|
|
|
|
|
if (pmOwnerHouseRelService.updateById(pmOwnerHouseRel)) {
|
|
|
|
|
return CommonResult.success();
|
|
|
|
|
@ -95,7 +172,7 @@ public class PmOwnerHouseRelController {
|
|
|
|
|
/**
|
|
|
|
|
* 删除:根据id集合
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/delete")
|
|
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
|
|
public CommonResult<String> delete(@RequestBody Long[] ids){
|
|
|
|
|
if (pmOwnerHouseRelService.removeByIds(Arrays.asList(ids))) {
|
|
|
|
|
return CommonResult.success();
|
|
|
|
|
@ -103,26 +180,4 @@ public class PmOwnerHouseRelController {
|
|
|
|
|
return CommonResult.failed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 条件设置
|
|
|
|
|
*/
|
|
|
|
|
private void condition(LambdaQueryWrapper<PmOwnerHouseRel> queryWrapper, PmOwnerHouseRel request) {
|
|
|
|
|
if (request.getId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getId, request.getId());
|
|
|
|
|
}
|
|
|
|
|
if (request.getOwnerId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getOwnerId, request.getOwnerId());
|
|
|
|
|
}
|
|
|
|
|
if (request.getHouseId() != null) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getHouseId, request.getHouseId());
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotBlank(request.getRelType())) {
|
|
|
|
|
queryWrapper.eq(PmOwnerHouseRel::getRelType, request.getRelType());
|
|
|
|
|
}
|
|
|
|
|
// 按创建时间降序排序
|
|
|
|
|
queryWrapper.orderByDesc(PmOwnerHouseRel::getCreateTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|