package org.jeecg.modules.ctop.mapper;

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

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<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<JSONObject> getProjectByUserIdAndMediaIds(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
}
