package top.lejings.db.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.lejings.db.people;

import java.util.List;

@Mapper
public interface selectByOther {

//原则：id和email不许重复
    @Select("select * from people")
    public List<people> selectByOtherAll();

    //单属性查询
    @Select("select * from people where name=#{name}")
    public List<people> selectByName(String name);

    @Select("select * from people where password=#{password}")
    public List<people> selectByPassword(String password);

    @Select("select * from people where email=#{email}")
    public List<people> selectByEmail(String email);


    //双属性查询
    @Select("select * from people where name=#{name} and password=#{password}")
    public List<people> selectByNP(String name,String password);

    @Select("select * from people where name=#{name} and email=#{email}")
    public List<people> selectByNE(String name,String email);

    @Select("select * from people where password=#{password} and email=#{email}")
    public List<people> selectByPE(String password,String email);



    @Select("select * from people where name=#{name} and password=#{password} and email=#{email}")
    public List<people> selectByOther3(String name,String password,String email);


}
