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

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.module.system.controller.admin.kstype.vo.KsTypeCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.kstype.vo.KsTypeExcelVO;
import com.jojubanking.boot.module.system.controller.admin.kstype.vo.KsTypeRespVO;
import com.jojubanking.boot.module.system.controller.admin.kstype.vo.KsTypeUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.kstype.KsTypeDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

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

    @Override
    public KsTypeDO convert(KsTypeCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        KsTypeDO ksTypeDO = new KsTypeDO();

        ksTypeDO.setSort( bean.getSort() );
        ksTypeDO.setName( bean.getName() );

        return ksTypeDO;
    }

    @Override
    public KsTypeDO convert(KsTypeUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        KsTypeDO ksTypeDO = new KsTypeDO();

        ksTypeDO.setId( bean.getId() );
        ksTypeDO.setSort( bean.getSort() );
        ksTypeDO.setName( bean.getName() );

        return ksTypeDO;
    }

    @Override
    public KsTypeRespVO convert(KsTypeDO bean) {
        if ( bean == null ) {
            return null;
        }

        KsTypeRespVO ksTypeRespVO = new KsTypeRespVO();

        ksTypeRespVO.setName( bean.getName() );
        ksTypeRespVO.setSort( bean.getSort() );
        ksTypeRespVO.setId( bean.getId() );
        ksTypeRespVO.setCreateTime( bean.getCreateTime() );

        return ksTypeRespVO;
    }

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

        List<KsTypeRespVO> list1 = new ArrayList<KsTypeRespVO>( list.size() );
        for ( KsTypeDO ksTypeDO : list ) {
            list1.add( convert( ksTypeDO ) );
        }

        return list1;
    }

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

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

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

        return pageResult;
    }

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

        List<KsTypeExcelVO> list1 = new ArrayList<KsTypeExcelVO>( list.size() );
        for ( KsTypeDO ksTypeDO : list ) {
            list1.add( ksTypeDOToKsTypeExcelVO( ksTypeDO ) );
        }

        return list1;
    }

    protected KsTypeExcelVO ksTypeDOToKsTypeExcelVO(KsTypeDO ksTypeDO) {
        if ( ksTypeDO == null ) {
            return null;
        }

        KsTypeExcelVO ksTypeExcelVO = new KsTypeExcelVO();

        ksTypeExcelVO.setId( ksTypeDO.getId() );
        ksTypeExcelVO.setName( ksTypeDO.getName() );
        ksTypeExcelVO.setCreateTime( ksTypeDO.getCreateTime() );

        return ksTypeExcelVO;
    }
}
