package com.jojubanking.boot.module.system.convert.building;

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.module.system.controller.admin.building.vo.BuildingCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.building.vo.BuildingExcelVO;
import com.jojubanking.boot.module.system.controller.admin.building.vo.BuildingRespVO;
import com.jojubanking.boot.module.system.controller.admin.building.vo.BuildingSimpleRespVO;
import com.jojubanking.boot.module.system.controller.admin.building.vo.BuildingUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.building.BuildingDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2025-12-05T11:32:08+0800",
    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_201 (Oracle Corporation)"
)
public class BuildingConvertImpl implements BuildingConvert {

    @Override
    public BuildingDO convert(BuildingCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        BuildingDO buildingDO = new BuildingDO();

        buildingDO.setName( bean.getName() );
        buildingDO.setParentId( bean.getParentId() );
        buildingDO.setStatus( bean.getStatus() );
        buildingDO.setFid( bean.getFid() );

        return buildingDO;
    }

    @Override
    public BuildingDO convert(BuildingUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        BuildingDO buildingDO = new BuildingDO();

        buildingDO.setId( bean.getId() );
        buildingDO.setName( bean.getName() );
        buildingDO.setParentId( bean.getParentId() );
        buildingDO.setStatus( bean.getStatus() );
        buildingDO.setFid( bean.getFid() );

        return buildingDO;
    }

    @Override
    public BuildingRespVO convert(BuildingDO bean) {
        if ( bean == null ) {
            return null;
        }

        BuildingRespVO buildingRespVO = new BuildingRespVO();

        buildingRespVO.setName( bean.getName() );
        buildingRespVO.setParentId( bean.getParentId() );
        buildingRespVO.setStatus( bean.getStatus() );
        buildingRespVO.setFid( bean.getFid() );
        buildingRespVO.setId( bean.getId() );
        buildingRespVO.setCreateTime( bean.getCreateTime() );

        return buildingRespVO;
    }

    @Override
    public List<BuildingRespVO> convertList(List<BuildingDO> list) {
        if ( list == null ) {
            return null;
        }

        List<BuildingRespVO> list1 = new ArrayList<BuildingRespVO>( list.size() );
        for ( BuildingDO buildingDO : list ) {
            list1.add( convert( buildingDO ) );
        }

        return list1;
    }

    @Override
    public PageResult<BuildingRespVO> convertPage(PageResult<BuildingDO> page) {
        if ( page == null ) {
            return null;
        }

        PageResult<BuildingRespVO> pageResult = new PageResult<BuildingRespVO>();

        pageResult.setList( convertList( page.getList() ) );
        pageResult.setTotal( page.getTotal() );

        return pageResult;
    }

    @Override
    public List<BuildingExcelVO> convertList02(List<BuildingDO> list) {
        if ( list == null ) {
            return null;
        }

        List<BuildingExcelVO> list1 = new ArrayList<BuildingExcelVO>( list.size() );
        for ( BuildingDO buildingDO : list ) {
            list1.add( buildingDOToBuildingExcelVO( buildingDO ) );
        }

        return list1;
    }

    @Override
    public List<BuildingSimpleRespVO> convertList03(List<BuildingDO> list) {
        if ( list == null ) {
            return null;
        }

        List<BuildingSimpleRespVO> list1 = new ArrayList<BuildingSimpleRespVO>( list.size() );
        for ( BuildingDO buildingDO : list ) {
            list1.add( buildingDOToBuildingSimpleRespVO( buildingDO ) );
        }

        return list1;
    }

    protected BuildingExcelVO buildingDOToBuildingExcelVO(BuildingDO buildingDO) {
        if ( buildingDO == null ) {
            return null;
        }

        BuildingExcelVO buildingExcelVO = new BuildingExcelVO();

        buildingExcelVO.setId( buildingDO.getId() );
        buildingExcelVO.setName( buildingDO.getName() );
        buildingExcelVO.setParentId( buildingDO.getParentId() );
        buildingExcelVO.setStatus( buildingDO.getStatus() );
        buildingExcelVO.setFid( buildingDO.getFid() );
        buildingExcelVO.setCreateTime( buildingDO.getCreateTime() );

        return buildingExcelVO;
    }

    protected BuildingSimpleRespVO buildingDOToBuildingSimpleRespVO(BuildingDO buildingDO) {
        if ( buildingDO == null ) {
            return null;
        }

        BuildingSimpleRespVO buildingSimpleRespVO = new BuildingSimpleRespVO();

        buildingSimpleRespVO.setId( buildingDO.getId() );
        buildingSimpleRespVO.setName( buildingDO.getName() );
        buildingSimpleRespVO.setParentId( buildingDO.getParentId() );

        return buildingSimpleRespVO;
    }
}
