package com.bzd.system.service;

import com.bzd.common.config.dao.DaoBase;
import com.bzd.common.config.dao.DaoSupport;
import com.bzd.common.config.dao.PageData;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ServerService {

    @Autowired
    private DaoBase dao;

    @Resource(name = "daoSupport")
    private DaoSupport daoSupport;

    /*
    列表
    */
   public List<PageData> find(final PageData pd) throws Exception {
        return (List<PageData>) daoSupport.findForList("ServerMapper.selectServerList", pd);
    }

    public Integer save(final PageData pd) throws Exception {
        return daoSupport.save("ServerMapper.insertServer", pd);
    }

    public Integer del(PageData pd) throws Exception {
        return daoSupport.delete("ServerMapper.deleteServer", pd);
    }

    public Integer update(PageData pd) throws Exception {
        return daoSupport.delete("ServerMapper.updateServer", pd);
    }
}
