register
This commit is contained in:
@@ -23,7 +23,7 @@ package org.maxkey.persistence.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
|
||||
import org.maxkey.entity.Registration;
|
||||
import org.maxkey.entity.Register;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
|
||||
/**
|
||||
@@ -31,9 +31,9 @@ import org.maxkey.entity.UserInfo;
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RegistrationMapper extends IJpaBaseMapper<Registration> {
|
||||
public interface RegisterMapper extends IJpaBaseMapper<Register> {
|
||||
|
||||
|
||||
public List<UserInfo> queryUserInfoByEmail(String email);
|
||||
public List<UserInfo> findByEmail(String email);
|
||||
|
||||
}
|
||||
@@ -20,29 +20,29 @@ package org.maxkey.persistence.service;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaBaseService;
|
||||
import org.maxkey.entity.Registration;
|
||||
import org.maxkey.entity.Register;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.mapper.RegistrationMapper;
|
||||
import org.maxkey.persistence.mapper.RegisterMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class RegistrationService extends JpaBaseService<Registration>{
|
||||
public class RegisterService extends JpaBaseService<Register>{
|
||||
|
||||
public RegistrationService() {
|
||||
super(RegistrationMapper.class);
|
||||
public RegisterService() {
|
||||
super(RegisterMapper.class);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.connsec.db.service.BaseService#getMapper()
|
||||
*/
|
||||
@Override
|
||||
public RegistrationMapper getMapper() {
|
||||
return (RegistrationMapper)super.getMapper();
|
||||
public RegisterMapper getMapper() {
|
||||
return (RegisterMapper)super.getMapper();
|
||||
}
|
||||
|
||||
|
||||
public UserInfo queryUserInfoByEmail(String email){
|
||||
List<UserInfo> listUserInfo=getMapper().queryUserInfoByEmail(email);
|
||||
public UserInfo findByEmail(String email){
|
||||
List<UserInfo> listUserInfo=getMapper().findByEmail(email);
|
||||
return listUserInfo.size()>0?listUserInfo.get(0):null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.maxkey.persistence.mapper.RegisterMapper">
|
||||
|
||||
<select id="findByEmail" parameterType="string" resultType="UserInfo">
|
||||
select
|
||||
id,
|
||||
workemail
|
||||
from
|
||||
mxk_register
|
||||
where
|
||||
workemail = #{value}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.maxkey.persistence.mapper.RegistrationMapper">
|
||||
|
||||
<select id="queryUserInfoByEmail" parameterType="string" resultType="UserInfo">
|
||||
select
|
||||
id,
|
||||
email
|
||||
from
|
||||
userinfo
|
||||
where
|
||||
email = #{value}
|
||||
union
|
||||
select
|
||||
id,
|
||||
workemail eamil
|
||||
from
|
||||
mxk_registration
|
||||
where
|
||||
workemail = #{value}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user