注册信息获取,提交
							parent
							
								
									ddd5f8b5dc
								
							
						
					
					
						commit
						1ad138e4d9
					
				| @ -0,0 +1,36 @@ | |||||||
|  | package com.glxp.api.dao.auth; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.auth.UserRegisterEntity; | ||||||
|  | import com.glxp.api.req.auth.UserResisterFilterRequest; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface UserRegisterDao { | ||||||
|  | 
 | ||||||
|  |     List<UserRegisterEntity> filterUserRegisters(UserResisterFilterRequest userResisterFilterRequest); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByCompanyName(String companyName); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByUserName(String userName); | ||||||
|  | 
 | ||||||
|  |     boolean insertUserRegister(UserRegisterEntity userRegisterEntity); | ||||||
|  | 
 | ||||||
|  |     boolean updateUserRegister(UserRegisterEntity userRegisterEntity); | ||||||
|  | 
 | ||||||
|  |     boolean deleteById(String id); | ||||||
|  |     boolean deleteByMobile(@Param("mobile")String mobile , @Param("checkStatus")String checkStatus); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectById(String id); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByCustomerId(@Param("id") String id); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByMobile(String mobile); | ||||||
|  | 
 | ||||||
|  |     boolean deleteByCustomerId(String id); | ||||||
|  | 
 | ||||||
|  |     String isExit(String mobile); | ||||||
|  | } | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | package com.glxp.api.entity.auth; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class UserRegisterEntity { | ||||||
|  | 
 | ||||||
|  |     private String id; | ||||||
|  |     private String companyId; | ||||||
|  |     private String mobile; | ||||||
|  |     private String email; | ||||||
|  |     private String userId; | ||||||
|  |     private String realName; | ||||||
|  |     private String contactWay; | ||||||
|  |     private String companyName; | ||||||
|  |     private String creditNum; | ||||||
|  |     private String registerAddress; | ||||||
|  |     private String bussinessStatus; | ||||||
|  |     private String legalPerson; | ||||||
|  |     private String legalIdCard; | ||||||
|  |     private String checkStatus; | ||||||
|  |     private String registerTime; | ||||||
|  |     private String checkTime; | ||||||
|  |     private String comments; | ||||||
|  | } | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | package com.glxp.api.req.auth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class UserResisterFilterRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  |     private String companyName; | ||||||
|  |     private String checkStatus; | ||||||
|  |     private String companyId; | ||||||
|  | } | ||||||
| @ -0,0 +1,33 @@ | |||||||
|  | package com.glxp.api.service.auth; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.auth.UserRegisterEntity; | ||||||
|  | import com.glxp.api.req.auth.UserResisterFilterRequest; | ||||||
|  | 
 | ||||||
|  | public interface UserRegisterService { | ||||||
|  | 
 | ||||||
|  |     List<UserRegisterEntity> filterUserRegisters(UserResisterFilterRequest userResisterFilterRequest); | ||||||
|  | 
 | ||||||
|  |     boolean insertUserRegister(UserRegisterEntity userRegisterEntity); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByCompanyName(String companyName); | ||||||
|  | 
 | ||||||
|  |     boolean updateUserRegister(UserRegisterEntity userRegisterEntity); | ||||||
|  | 
 | ||||||
|  |     boolean deleteById(String id); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByUserName(String userName); | ||||||
|  | 
 | ||||||
|  |     boolean deleteByMobile(String mobile,String checkStatus); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectById(String id); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByMobile(String mobile); | ||||||
|  | 
 | ||||||
|  |     boolean isExit(String mobile); | ||||||
|  | 
 | ||||||
|  |     boolean deleteByCustomerId(String id); | ||||||
|  | 
 | ||||||
|  |     UserRegisterEntity selectByCustomerId(String id); | ||||||
|  | } | ||||||
| @ -0,0 +1,100 @@ | |||||||
|  | package com.glxp.api.service.auth.impl; | ||||||
|  | 
 | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | 
 | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.springframework.transaction.annotation.Transactional; | ||||||
|  | 
 | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.dao.auth.UserRegisterDao; | ||||||
