UserInfoMapper.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.maxkey.persistence.mapper;
  17. import java.util.List;
  18. import org.apache.ibatis.annotations.Select;
  19. import org.apache.ibatis.annotations.Update;
  20. import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
  21. import org.maxkey.constants.ConstsStatus;
  22. import org.maxkey.entity.ChangePassword;
  23. import org.maxkey.entity.Organizations;
  24. import org.maxkey.entity.UserInfo;
  25. import org.maxkey.entity.UserInfoAdjoint;
  26. /**
  27. * @author Crystal.Sea
  28. *
  29. */
  30. public interface UserInfoMapper extends IJpaBaseMapper<UserInfo>{
  31. //login query
  32. public UserInfo findByAppIdAndUsername(UserInfo userInfo);
  33. @Select("select * from mxk_userinfo where username = #{value} and status = " + ConstsStatus.ACTIVE)
  34. public UserInfo findByUsername(String username);
  35. @Select("select * from mxk_userinfo where ( email = #{value} or mobile= #{value} ) and status = " + ConstsStatus.ACTIVE)
  36. public UserInfo findByEmailMobile(String emailMobile);
  37. public List<Organizations> findDeptsByUserId(String userId);
  38. public List<UserInfoAdjoint> findAdjointsByUserId(String userId);
  39. public void updateLocked(UserInfo userInfo);
  40. public void updateLockout(UserInfo userInfo);
  41. public void updateBadPWDCount(UserInfo userInfo);
  42. public int changePassword(ChangePassword changePassword);
  43. public int updateAppLoginPassword(UserInfo userInfo);
  44. public int updateProtectedApps(UserInfo userInfo);
  45. public int updateSharedSecret(UserInfo userInfo);
  46. public int updatePasswordQuestion(UserInfo userInfo);
  47. public int updateAuthnType(UserInfo userInfo);
  48. public int updateEmail(UserInfo userInfo);
  49. public int updateMobile(UserInfo userInfo);
  50. public int updateProfile(UserInfo userInfo);
  51. @Update("update mxk_userinfo set gridlist = #{gridList} where id = #{id}")
  52. public int updateGridList(UserInfo userInfo) ;
  53. }