package com.huiju.estateagents.property.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiju.estateagents.property.model.ToCommunities;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 所有小区表 Mapper 接口
 * </p>
 *
 * @author weiximei
 * @since 2018-12-19
 */
@Mapper
public interface ToCommunitiesMapper extends BaseMapper<ToCommunities> {

    /**
     * 根据 电话号码 查询出
     * @param phone
     * @return
     */
    @Select("SELECT tc.* FROM ta_user tu LEFT JOIN to_communities tc ON tu.org_id = tc.id WHERE tu.login_name = #{phone}")
    List<ToCommunities> selectUserById(String phone);

}
