package cn.superdesk.uniorder.dubbo.provider.sys.notify;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.notify.SysNotifyTemplate;
import cn.superdesk.uniorder.dto.param.system.notify.SysNotifyTemplateParam;
import cn.superdesk.uniorder.dubbo.facade.sys.notify.DubboSysNotifyTemplateService;
import cn.superdesk.uniorder.service.sys.notify.SysNotifyTemplateService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

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

/**
 * @Description:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2021-03-01 17:37:17
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-03-01 17:37:17
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysNotifyTemplateServiceImpl implements DubboSysNotifyTemplateService {

	@Autowired
	private SysNotifyTemplateService sysNotifyTemplateService;


	/****************************************** extends BaseService 部分 start ******************************************/

	@Override
	public void addObj(SysNotifyTemplateParam param) {

		SysNotifyTemplate sysNotifyTemplate = AnBeanUtils.copy(param, SysNotifyTemplate.class);
		sysNotifyTemplateService.insertSelective(sysNotifyTemplate);

	}

	@Override
	public void updateObj(SysNotifyTemplateParam param) {

		SysNotifyTemplate sysNotifyTemplate = AnBeanUtils.copy(param, SysNotifyTemplate.class);
		sysNotifyTemplateService.updateByPrimaryKeySelective(sysNotifyTemplate);
	}

	@Override
	public void deleteObj(Long id) {
		sysNotifyTemplateService.deleteObj(id);
	}

	@Override
	public SysNotifyTemplate findById(Long id) {
		return sysNotifyTemplateService.findById(id);
	}

	@Override
	public PageInfo<SysNotifyTemplate> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return sysNotifyTemplateService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<SysNotifyTemplate> findAll(Map<String, Object> queryMap) {

		return sysNotifyTemplateService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	@Override
	public void addSysNotifyTemplate(SysNotifyTemplateParam param) {

		SysNotifyTemplate sysNotifyTemplate = AnBeanUtils.copy(param, SysNotifyTemplate.class);
		sysNotifyTemplateService.addSysNotifyTemplate(sysNotifyTemplate);
	}

	@Override
	public void updateSysNotifyTemplate(SysNotifyTemplateParam param) {

		SysNotifyTemplate sysNotifyTemplate = AnBeanUtils.copy(param, SysNotifyTemplate.class);
		sysNotifyTemplateService.updateSysNotifyTemplate(sysNotifyTemplate);
	}

	@Override
	public void deleteSysNotifyTemplate(Long id) {
		sysNotifyTemplateService.deleteSysNotifyTemplate(id);
	}

	@Override
	public SysNotifyTemplate findSysNotifyTemplateById(Long id) {
		return sysNotifyTemplateService.findSysNotifyTemplateById(id);
	}

	@Override
	public R<List<SysNotifyTemplate>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return sysNotifyTemplateService.pageQuery(conditions, pageNun, pageSize);

	}
}
