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.AInnovation;
import com.zksy.property.service.AInnovationService;
import com.zksy.property.mapper.AInnovationMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【a_innovation(创新创业收入情况表)】的数据库操作Service实现
* @createDate 2025-06-30 09:02:34
*/
@Service
public class AInnovationServiceImpl extends ServiceImpl<AInnovationMapper, AInnovation>
    implements AInnovationService{

    @Override
    public Page<AInnovation> findByPage(long pageNum, long pageSize, String receiptNumber, String building, String roomNumber) {
        Page<AInnovation> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<AInnovation> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(receiptNumber != null,AInnovation::getReceiptNumber,receiptNumber);
        queryWrapper.like(building != null,AInnovation::getBuilding,building);
        queryWrapper.like(roomNumber != null,AInnovation::getRoomNumber,roomNumber);
        queryWrapper.orderByDesc(AInnovation::getUpdateTime);
        Page<AInnovation> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<AInnovation> getAInnovationList(String receiptNumber, String building, String roomNumber) {
        LambdaQueryWrapper<AInnovation> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(receiptNumber != null,AInnovation::getReceiptNumber,receiptNumber);
        queryWrapper.like(building != null,AInnovation::getBuilding,building);
        queryWrapper.like(roomNumber != null,AInnovation::getRoomNumber,roomNumber);
        queryWrapper.orderByDesc(AInnovation::getUpdateTime);
        return this.list(queryWrapper);
    }
}




