package com.ag.dynamicmodule.wbgrid.domain;

import com.ag.dynamicmodule.service.BaseMapperRepository;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.ag.dynamicmodule.wbgrid.pojo.WbResource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* Description:
* Author: wangll
* Version: 1.0
* Create Date: 2020-11-12 11:26:34
*/
@Service
public class WbResourceBO {
    @Autowired
    SqlSessionTemplate sqlSessionTemplate;
    @Autowired
    private IBaseServiceImpl baseService;

    /**
    * Description: 新增和修改
    * @param wbResource
    * @return
    * Note: Nothing much.
    */
    public void save(WbResource wbResource){
        baseService.save(new BaseMapperRepository(wbResource,sqlSessionTemplate,
               "resources/platform/wbgrid.WbResourceMapper"));
    }

    /**
    * Description: 新增
    * @param wbResource
    * @return
    * Note: Nothing much.
    */
    public void insert(WbResource wbResource){
        baseService.insert(new BaseMapperRepository(wbResource,sqlSessionTemplate,
               "resources/platform/wbgrid.WbResourceMapper"));
    }

    /**
    * Description: 修改
    * @param wbResource
    * @return
    * Note: Nothing much.
    */
    public void update(WbResource wbResource){
        baseService.update(new BaseMapperRepository(wbResource,sqlSessionTemplate,
               "resources/platform/wbgrid.WbResourceMapper"));
    }

    /**
    * Description: 删除
    * @param id
    * @return
    * Note: Nothing much.
    */
    public void delete(String id){
        baseService.delete(new BaseMapperRepository(id,sqlSessionTemplate,
               "resources/platform/wbgrid.WbResourceMapper"));
    }

}