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.AAssetManagement;
import com.zksy.property.service.AAssetManagementService;
import com.zksy.property.mapper.AAssetManagementMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【a_asset_management(资产信息管理表)】的数据库操作Service实现
* @createDate 2025-06-30 11:03:58
*/
@Service
public class AAssetManagementServiceImpl extends ServiceImpl<AAssetManagementMapper, AAssetManagement>
    implements AAssetManagementService{

    @Override
    public Page<AAssetManagement> findByPage(long pageNum, long pageSize, String aassetCode, String aassetName, String aassetType) {
        Page<AAssetManagement> page = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<AAssetManagement> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(aassetCode != null,AAssetManagement::getAssetCode,aassetCode);
        queryWrapper.like(aassetName != null,AAssetManagement::getAssetName,aassetName);
        queryWrapper.like(aassetType != null,AAssetManagement::getAssetType,aassetType);
        Page<AAssetManagement> page1 = this.page(page, queryWrapper);
        return page1;
    }

    @Override
    public List<AAssetManagement> getAAssetManagementList(String aassetCode, String aassetName, String aassetType) {
        LambdaQueryWrapper<AAssetManagement> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.like(aassetCode != null,AAssetManagement::getAssetCode,aassetCode);
        queryWrapper.like(aassetName != null,AAssetManagement::getAssetName,aassetName);
        queryWrapper.like(aassetType != null,AAssetManagement::getAssetType,aassetType);
        List<AAssetManagement> list = this.list(queryWrapper);
        return list;
    }
}




