package io.renren.modules.admin.dao;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import io.renren.modules.admin.entity.MemberEntity;

/**
 * 会员表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-01-17 11:29:03
 */
@Mapper
public interface MemberDao extends BaseMapper<MemberEntity> {
	@Update("update member set is_check=#{isCheck} where id=#{id}")
    int updateStatus(Long id, Integer isCheck);

    /**
     * 根据真实姓名模糊查询id
     * @param truename
     * @return
     */
    @Select("select id,truename,organization from member where is_del=0 and truename like '%${truename}%';")
    List<Map<String, Object>> selectListByName(String truename);

     /**
     * 根据真实姓名模糊查询id
     * @param truename
     * @return
     */
    @Select("select id,truename,organization,position,job_title as jiobTitle,phone,email from member where is_del=0;")
    List<Map<String, Object>> selectList();
}
