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

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample;
import cn.superdesk.uniorder.dto.dubbo.sys.role.SysRoleExtDataSampleParam;
import cn.superdesk.uniorder.dubbo.facade.sys.role.DubboSysRoleExtDataSampleService;
import cn.superdesk.uniorder.service.sys.role.SysRoleExtDataSampleService;
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:     2020-08-26 14:15:28
 * @UpdateUser:     linjinyu
 * @UpdateDate:     2020-08-26 14:15:28
 * @UpdateRemark:   修改内容
 * @Version:        1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysRoleExtDataSampleServiceImpl implements DubboSysRoleExtDataSampleService {

	@Autowired
	private SysRoleExtDataSampleService sysRoleExtDataSampleService;


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

	@Override
	public void addObj(SysRoleExtDataSampleParam param) {

		SysRoleExtDataSample sysRoleExtDataSample = AnBeanUtils.copy(param, SysRoleExtDataSample.class);
		sysRoleExtDataSampleService.insertSelective(sysRoleExtDataSample);

	}

	@Override
	public void updateObj(SysRoleExtDataSampleParam param) {

		SysRoleExtDataSample sysRoleExtDataSample = AnBeanUtils.copy(param, SysRoleExtDataSample.class);
		sysRoleExtDataSampleService.updateByPrimaryKeySelective(sysRoleExtDataSample);
	}

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

	@Override
	public SysRoleExtDataSample findById(Long id) {
		return sysRoleExtDataSampleService.findById(id);
	}

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

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

		return sysRoleExtDataSampleService.findAll(queryMap);
	}

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


	@Override
	public void addSysRoleExtDataSample(SysRoleExtDataSampleParam param) {

		SysRoleExtDataSample sysRoleExtDataSample = AnBeanUtils.copy(param, SysRoleExtDataSample.class);
		sysRoleExtDataSampleService.addSysRoleExtDataSample(sysRoleExtDataSample);
	}

	@Override
	public void updateSysRoleExtDataSample(SysRoleExtDataSampleParam param) {

		SysRoleExtDataSample sysRoleExtDataSample = AnBeanUtils.copy(param, SysRoleExtDataSample.class);
		sysRoleExtDataSampleService.updateSysRoleExtDataSample(sysRoleExtDataSample);
	}

	@Override
	public void deleteSysRoleExtDataSample(Long id) {
		sysRoleExtDataSampleService.deleteSysRoleExtDataSample(id);
	}

	@Override
	public SysRoleExtDataSample findSysRoleExtDataSampleById(Long id) {
		return sysRoleExtDataSampleService.findSysRoleExtDataSampleById(id);
	}

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

	}
}
