package com.community.huiju.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.community.huiju.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 tp_user tu LEFT JOIN to_communities tc ON tu.community_id = tc.id WHERE tu.login_name = #{phone}")
    List<ToCommunities> selectUserById(String phone);

}
