package com.ankaibei.workFlow.webadmin.upms.model;

import com.ankaibei.workFlow.webadmin.upms.model.SysMenu.SysMenuModelMapper;
import com.ankaibei.workFlow.webadmin.upms.vo.SysMenuVo;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2023-05-08T14:15:59+0800",
    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_144 (Oracle Corporation)"
)
public class SysMenu$SysMenuModelMapperImpl implements SysMenuModelMapper {

    @Override
    public List<SysMenuVo> fromModelList(List<SysMenu> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<SysMenuVo> list = new ArrayList<SysMenuVo>( arg0.size() );
        for ( SysMenu sysMenu : arg0 ) {
            list.add( fromModel( sysMenu ) );
        }

        return list;
    }

    @Override
    public List<SysMenu> toModelList(List<SysMenuVo> arg0) {
        if ( arg0 == null ) {
            return null;
        }

        List<SysMenu> list = new ArrayList<SysMenu>( arg0.size() );
        for ( SysMenuVo sysMenuVo : arg0 ) {
            list.add( toModel( sysMenuVo ) );
        }

        return list;
    }

    @Override
    public SysMenu toModel(SysMenuVo sysMenuVo) {
        if ( sysMenuVo == null ) {
            return null;
        }

        SysMenu sysMenu = new SysMenu();

        sysMenu.setMenuId( sysMenuVo.getMenuId() );
        sysMenu.setParentId( sysMenuVo.getParentId() );
        sysMenu.setMenuName( sysMenuVo.getMenuName() );
        sysMenu.setMenuType( sysMenuVo.getMenuType() );
        sysMenu.setFormRouterName( sysMenuVo.getFormRouterName() );
        sysMenu.setOnlineFormId( sysMenuVo.getOnlineFormId() );
        sysMenu.setOnlineMenuPermType( sysMenuVo.getOnlineMenuPermType() );
        sysMenu.setReportPageId( sysMenuVo.getReportPageId() );
        sysMenu.setOnlineFlowEntryId( sysMenuVo.getOnlineFlowEntryId() );
        sysMenu.setShowOrder( sysMenuVo.getShowOrder() );
        sysMenu.setIcon( sysMenuVo.getIcon() );
        sysMenu.setCreateUserId( sysMenuVo.getCreateUserId() );
        sysMenu.setCreateTime( sysMenuVo.getCreateTime() );
        sysMenu.setUpdateUserId( sysMenuVo.getUpdateUserId() );
        sysMenu.setUpdateTime( sysMenuVo.getUpdateTime() );

        sysMenu.setSysMenuPermCodeList( mapToBean(sysMenuVo.getSysMenuPermCodeList(), com.ankaibei.workFlow.webadmin.upms.model.SysMenuPermCode.class) );

        return sysMenu;
    }

    @Override
    public SysMenuVo fromModel(SysMenu sysMenu) {
        if ( sysMenu == null ) {
            return null;
        }

        SysMenuVo sysMenuVo = new SysMenuVo();

        sysMenuVo.setMenuId( sysMenu.getMenuId() );
        sysMenuVo.setParentId( sysMenu.getParentId() );
        sysMenuVo.setMenuName( sysMenu.getMenuName() );
        sysMenuVo.setMenuType( sysMenu.getMenuType() );
        sysMenuVo.setFormRouterName( sysMenu.getFormRouterName() );
        sysMenuVo.setOnlineFormId( sysMenu.getOnlineFormId() );
        sysMenuVo.setOnlineMenuPermType( sysMenu.getOnlineMenuPermType() );
        sysMenuVo.setReportPageId( sysMenu.getReportPageId() );
        sysMenuVo.setOnlineFlowEntryId( sysMenu.getOnlineFlowEntryId() );
        sysMenuVo.setShowOrder( sysMenu.getShowOrder() );
        sysMenuVo.setIcon( sysMenu.getIcon() );
        sysMenuVo.setCreateUserId( sysMenu.getCreateUserId() );
        sysMenuVo.setCreateTime( sysMenu.getCreateTime() );
        sysMenuVo.setUpdateUserId( sysMenu.getUpdateUserId() );
        sysMenuVo.setUpdateTime( sysMenu.getUpdateTime() );

        sysMenuVo.setSysMenuPermCodeList( beanToMap(sysMenu.getSysMenuPermCodeList(), false) );

        return sysMenuVo;
    }
}
