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.SysRoleExtData;
import cn.superdesk.uniorder.dto.dubbo.sys.role.SysRoleExtDataParam;
import cn.superdesk.uniorder.dubbo.facade.sys.role.DubboSysRoleExtDataService;
import cn.superdesk.uniorder.service.sys.role.SysRoleExtDataService;
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 DubboSysRoleExtDataServiceImpl implements DubboSysRoleExtDataService {

	@Autowired
	private SysRoleExtDataService sysRoleExtDataService;


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

	@Override
	public void addObj(SysRoleExtDataParam param) {

		SysRoleExtData sysRoleExtData = AnBeanUtils.copy(param, SysRoleExtData.class);
		sysRoleExtDataService.insertSelective(sysRoleExtData);

	}

	@Override
	public void updateObj(SysRoleExtDataParam param) {

		SysRoleExtData sysRoleExtData = AnBeanUtils.copy(param, SysRoleExtData.class);
		sysRoleExtDataService.updateByPrimaryKeySelective(sysRoleExtData);
	}

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

	@Override
	public SysRoleExtData findById(Long id) {
		return sysRoleExtDataService.findById(id);
	}

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

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

		return sysRoleExtDataService.findAll(queryMap);
	}

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


	@Override
	public void addSysRoleExtData(SysRoleExtDataParam param) {

		SysRoleExtData sysRoleExtData = AnBeanUtils.copy(param, SysRoleExtData.class);
		sysRoleExtDataService.addSysRoleExtData(sysRoleExtData);
	}

	@Override
	public void updateSysRoleExtData(SysRoleExtDataParam param) {

		SysRoleExtData sysRoleExtData = AnBeanUtils.copy(param, SysRoleExtData.class);
		sysRoleExtDataService.updateSysRoleExtData(sysRoleExtData);
	}

	@Override
	public void deleteSysRoleExtData(Long id) {
		sysRoleExtDataService.deleteSysRoleExtData(id);
	}

	@Override
	public SysRoleExtData findSysRoleExtDataById(Long id) {
		return sysRoleExtDataService.findSysRoleExtDataById(id);
	}

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

	}
}
