package com.steerinfo.ems.tmcdocdirectory.service.impl;

import com.steerinfo.ems.tmcdocdirectory.mapper.TMcDocdirectoryMapper;
import com.steerinfo.ems.tmcdocdirectory.model.TMcDocdirectory;
import com.steerinfo.ems.tmcdocdirectory.service.ITMcDocdirectoryService;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * TMcDocdirectory服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2019-10-30 10:40
 * 类描述
 * 修订历史：
 * 日期：2019-10-30
 * 作者：generator
 * 参考：
 * 描述：TMcDocdirectory服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "tMcDocdirectoryService")
public class TMcDocdirectoryServiceImpl extends BaseServiceImpl<TMcDocdirectory, String> implements ITMcDocdirectoryService {

    @Autowired
    private TMcDocdirectoryMapper tMcDocdirectoryMapper;

    @Override
    protected IBaseMapper<TMcDocdirectory, String> getMapper() {
        return tMcDocdirectoryMapper;
    }

    public List<TMcDocdirectory> getTree(){
        List<TMcDocdirectory> rows = tMcDocdirectoryMapper.getTree();
        return rows;
    }

    public TMcDocdirectory update(Map<String, Object> parameters){
        this.tMcDocdirectoryMapper.update(parameters);
        return this.tMcDocdirectoryMapper.selectByPrimaryKey(parameters.get("newcode").toString());
    }
}
