20 lines
747 B
Java
20 lines
747 B
Java
package com.example.mapper;
|
|
|
|
import com.example.entity.Account;
|
|
import org.apache.ibatis.annotations.Insert;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
@Mapper
|
|
public interface UserMapper {
|
|
@Select("select * from db_account where username = #{text} or email = #{text}")
|
|
Account findAccountByNameOrEmail(String text);
|
|
|
|
@Insert("insert into db_account (email, username, password) values (#{email}, #{username}, #{password})")
|
|
int createAccount(String username, String password, String email);
|
|
|
|
@Update("update db_account set password = #{password} where email = #{email}")
|
|
int resetPasswordByEmail(String password, String email);
|
|
}
|