package xiaoqu.home.open.service.db2.impl;

import xiaoqu.home.open.model.db2.FieldWebpageAuthority;
import xiaoqu.home.open.mapper.db2.FieldWebpageAuthorityMapper;
import xiaoqu.home.open.service.db2.FieldWebpageAuthorityService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * <p>
 * 权限组列 服务实现类
 * </p>
 *
 * @author mk
 * @since 2022-03-21
 */
@Service
public class FieldWebpageAuthorityServiceImpl extends ServiceImpl<FieldWebpageAuthorityMapper, FieldWebpageAuthority> implements FieldWebpageAuthorityService {
	@Override
	public List<FieldWebpageAuthority> getFieldList(Long webId, Long authority_id) {
		QueryWrapper<FieldWebpageAuthority> wrapper = Wrappers.query();
		wrapper.eq("web_id", webId);
		wrapper.eq("authority_id", authority_id);
		wrapper.eq("check_status", 1);// 选中
		wrapper.eq("is_select", 1);// 本表
		wrapper.eq("soft_delete", 0);
		return list(wrapper);
	}

	@Override
	public List<FieldWebpageAuthority> getExportFieldList(Long webId, Long authority_id) {
		QueryWrapper<FieldWebpageAuthority> wrapper = Wrappers.query();
		wrapper.eq("web_id", webId);
		wrapper.eq("authority_id", authority_id);
		wrapper.eq("check_status", 1);// 选中
		wrapper.eq("soft_delete", 0);
		return list(wrapper);
	}
}
