package cn.com.ty.lift.enterprise.organization.dao.mapper;

import cn.com.ty.lift.enterprise.organization.dao.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 项目 Mapper 接口
 * </p>
 *
 * @author wang-hai-cheng
 * @since 2019-12-13
 */
public interface OrganizationMapper extends BaseMapper<Project> {

    @Select("select p.user_id userId,u.avatar_url avatar,u.name name, p.user_role role,u.mobile mobile,p.is_monitor monitor from project_user p left join user_info u on p.user_id = u.user_id where p.project_id = #{projectId} and p.user_role in ('ROLEMTWORK', 'CLERK', 'REGION_DIRECTOR', 'HIGH_DIRECTOR')")
    List<HashMap<String, Object>> users(@Param("projectId") Long projectId);
}