package com.zksy.property.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zksy.property.domain.ATenantManagement;
import com.zksy.property.service.ATenantManagementService;
import com.zksy.property.mapper.ATenantManagementMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【a_tenant_management(租户信息管理表)】的数据库操作Service实现
* @createDate 2025-06-30 16:03:51
*/
@Service
public class ATenantManagementServiceImpl extends ServiceImpl<ATenantManagementMapper, ATenantManagement>
    implements ATenantManagementService{

    @Override
    public Page<ATenantManagement> findByPage(long pageNum, long pageSize, String personalName, String companyName, String tenantStatus) {
        Page<ATenantManagement> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<ATenantManagement> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(personalName != null,ATenantManagement::getPersonalName,personalName);
        queryWrapper.like(companyName != null,ATenantManagement::getCompanyName,companyName);
        queryWrapper.like(tenantStatus != null,ATenantManagement::getTenantStatus,tenantStatus);
        Page<ATenantManagement> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<ATenantManagement> getATenantManagementList(String personalName, String companyName, String tenantStatus) {
        LambdaQueryWrapper<ATenantManagement> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(personalName != null,ATenantManagement::getPersonalName,personalName);
        queryWrapper.like(companyName != null,ATenantManagement::getCompanyName,companyName);
        queryWrapper.like(tenantStatus != null,ATenantManagement::getTenantStatus,tenantStatus);
        List<ATenantManagement> list = this.list(queryWrapper);
        return list;
    }
}




