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

import com.icomsys.main_vm.db.jpa.repo.system.dsl.TbSynonymMasterRepoDsl;
import com.icomsys.main_vm.db.jpa.entity.conversation.TbSynonymMaster;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

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

public interface TbSynonymMasterRepo extends JpaRepository<TbSynonymMaster, Long>, TbSynonymMasterRepoDsl {

    List<TbSynonymMaster> findByUseYnAndOprMngCode(String use, String opr);

  /*  @Modifying
    @Transactional
    @Query(
            value = "UPDATE TB_SYNONYM_MASTER " +
                    "set USE_YN = 'N' " +
                    "where SEQ = :seq "
            , nativeQuery = true
    )*/
    //int deleteSynonym(@Param("seq") HashMap eMap);
    boolean existsBySeq(Long seq);
    Optional<TbSynonymMaster> findBySeq(Long seq);
}
