package com.icomsys.main_vm.db.jpa.repo.system;

import com.icomsys.main_vm.db.jpa.entity.system.TbBotUser;
import com.icomsys.main_vm.db.jpa.entity.system.TbUserAuthGroup;
import com.icomsys.main_vm.db.jpa.entity.system.id.TbUserAuthGroupId;
import com.icomsys.main_vm.db.jpa.repo.system.dsl.TbUserAuthGroupRepoDsl;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface TbUserAuthGroupRepo extends JpaRepository<TbUserAuthGroup, TbUserAuthGroupId>, TbUserAuthGroupRepoDsl {

    boolean existsByAuthGroupSeq(Long authGroupSeq);

    boolean existsByServiceGroupAndUserSeqAndAuthGroupSeqNot(String service, Long userSeq, Long authSeq);


    List<TbUserAuthGroup> findByAuthGroupSeq(Long authGroupSeq);

    List<TbUserAuthGroup> findByUserSeq(Long userSeq);

    List<TbUserAuthGroup> findByUserSeqAndServiceGroupAndCustCode(Long user, String service, String cust);

}
