package com.xunhong.erp.turbo.biz.app.executor.query;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunhong.erp.turbo.api.biz.dto.qry.CompanyPaymentAccountPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.CompanyPaymentAccountVO;
import com.xunhong.erp.turbo.biz.app.assembler.CompanyPaymentAccountAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.CompanyPaymentAccount;
import com.xunhong.erp.turbo.biz.domain.gateway.CompanyPaymentAccountGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class CompanyPaymentAccountPageQryExe {

	private final CompanyPaymentAccountGateway companyPaymentAccountGateway;
	private final CompanyPaymentAccountAssembler companyPaymentAccountAssembler;

	public IPage<CompanyPaymentAccountVO> execute(CompanyPaymentAccountPageQry companyPaymentAccountPageQry) {
		IPage<CompanyPaymentAccount> page = companyPaymentAccountGateway.page(companyPaymentAccountPageQry);
		return page.convert(companyPaymentAccountAssembler::toCompanyPaymentAccountVO);
	}
}

