package com.zcloud.primeport.gatewayimpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
import com.zcloud.primeport.domain.gateway.XgfApplyPersonGateway;
import com.zcloud.primeport.domain.model.PersonApplyE;
import com.zcloud.primeport.domain.model.XgfApplyPersonE;
import com.zcloud.primeport.persistence.dataobject.PersonApplyDO;
import com.zcloud.primeport.persistence.dataobject.XgfApplyPersonDO;
import com.zcloud.primeport.persistence.mapper.XgfApplyPersonMapper;
import com.zcloud.primeport.persistence.repository.PersonApplyRepository;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * web-infrastructure
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:22
 */
@Service
@AllArgsConstructor
public class XgfApplyPersonGatewayImpl implements XgfApplyPersonGateway {
    private final XgfApplyPersonMapper xgfApplyPersonMapper;

    @Override
    public void save(XgfApplyPersonE build) {
        XgfApplyPersonDO d = new XgfApplyPersonDO();
        BeanUtils.copyProperties(build, d);
        xgfApplyPersonMapper.insert(d);
        build.setId(d.getId());
    }

    @Override
    public XgfApplyPersonE getInfoById(Long id) {
        XgfApplyPersonDO xgfApplyPersonDO = xgfApplyPersonMapper.selectById(id);
        XgfApplyPersonE d = new XgfApplyPersonE();
        BeanUtils.copyProperties(xgfApplyPersonDO, d);
        return d;
    }

    @Override
    public void update(XgfApplyPersonE xgfApplyPersonE) {
        XgfApplyPersonDO d = new XgfApplyPersonDO();
        BeanUtils.copyProperties(xgfApplyPersonE, d);
        xgfApplyPersonMapper.updateById(d);
    }

}

