package ${classPath};

import com.ag.dynamicmodule.service.BaseMapperRepository;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import ${beanPath};
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* Description:
* Author: ${author}
* Version: ${version}
* Create Date: ${date}
*/
@Service
public class ${className} {
    @Autowired
    SqlSessionTemplate sqlSessionTemplate;
    @Autowired
    private IBaseServiceImpl baseService;

    /**
    * Description: 新增和修改
    * @param ${lowerBeanName}
    * @return
    * Note: Nothing much.
    */
    public void save(${upperBeanName} ${lowerBeanName}){
        baseService.save(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
               "${sqlPath}"));
    }

    /**
    * Description: 新增
    * @param ${lowerBeanName}
    * @return
    * Note: Nothing much.
    */
    public void insert(${upperBeanName} ${lowerBeanName}){
        baseService.insert(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
               "${sqlPath}"));
    }

    /**
    * Description: 修改
    * @param ${lowerBeanName}
    * @return
    * Note: Nothing much.
    */
    public void update(${upperBeanName} ${lowerBeanName}){
        baseService.update(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
               "${sqlPath}"));
    }

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

}