package com.goldenwater.slaj.hidd.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.goldenwater.slaj.hidd.mapper.ObjHiddMapper;
import com.goldenwater.slaj.hidd.domain.ObjHidd;
import com.goldenwater.slaj.hidd.domain.ObjHiddVo;
import com.goldenwater.slaj.hidd.service.IObjHiddService;

/**
 * 隐患对象 服务层实现
 */
@Service
public class ObjHiddServiceImpl implements IObjHiddService {

    @Autowired
    private ObjHiddMapper objHiddMapper;

    @Override
    public ObjHidd selectObjHiddByGuid(String guid) {
        return objHiddMapper.selectObjHiddByGuid(guid);
    }

    @Override
    public List<ObjHiddVo> selectObjHiddList(ObjHidd objHidd) {
        return objHiddMapper.selectObjHiddList(objHidd);
    }

    @Override
    public int insertObjHidd(ObjHidd objHidd) {
        return objHiddMapper.insertObjHidd(objHidd);
    }

    @Override
    public int updateObjHidd(ObjHidd objHidd) {
        return objHiddMapper.updateObjHidd(objHidd);
    }

    @Override
    public int deleteObjHiddByGuid(String guid) {
        return objHiddMapper.deleteObjHiddByGuid(guid);
    }

    @Override
    public int deleteObjHiddByGuids(String[] guids) {
        return objHiddMapper.deleteObjHiddByGuids(guids);
    }

    @Override
    public List<ObjHiddVo> selectObjHiddListByName(ObjHidd objHidd) {
        return objHiddMapper.selectObjHiddListByName(objHidd);
    }

    @Override
    public List<ObjHiddVo> selectNextDepHiddList(ObjHidd objHidd) {
        return objHiddMapper.selectNextDepHiddList(objHidd);
    }

    @Override
    public int insertNextHidd(ObjHidd objHidd) {
        return objHiddMapper.insertNextHidd(objHidd);
    }

    @Override
    public List<Map<String, Object>> selectFastRepTreeData(String parentGuid) {
        List<Map<String, Object>> tree = new ArrayList<>();
        // 构建树形数据
        Map<String, Object> node = new HashMap<>();
        node.put("id", "root");
        node.put("label", "全部");
        node.put("children", new ArrayList<>());
        tree.add(node);
        return tree;
    }
}
