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

import com.ankaibei.workFlow.webadmin.upms.model.SysDataPerm.SysDataPermModelMapper;
import com.ankaibei.workFlow.webadmin.upms.vo.SysDataPermVo;
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 SysDataPerm$SysDataPermModelMapperImpl implements SysDataPermModelMapper {

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

        List<SysDataPermVo> list = new ArrayList<SysDataPermVo>( arg0.size() );
        for ( SysDataPerm sysDataPerm : arg0 ) {
            list.add( fromModel( sysDataPerm ) );
        }

        return list;
    }

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

        List<SysDataPerm> list = new ArrayList<SysDataPerm>( arg0.size() );
        for ( SysDataPermVo sysDataPermVo : arg0 ) {
            list.add( toModel( sysDataPermVo ) );
        }

        return list;
    }

    @Override
    public SysDataPerm toModel(SysDataPermVo sysDataPermVo) {
        if ( sysDataPermVo == null ) {
            return null;
        }

        SysDataPerm sysDataPerm = new SysDataPerm();

        sysDataPerm.setDataPermId( sysDataPermVo.getDataPermId() );
        sysDataPerm.setDataPermName( sysDataPermVo.getDataPermName() );
        sysDataPerm.setRuleType( sysDataPermVo.getRuleType() );
        sysDataPerm.setCreateUserId( sysDataPermVo.getCreateUserId() );
        sysDataPerm.setCreateTime( sysDataPermVo.getCreateTime() );
        sysDataPerm.setUpdateUserId( sysDataPermVo.getUpdateUserId() );
        sysDataPerm.setUpdateTime( sysDataPermVo.getUpdateTime() );
        sysDataPerm.setDeptIdListString( sysDataPermVo.getDeptIdListString() );

        sysDataPerm.setDataPermDeptList( mapToBean(sysDataPermVo.getDataPermDeptList(), com.ankaibei.workFlow.webadmin.upms.model.SysDataPermDept.class) );
        sysDataPerm.setDataPermMenuList( mapToBean(sysDataPermVo.getDataPermMenuList(), com.ankaibei.workFlow.webadmin.upms.model.SysDataPermMenu.class) );

        return sysDataPerm;
    }

    @Override
    public SysDataPermVo fromModel(SysDataPerm sysDataPerm) {
        if ( sysDataPerm == null ) {
            return null;
        }

        SysDataPermVo sysDataPermVo = new SysDataPermVo();

        sysDataPermVo.setDataPermId( sysDataPerm.getDataPermId() );
        sysDataPermVo.setDataPermName( sysDataPerm.getDataPermName() );
        sysDataPermVo.setRuleType( sysDataPerm.getRuleType() );
        sysDataPermVo.setDeptIdListString( sysDataPerm.getDeptIdListString() );
        sysDataPermVo.setCreateUserId( sysDataPerm.getCreateUserId() );
        sysDataPermVo.setCreateTime( sysDataPerm.getCreateTime() );
        sysDataPermVo.setUpdateUserId( sysDataPerm.getUpdateUserId() );
        sysDataPermVo.setUpdateTime( sysDataPerm.getUpdateTime() );

        sysDataPermVo.setDataPermDeptList( beanToMap(sysDataPerm.getDataPermDeptList(), false) );
        sysDataPermVo.setDataPermMenuList( beanToMap(sysDataPerm.getDataPermMenuList(), false) );

        return sysDataPermVo;
    }
}