|  | import com.glxp.api.entity.auth.UserRegisterEntity; | ||||||
|  | import com.glxp.api.req.auth.UserResisterFilterRequest; | ||||||
|  | import com.glxp.api.service.auth.UserRegisterService; | ||||||
|  | import com.glxp.api.util.CustomUtil; | ||||||
|  | import com.glxp.api.util.DateUtil; | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | @Transactional(rollbackFor = Exception.class) | ||||||
|  | public class UserRegisterServiceImpl implements UserRegisterService { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     private UserRegisterDao userRegisterDao; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<UserRegisterEntity> filterUserRegisters(UserResisterFilterRequest userResisterFilterRequest) { | ||||||
|  |         if (userResisterFilterRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         int offset = (userResisterFilterRequest.getPage() - 1) * userResisterFilterRequest.getLimit(); | ||||||
|  |         PageHelper.offsetPage(offset, userResisterFilterRequest.getLimit()); | ||||||
|  |         return userRegisterDao.filterUserRegisters(userResisterFilterRequest); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean insertUserRegister(UserRegisterEntity userRegisterEntity) { | ||||||
|  |         if(StringUtils.isEmpty(userRegisterEntity.getId())) | ||||||
|  |             userRegisterEntity.setId(CustomUtil.getId()); | ||||||
|  |         userRegisterEntity.setRegisterTime(DateUtil.getDateTime()); | ||||||
|  |         return userRegisterDao.insertUserRegister(userRegisterEntity); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public UserRegisterEntity selectByCompanyName(String companyName) { | ||||||
|  |         return userRegisterDao.selectByCompanyName(companyName); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean updateUserRegister(UserRegisterEntity userRegisterEntity) { | ||||||
|  |         return userRegisterDao.updateUserRegister(userRegisterEntity); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean deleteById(String id) { | ||||||
|  |         return userRegisterDao.deleteById(id); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public UserRegisterEntity selectByUserName(String userName) { | ||||||
|  |         return userRegisterDao.selectByUserName(userName); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean deleteByMobile(String mobile, String checkStatus) { | ||||||
|  |         return userRegisterDao.deleteByMobile(mobile,checkStatus); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public UserRegisterEntity selectById(String id) { | ||||||
|  |         return userRegisterDao.selectById(id); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public UserRegisterEntity selectByMobile(String mobile) { | ||||||
|  |         return userRegisterDao.selectByMobile(mobile); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean isExit(String mobile) { | ||||||
|  |         String data = userRegisterDao.isExit(mobile); | ||||||
|  |         if (data != null) | ||||||
|  |             return true; | ||||||
|  |         else | ||||||
|  |             return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean deleteByCustomerId(String id) { | ||||||
|  |         return userRegisterDao.deleteByCustomerId(id); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public UserRegisterEntity selectByCustomerId(String id) { | ||||||
|  |         return userRegisterDao.selectByCustomerId(id); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,118 @@ | |||||||
|  | <?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="com.glxp.api.dao.auth.UserRegisterDao"> | ||||||
|  | 
 | ||||||
|  |     <select id="filterUserRegisters" parameterType="com.glxp.api.req.auth.UserResisterFilterRequest" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |         <where> | ||||||
|  |             <if test="companyName != null and '' !=companyName"> | ||||||
|  |                 AND companyName like concat('%',#{companyName},'%') | ||||||
|  |             </if> | ||||||
|  |             <if test="checkSatus != null and ''!=checkSatus"> | ||||||
|  |                 AND checkSatus = #{checkSatus} | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="selectByCompanyName" parameterType="java.lang.String" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |             where companyName=#{companyName} | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="selectByUserName" parameterType="java.lang.String" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |         where userName=#{userName} | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     <insert id="insertUserRegister" keyProperty="id" parameterType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         INSERT INTO user_register | ||||||
|  |         (id,companyId,mobile,email,userId,realName,contactWay,companyName,creditNum, | ||||||
|  |         registerAddress,bussinessStatus,legalPerson,legalIdCard,checkStatus,registerTime, | ||||||
|  |         checkTime,comments)  | ||||||
|  |     	values (#{id,jdbcType=VARCHAR},#{companyId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR}, | ||||||
|  |     	#{email,jdbcType=VARCHAR},#{userId,jdbcType=VARCHAR},#{realName,jdbcType=VARCHAR}, | ||||||
|  |     	#{contactWay,jdbcType=VARCHAR},#{companyName,jdbcType=VARCHAR},#{creditNum,jdbcType=VARCHAR}, | ||||||
|  |     	#{registerAddress,jdbcType=VARCHAR},#{bussinessStatus,jdbcType=VARCHAR},#{legalPerson,jdbcType=VARCHAR}, | ||||||
|  |     	#{legalIdCard,jdbcType=VARCHAR},#{checkStatus,jdbcType=VARCHAR},#{registerTime,jdbcType=TIMESTAMP}, | ||||||
|  |     	#{checkTime,jdbcType=TIMESTAMP},#{comments,jdbcType=VARCHAR}) | ||||||
|  |     </insert> | ||||||
|  | 
 | ||||||
|  |     <update id="updateUserRegister" parameterType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         UPDATE user_register | ||||||
|  |         <trim prefix="set" suffixOverrides=","> | ||||||
|  |             <if test="companyId != null">`companyId`=#{companyId},</if> | ||||||
|  |             <if test="mobile != null">mobile=#{mobile},</if> | ||||||
|  |             <if test="email != null">`email`=#{email},</if> | ||||||
|  |             <if test="userId != null">userId=#{userId},</if> | ||||||
|  |             <if test="realName != null">realName=#{realName},</if> | ||||||
|  |             <if test="companyName != null">companyName=#{companyName},</if> | ||||||
|  |             <if test="contactWay != null">contactWay=#{contactWay},</if> | ||||||
|  |             <if test="creditNum != null">creditNum=#{creditNum},</if> | ||||||
|  |             <if test="registerAddress != null">registerAddress=#{registerAddress},</if> | ||||||
|  |             <if test="bussinessStatus != null">bussinessStatus=#{bussinessStatus},</if> | ||||||
|  |             <if test="checkStatus != null">checkStatus=#{checkStatus},</if> | ||||||
|  |             <if test="legalPerson != null">legalPerson=#{legalPerson},</if> | ||||||
|  |             <if test="legalIdCard != null">legalIdCard=#{legalIdCard},</if> | ||||||
|  |             <if test="checkStatus != null">checkStatus=#{checkStatus},</if> | ||||||
|  |             <if test="registerTime != null">registerTime=#{registerTime},</if> | ||||||
|  |             <if test="checkTime != null">checkTime=#{checkTime},</if> | ||||||
|  |             <if test="comments != null">comments=#{comments},</if> | ||||||
|  |         </trim> | ||||||
|  |         WHERE id=#{id} | ||||||
|  |     </update> | ||||||
|  | 
 | ||||||
|  |     <delete id="deleteById" parameterType="java.lang.Long"> | ||||||
|  |         delete | ||||||
|  |         from user_register | ||||||
|  |         where id = #{id} | ||||||
|  |     </delete> | ||||||
|  |     <delete id="deleteByMobile" parameterType="map"> | ||||||
|  |         delete | ||||||
|  |         from user_register | ||||||
|  |         where mobile = #{mobile} and checkStatus=#{checkStatus} | ||||||
|  |     </delete> | ||||||
|  | 
 | ||||||
|  |     <delete id="deleteByCustomerId" parameterType="java.lang.String"> | ||||||
|  |         delete | ||||||
|  |         from user_register | ||||||
|  |         where userId = #{userId} | ||||||
|  |     </delete> | ||||||
|  |     <select id="selectById" parameterType="java.lang.Integer" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |         WHERE id = #{id} | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="selectByMobile" parameterType="java.lang.String" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |         WHERE mobile = #{mobile} | ||||||
|  |         limit 1 | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="selectByCustomerId" parameterType="java.lang.String" | ||||||
|  |             resultType="com.glxp.api.entity.auth.UserRegisterEntity"> | ||||||
|  |         SELECT * | ||||||
|  |         FROM user_register | ||||||
|  |         WHERE companyId = #{id} | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="isExit" parameterType="java.lang.String" resultType="java.lang.String"> | ||||||
|  |         SELECT 1 | ||||||
|  |         FROM user_register | ||||||
|  |         WHERE ( | ||||||
|  |                   mobile = #{mobile}  and checkStatus !='2' ) limit 1 | ||||||
|  | 
 | ||||||
|  |     </select> | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue