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

import com.ankaibei.workFlow.webadmin.upms.model.SysPost.SysPostModelMapper;
import com.ankaibei.workFlow.webadmin.upms.vo.SysPostVo;
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 SysPost$SysPostModelMapperImpl implements SysPostModelMapper {

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

        List<SysPostVo> list = new ArrayList<SysPostVo>( arg0.size() );
        for ( SysPost sysPost : arg0 ) {
            list.add( fromModel( sysPost ) );
        }

        return list;
    }

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

        List<SysPost> list = new ArrayList<SysPost>( arg0.size() );
        for ( SysPostVo sysPostVo : arg0 ) {
            list.add( toModel( sysPostVo ) );
        }

        return list;
    }

    @Override
    public SysPost toModel(SysPostVo sysPostVo) {
        if ( sysPostVo == null ) {
            return null;
        }

        SysPost sysPost = new SysPost();

        sysPost.setPostId( sysPostVo.getPostId() );
        sysPost.setPostName( sysPostVo.getPostName() );
        sysPost.setPostLevel( sysPostVo.getPostLevel() );
        sysPost.setLeaderPost( sysPostVo.getLeaderPost() );
        sysPost.setCreateUserId( sysPostVo.getCreateUserId() );
        sysPost.setCreateTime( sysPostVo.getCreateTime() );
        sysPost.setUpdateUserId( sysPostVo.getUpdateUserId() );
        sysPost.setUpdateTime( sysPostVo.getUpdateTime() );

        sysPost.setSysDeptPost( mapToBean(sysPostVo.getSysDeptPost(), com.ankaibei.workFlow.webadmin.upms.model.SysDeptPost.class) );

        return sysPost;
    }

    @Override
    public SysPostVo fromModel(SysPost sysPost) {
        if ( sysPost == null ) {
            return null;
        }

        SysPostVo sysPostVo = new SysPostVo();

        sysPostVo.setPostId( sysPost.getPostId() );
        sysPostVo.setPostName( sysPost.getPostName() );
        sysPostVo.setPostLevel( sysPost.getPostLevel() );
        sysPostVo.setLeaderPost( sysPost.getLeaderPost() );
        sysPostVo.setCreateUserId( sysPost.getCreateUserId() );
        sysPostVo.setCreateTime( sysPost.getCreateTime() );
        sysPostVo.setUpdateUserId( sysPost.getUpdateUserId() );
        sysPostVo.setUpdateTime( sysPost.getUpdateTime() );

        sysPostVo.setSysDeptPost( beanToMap(sysPost.getSysDeptPost(), false) );

        return sysPostVo;
    }
}
