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

import com.icomsys.main_vm.db.jpa.entity.system.TbBotCommonCode;
import com.icomsys.main_vm.db.jpa.entity.system.id.TbBotCommonCodeId;
import com.icomsys.main_vm.db.jpa.repo.system.dsl.TbBotCommonCodeRepoDsl;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface TbBotCommonCodeRepo extends JpaRepository<TbBotCommonCode, TbBotCommonCodeId>, TbBotCommonCodeRepoDsl {

    boolean existsByOprMngCodeAndMajorCodeAndMinorCode(String opr, String ma, String mi);

    List<TbBotCommonCode> findByOprMngCodeAndMajorCode(String opr, String major);
    List<TbBotCommonCode> findByMajorCodeAndOprMngCodeOrderByCodeNameAsc(String major, String oprMgr);
    List<TbBotCommonCode> findByMajorCode(String custName);

    List<TbBotCommonCode> findByCustCodeAndMajorCodeAndOprMngCodeOrderByCodeNameAsc(String custCode, String major, String oprMngCode);

    List<TbBotCommonCode> findByCustCodeAndMajorCode(String custCode, String major);

}
