package com.malk.shangfeng.repository.dao;

import com.malk.shangfeng.repository.entity.Fitemss97Po;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 钉钉花名册同步
 */
@Transactional
public interface Fitemss97Dao extends JpaRepository<Fitemss97Po, Long> {

    // 未同步项目信息
    @Query(value = "select * from fitemss97 where syncdd is null", nativeQuery = true)
    List<Fitemss97Po> queryProject();

    // 同步后更新项目
    @Query(value = "update fitemss97 set syncdd = 'sync' where citemcode = ?1", nativeQuery = true)
    @Modifying
    void updateProject(String citemcode);
}
