UserMapper.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.example.springboot.mapper;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.example.springboot.entity.Auth.Account;
  4. import com.example.springboot.entity.Auth.User;
  5. import com.example.springboot.entity.User.AccountUser;
  6. import org.apache.ibatis.annotations.Insert;
  7. import org.apache.ibatis.annotations.Mapper;
  8. import org.apache.ibatis.annotations.Select;
  9. import org.apache.ibatis.annotations.Update;
  10. @Mapper
  11. //@Repository
  12. public interface UserMapper extends BaseMapper<User> {
  13. @Select("select * from authorize where username = #{text} or email = #{text}")
  14. AccountUser findAccountUserByNameOrEmail(String text);
  15. @Select("select * from authorize where username = #{text} or email = #{text}")
  16. Account findAccountByNameOrEmail(String text);
  17. @Insert("insert into authorize(username, email, password) value (#{username}, #{email}, #{password})")
  18. int createAccount(String username, String password, String email);
  19. @Update("update authorize set password = #{password} where email = #{email}")
  20. int resetPassword(String password, String email);
  21. /*@Select("select * from user")
  22. List<User> queryUserList();
  23. @Insert("insert into user(name,pwd,sex,stature,mail,phone) values (#{name},#{pwd},#{sex},#{stature},#{mail},#{phone})")
  24. int insert(User user);
  25. int update(User user);
  26. @Delete("delete from user where id = #{id}")
  27. int deleteById(Integer id);
  28. @Select("select * from user where name like concat('%',#{name},'%') and phone like concat('%',#{phone},'%') limit #{pageNum},#{pageSize}")
  29. List<User> selectPage(Integer pageNum,Integer pageSize,String name,String phone);
  30. @Select("select count(*) from user where name like concat('%',#{name},'%') and phone like concat('%',#{phone},'%')")
  31. Integer selectTotal(String name,String phone);*/
  32. }