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

import com.ankaibei.workFlow.webadmin.upms.model.SysUser.SysUserModelMapper;
import com.ankaibei.workFlow.webadmin.upms.vo.SysUserVo;
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 SysUser$SysUserModelMapperImpl implements SysUserModelMapper {

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

        List<SysUserVo> list = new ArrayList<SysUserVo>( arg0.size() );
        for ( SysUser sysUser : arg0 ) {
            list.add( fromModel( sysUser ) );
        }

        return list;
    }

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

        List<SysUser> list = new ArrayList<SysUser>( arg0.size() );
        for ( SysUserVo sysUserVo : arg0 ) {
            list.add( toModel( sysUserVo ) );
        }

        return list;
    }

    @Override
    public SysUser toModel(SysUserVo sysUserVo) {
        if ( sysUserVo == null ) {
            return null;
        }

        SysUser sysUser = new SysUser();

        sysUser.setUserId( sysUserVo.getUserId() );
        sysUser.setLoginName( sysUserVo.getLoginName() );
        sysUser.setShowName( sysUserVo.getShowName() );
        sysUser.setDeptId( sysUserVo.getDeptId() );
        sysUser.setUserType( sysUserVo.getUserType() );
        sysUser.setHeadImageUrl( sysUserVo.getHeadImageUrl() );
        sysUser.setUserStatus( sysUserVo.getUserStatus() );
        sysUser.setEmail( sysUserVo.getEmail() );
        sysUser.setMobile( sysUserVo.getMobile() );
        sysUser.setCreateUserId( sysUserVo.getCreateUserId() );
        sysUser.setUpdateUserId( sysUserVo.getUpdateUserId() );
        sysUser.setCreateTime( sysUserVo.getCreateTime() );
        sysUser.setUpdateTime( sysUserVo.getUpdateTime() );
        sysUser.setRegion( sysUserVo.getRegion() );
        sysUser.setJobNumber( sysUserVo.getJobNumber() );
        sysUser.setDeptIdDictMap( mapToMap( sysUserVo.getDeptIdDictMap() ) );
        sysUser.setUserTypeDictMap( mapToMap( sysUserVo.getUserTypeDictMap() ) );
        sysUser.setUserStatusDictMap( mapToMap( sysUserVo.getUserStatusDictMap() ) );

        sysUser.setSysUserRoleList( mapToBean(sysUserVo.getSysUserRoleList(), com.ankaibei.workFlow.webadmin.upms.model.SysUserRole.class) );
        sysUser.setSysUserPostList( mapToBean(sysUserVo.getSysUserPostList(), com.ankaibei.workFlow.webadmin.upms.model.SysUserPost.class) );
        sysUser.setSysDataPermUserList( mapToBean(sysUserVo.getSysDataPermUserList(), com.ankaibei.workFlow.webadmin.upms.model.SysDataPermUser.class) );

        return sysUser;
    }

    @Override
    public SysUserVo fromModel(SysUser sysUser) {
        if ( sysUser == null ) {
            return null;
        }

        SysUserVo sysUserVo = new SysUserVo();

        sysUserVo.setUserId( sysUser.getUserId() );
        sysUserVo.setLoginName( sysUser.getLoginName() );
        sysUserVo.setShowName( sysUser.getShowName() );
        sysUserVo.setDeptId( sysUser.getDeptId() );
        sysUserVo.setUserType( sysUser.getUserType() );
        sysUserVo.setHeadImageUrl( sysUser.getHeadImageUrl() );
        sysUserVo.setUserStatus( sysUser.getUserStatus() );
        sysUserVo.setEmail( sysUser.getEmail() );
        sysUserVo.setMobile( sysUser.getMobile() );
        sysUserVo.setRegion( sysUser.getRegion() );
        sysUserVo.setJobNumber( sysUser.getJobNumber() );
        sysUserVo.setCreateUserId( sysUser.getCreateUserId() );
        sysUserVo.setUpdateUserId( sysUser.getUpdateUserId() );
        sysUserVo.setCreateTime( sysUser.getCreateTime() );
        sysUserVo.setUpdateTime( sysUser.getUpdateTime() );
        sysUserVo.setDeptIdDictMap( mapToMap( sysUser.getDeptIdDictMap() ) );
        sysUserVo.setUserTypeDictMap( mapToMap( sysUser.getUserTypeDictMap() ) );
        sysUserVo.setUserStatusDictMap( mapToMap( sysUser.getUserStatusDictMap() ) );

        sysUserVo.setSysUserRoleList( beanToMap(sysUser.getSysUserRoleList(), false) );
        sysUserVo.setSysUserPostList( beanToMap(sysUser.getSysUserPostList(), false) );
        sysUserVo.setSysDataPermUserList( beanToMap(sysUser.getSysDataPermUserList(), false) );

        return sysUserVo;
    }
}
