package com.crunii.micro.domain.repo.main;

import com.crunii.micro.domain.common.BaseRepo;
import com.crunii.micro.domain.entity.main.TsmPostWorker;
import com.crunii.micro.domain.entity.main.TsmWorkerOrgTemporary;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
@Transactional(rollbackFor = Exception.class)
public interface TsmWorkerOrgTemporaryRepo extends BaseRepo<TsmWorkerOrgTemporary, String> {

    @Modifying
    @Query(value = "delete from tsm_worker_org_temporary where login_id=:login_id", nativeQuery = true)
    List<TsmPostWorker> deletePostByWorker(@Param("login_id") Long loginId);
}
