package com.nbclass.szxgl.mapper;

import com.nbclass.szxgl.model.ProjectTaskUser;
import com.nbclass.util.MyMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ProjectTaskUserMapper extends MyMapper<ProjectTaskUser> {
	
	/**
	 * 查询用户是否是项目任务执行人
	 * @param taskId
	 * @param userid
	 * @return
	 */
	public Integer selectProjectTaskUser(@Param("taskId")String taskId, @Param("userid")String userid);

	public void deleteByTaskId(String projectTaskId);

	public void deleteByProjectId(String projectId);

	/**
	 * 通过项目任务id去查询项目任务关联人的列表
	 * @param projectTaskId
	 * @return
	 */
	public List<ProjectTaskUser> selectProjectTaskUserList(@Param("projectTaskId")String projectTaskId);

	/**
	 * 插入或者新增项目任务关联人
	 * @param id
	 * @param projectId
	 * @param projectTaskId
	 * @param userId
	 * @param updateTime
	 * @param createTime
	 */
	public void insertOrUpdate(@Param("id")String id, @Param("projectId")String projectId, @Param("projectTaskId")String projectTaskId, @Param("userId")String userId, @Param("updateTime") Date updateTime, @Param("createTime")Date createTime);

	public List<String> selectUserIds(@Param("projectTaskId") String projectTaskId);
}