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

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.module.system.controller.admin.hospital.vo.HospitalCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.hospital.vo.HospitalExcelVO;
import com.jojubanking.boot.module.system.controller.admin.hospital.vo.HospitalRespVO;
import com.jojubanking.boot.module.system.controller.admin.hospital.vo.HospitalUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.hospital.HospitalDO;
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 HospitalConvertImpl implements HospitalConvert {

    @Override
    public HospitalDO convert(HospitalCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        HospitalDO hospitalDO = new HospitalDO();

        hospitalDO.setName( bean.getName() );
        hospitalDO.setLogo( bean.getLogo() );
        hospitalDO.setLabel( bean.getLabel() );
        hospitalDO.setTel( bean.getTel() );
        hospitalDO.setAddress( bean.getAddress() );
        hospitalDO.setContent( bean.getContent() );
        hospitalDO.setImg( bean.getImg() );

        return hospitalDO;
    }

    @Override
    public HospitalDO convert(HospitalUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        HospitalDO hospitalDO = new HospitalDO();

        hospitalDO.setId( bean.getId() );
        hospitalDO.setName( bean.getName() );
        hospitalDO.setLogo( bean.getLogo() );
        hospitalDO.setLabel( bean.getLabel() );
        hospitalDO.setTel( bean.getTel() );
        hospitalDO.setAddress( bean.getAddress() );
        hospitalDO.setContent( bean.getContent() );
        hospitalDO.setImg( bean.getImg() );

        return hospitalDO;
    }

    @Override
    public HospitalRespVO convert(HospitalDO bean) {
        if ( bean == null ) {
            return null;
        }

        HospitalRespVO hospitalRespVO = new HospitalRespVO();

        hospitalRespVO.setName( bean.getName() );
        hospitalRespVO.setLogo( bean.getLogo() );
        hospitalRespVO.setLabel( bean.getLabel() );
        hospitalRespVO.setTel( bean.getTel() );
        hospitalRespVO.setAddress( bean.getAddress() );
        hospitalRespVO.setContent( bean.getContent() );
        hospitalRespVO.setImg( bean.getImg() );
        hospitalRespVO.setId( bean.getId() );
        hospitalRespVO.setCreateTime( bean.getCreateTime() );

        return hospitalRespVO;
    }

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

        List<HospitalRespVO> list1 = new ArrayList<HospitalRespVO>( list.size() );
        for ( HospitalDO hospitalDO : list ) {
            list1.add( convert( hospitalDO ) );
        }

        return list1;
    }

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

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

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

        return pageResult;
    }

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

        List<HospitalExcelVO> list1 = new ArrayList<HospitalExcelVO>( list.size() );
        for ( HospitalDO hospitalDO : list ) {
            list1.add( hospitalDOToHospitalExcelVO( hospitalDO ) );
        }

        return list1;
    }

    protected HospitalExcelVO hospitalDOToHospitalExcelVO(HospitalDO hospitalDO) {
        if ( hospitalDO == null ) {
            return null;
        }

        HospitalExcelVO hospitalExcelVO = new HospitalExcelVO();

        hospitalExcelVO.setId( hospitalDO.getId() );
        hospitalExcelVO.setName( hospitalDO.getName() );
        hospitalExcelVO.setLogo( hospitalDO.getLogo() );
        hospitalExcelVO.setLabel( hospitalDO.getLabel() );
        hospitalExcelVO.setTel( hospitalDO.getTel() );
        hospitalExcelVO.setAddress( hospitalDO.getAddress() );
        hospitalExcelVO.setContent( hospitalDO.getContent() );
        hospitalExcelVO.setImg( hospitalDO.getImg() );
        hospitalExcelVO.setCreateTime( hospitalDO.getCreateTime() );

        return hospitalExcelVO;
    }
}
