package cn.com.ctop.common.mapper;


import cn.com.ctop.common.entity.Project;
import cn.com.ctop.common.entity.ProjectMember;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * 项目成员
 *
 * @author: jeecg-boot
 * @date: 2019-11-19
 * @cersion: V1.0
 */
public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {

    List<Long> selectProjectsByUserId(@Param("userId") String userId);

    List<Long> selectProductsByUserId(@Param("userId") String userId);

    List<ProjectMember> adminProjects(@Param("mediaIds") List<Integer> mediaIds);

    List<ProjectMember> designLeaderProjects(@Param("companyId") String companyId, @Param("mediaIds") List<Integer> mediaIds);

    List<ProjectMember> designProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);

    List<ProjectMember> operationProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);

    String getRoleCodeByUserId(@Param("userId") String userId);

    String getCompanyIdByUserId(@Param("userId") String userId);

    List<ProjectMember> queryProjectMemberByUserId(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);


    List<ProjectMember> getSaleProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);

    List<Long> getProjectByMap(@Param("userId") String userId);

    List<Project> getProjectByUserId(@Param("userId") String userId);

    List<Long> getProjectByAccountIds(@Param("accountIds") JSONArray accountIds);

    List<Long> getProductByAccountIds(@Param("accountIds") JSONArray accountIds);

    List<JSONObject> getProjectByUserIdAndMediaIds(@Param("userIds") List<String> userIds, @Param("mediaIds") List<Integer> mediaIds);

    List<ProjectMember> getProductIds(@Param("userId") String userId, @Param("mediaList") List<Integer> mediaList, @Param("productId") Long productId);

    List<Long> getProjectIdsByProductId(@Param("productId") Long productId, @Param("userId") String userId);

    List<ProjectMember> getlistByUserId(@Param("userId")String userId);
}
