package com.softwarebr.nunu.dao.res;

import com.softwarebr.nunu.entity.res.Project;
import com.brframework.commondb.core.CommonRepository;
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 java.util.List;

/**
 * @date 2020-02-21 11:47:29
 * @author lilin
 */

@Repository
public interface ProjectDao extends CommonRepository<Long, Project> {

    /**
     * 修改项目的对接状态
     * @param projectId
     * @param status
     */
    @Modifying
    @Query("update Project set status = :status where id = :projectId")
    void updateStatus(@Param("projectId") Long projectId, @Param("status") Integer status);

    /**
     * 项目类型数据统计
     * @param type 类型{@link Project}
     * @param marker 删除标记{@link Project}
     * @return
     */
    Long countByTypeAndMarker(Integer type, Integer marker);

}