|
@@ -28,7 +28,7 @@ public class UserAccountServiceImpl implements UserAccountService {
|
|
|
private static final String JPQL= "select new com.uas.sso.entity.UserAccount(user.userUU, user.vipName, user.mobile, user.mobileArea, " +
|
|
private static final String JPQL= "select new com.uas.sso.entity.UserAccount(user.userUU, user.vipName, user.mobile, user.mobileArea, " +
|
|
|
"user.mobileValidCode, user.password, user.salt, user.email, user.emailValidCode, " +
|
|
"user.mobileValidCode, user.password, user.salt, user.email, user.emailValidCode, " +
|
|
|
"user.identityValidCode, user.lock, us.spaceUU, us.spaceName, us.businessCode, " +
|
|
"user.identityValidCode, user.lock, us.spaceUU, us.spaceName, us.businessCode, " +
|
|
|
- "us.domain, app.uid, ur.lastLoginTime) from User user inner join user.userSpaces us inner join us.apps app left join user.userRecord ur where 1=1 ";
|
|
|
|
|
|
|
+ "us.domain, app.uid, ur.lastLoginTime) from User user inner join user.userSpaces us inner join us.apps app, UserRecord ur where user.userUU = ur.userUU ";
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<UserAccount> findAll() {
|
|
public List<UserAccount> findAll() {
|
|
@@ -38,32 +38,6 @@ public class UserAccountServiceImpl implements UserAccountService {
|
|
|
return reports;
|
|
return reports;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public UserAccount findOneByMobile(String appId, String mobile, Long spaceUU) {
|
|
|
|
|
- String sql = JPQL + " and app.uid = ?1 and user.mobile = ?2 and us.spaceUU = ?3";
|
|
|
|
|
- //建立有类型的查询
|
|
|
|
|
- TypedQuery<UserAccount> reportTypedQuery= entityManager.createQuery(sql, UserAccount.class);
|
|
|
|
|
- //另外有详细查询条件的在jpql中留出参数位置来(?1 ?2 ?3....),然后在这设置
|
|
|
|
|
- reportTypedQuery.setParameter(1, appId);
|
|
|
|
|
- reportTypedQuery.setParameter(2, mobile);
|
|
|
|
|
- reportTypedQuery.setParameter(3, spaceUU);
|
|
|
|
|
- List<UserAccount> reports= reportTypedQuery.getResultList();
|
|
|
|
|
- return CollectionUtils.isEmpty(reports) ? null : reports.get(0);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public UserAccount findOneByEmail(String appId, String email, Long spaceUU) {
|
|
|
|
|
- String sql = JPQL + " and app.uid = ?1 and user.email = ?2 and us.spaceUU = ?3";
|
|
|
|
|
- //建立有类型的查询
|
|
|
|
|
- TypedQuery<UserAccount> reportTypedQuery= entityManager.createQuery(sql, UserAccount.class);
|
|
|
|
|
- //另外有详细查询条件的在jpql中留出参数位置来(?1 ?2 ?3....),然后在这设置
|
|
|
|
|
- reportTypedQuery.setParameter(1, appId);
|
|
|
|
|
- reportTypedQuery.setParameter(2, email);
|
|
|
|
|
- reportTypedQuery.setParameter(3, spaceUU);
|
|
|
|
|
- List<UserAccount> reports= reportTypedQuery.getResultList();
|
|
|
|
|
- return CollectionUtils.isEmpty(reports) ? null : reports.get(0);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public UserAccount findOneByUserUU(String appId, Long userUU, Long spaceUU) {
|
|
public UserAccount findOneByUserUU(String appId, Long userUU, Long spaceUU) {
|
|
|
String sql = JPQL + " and app.uid = ?1 and user.userUU = ?2 and us.spaceUU = ?3";
|
|
String sql = JPQL + " and app.uid = ?1 and user.userUU = ?2 and us.spaceUU = ?3";
|
|
@@ -89,18 +63,6 @@ public class UserAccountServiceImpl implements UserAccountService {
|
|
|
return reports;
|
|
return reports;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public List<UserAccount> findByEmail(String appId, String email) {
|
|
|
|
|
- String sql = JPQL + " and app.uid = ?1 and user.email = ?2";
|
|
|
|
|
- //建立有类型的查询
|
|
|
|
|
- TypedQuery<UserAccount> reportTypedQuery= entityManager.createQuery(sql, UserAccount.class);
|
|
|
|
|
- //另外有详细查询条件的在jpql中留出参数位置来(?1 ?2 ?3....),然后在这设置
|
|
|
|
|
- reportTypedQuery.setParameter(1, appId);
|
|
|
|
|
- reportTypedQuery.setParameter(2, email);
|
|
|
|
|
- List<UserAccount> reports= reportTypedQuery.getResultList();
|
|
|
|
|
- return reports;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<UserAccount> findByUserUU(String appId, Long userUU) {
|
|
public List<UserAccount> findByUserUU(String appId, Long userUU) {
|
|
|
String sql = JPQL + " and app.uid = ?1 and user.userUU = ?2";
|
|
String sql = JPQL + " and app.uid = ?1 and user.userUU = ?2";
|