package com.zanxiang.game.gs.data.serve.service.impl;


import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.zanxiang.game.gs.data.serve.dao.mapper.game.order.RoleOperateMapper;
import com.zanxiang.game.gs.data.serve.pojo.entity.game.order.RoleOperate;
import com.zanxiang.game.gs.data.serve.service.IRoleOperateService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * 角色操作表 服务层实现。
 *
 * @author shaosong
 * @since 1.0
 */
@Service
public class RoleOperateServiceImpl extends ServiceImpl<RoleOperateMapper, RoleOperate> implements IRoleOperateService {
    @Override
    public List<RoleOperate> getRoleOperateByGs(String sourceSystem, Collection<Long> gsIdlist) {
        return list(new QueryWrapper()
                .eq(RoleOperate::getSourceSystem, sourceSystem)
                .in(RoleOperate::getGsId, gsIdlist));
    }

    @Override
    public List<RoleOperate> getRoleOperateByGameIdAndRoleId(String sourceSystem, Collection<Long> gameIdList, Collection<String> roleIdList) {
        return list(new QueryWrapper()
                .eq(RoleOperate::getSourceSystem, sourceSystem)
                .in(RoleOperate::getGameId, gameIdList)
                .in(RoleOperate::getRoleId, roleIdList));
    }
}