Selaa lähdekoodia

Merge branch 'huangyuan-user' of http://132.232.206.88:3000/lift-manager/lift-server into develop

黄远 5 vuotta sitten
vanhempi
commit
d31b4d258f

+ 1 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/controller/UserController.java

@@ -68,4 +68,5 @@ public class UserController {
     public RestResponse deleteUser(UserRequest userRequest){
         return userService.deleteUser(userRequest);
     }
+
 }

+ 1 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/dao/entity/model/UserRequest.java

@@ -12,6 +12,7 @@ public class UserRequest {
     private Long userId;//用户id
     private Long roleId;//角色id
     private Long companyId;//公司id
+    private String account;//账号(小梯号)
     private String mobile;//手机号
     private String password;//密码
     private String name;//用户真实姓名

+ 0 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IUserService.java

@@ -51,5 +51,4 @@ public interface IUserService{
      * @return
      */
     RestResponse deleteUser(UserRequest userRequest);
-
 }

+ 2 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserService.java

@@ -37,6 +37,8 @@ public class UserService implements IUserService {
         String password = userRequest.getPassword();
         UserAccount userAccount = new UserAccount();
         userAccount.setMobile(userRequest.getMobile());
+        //设置账号(小梯号)
+        userAccount.setAccount(userRequest.getAccount());
         userAccount.setCreateDate(new Date());
         UserInfo userInfo = new UserInfo();
         userInfo.setName(userRequest.getName());

+ 3 - 170
lift-system-service/src/main/resources/mapper/UserAccountMapper.xml

@@ -22,176 +22,6 @@
 		other_account2, status, remarks, create_date
 	</sql>
 
-	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
-		select 
-		<include refid="Base_Column_List" />
-		from user_account
-		where user_id = #{userId,jdbcType=BIGINT}
-	</select>
-
-	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
-		delete from user_account
-		where user_id = #{userId,jdbcType=BIGINT}
-	</delete>
-
-	<insert id="insert" parameterType="cn.com.ty.lift.system.user.dao.entity.UserAccount" >
-		insert into user_account (user_id, type, account, 
-			password, salt, mobile, 
-			wechat_open_id, email, other_account, 
-			other_account2, status, remarks, 
-			create_date)
-		values (#{userId,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{account,jdbcType=VARCHAR}, 
-			#{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, #{mobile,jdbcType=CHAR}, 
-			#{wechatOpenId,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{otherAccount,jdbcType=VARCHAR}, 
-			#{otherAccount2,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, 
-			#{createDate,jdbcType=TIMESTAMP})
-	</insert>
-
-	<insert id="insertSelective" parameterType="cn.com.ty.lift.system.user.dao.entity.UserAccount" >
-		insert into user_account
-		<trim prefix="(" suffix=")" suffixOverrides="," >
-			<if test="userId != null" >
-				user_id,
-			</if>
-			<if test="type != null" >
-				type,
-			</if>
-			<if test="account != null" >
-				account,
-			</if>
-			<if test="password != null" >
-				password,
-			</if>
-			<if test="salt != null" >
-				salt,
-			</if>
-			<if test="mobile != null" >
-				mobile,
-			</if>
-			<if test="wechatOpenId != null" >
-				wechat_open_id,
-			</if>
-			<if test="email != null" >
-				email,
-			</if>
-			<if test="otherAccount != null" >
-				other_account,
-			</if>
-			<if test="otherAccount2 != null" >
-				other_account2,
-			</if>
-			<if test="status != null" >
-				status,
-			</if>
-			<if test="remarks != null" >
-				remarks,
-			</if>
-			<if test="createDate != null" >
-				create_date,
-			</if>
-		</trim>
-		<trim prefix="values (" suffix=")" suffixOverrides="," >
-			<if test="userId != null" >
-				#{userId,jdbcType=BIGINT},
-			</if>
-			<if test="type != null" >
-				#{type,jdbcType=TINYINT},
-			</if>
-			<if test="account != null" >
-				#{account,jdbcType=VARCHAR},
-			</if>
-			<if test="password != null" >
-				#{password,jdbcType=VARCHAR},
-			</if>
-			<if test="salt != null" >
-				#{salt,jdbcType=VARCHAR},
-			</if>
-			<if test="mobile != null" >
-				#{mobile,jdbcType=CHAR},
-			</if>
-			<if test="wechatOpenId != null" >
-				#{wechatOpenId,jdbcType=VARCHAR},
-			</if>
-			<if test="email != null" >
-				#{email,jdbcType=VARCHAR},
-			</if>
-			<if test="otherAccount != null" >
-				#{otherAccount,jdbcType=VARCHAR},
-			</if>
-			<if test="otherAccount2 != null" >
-				#{otherAccount2,jdbcType=VARCHAR},
-			</if>
-			<if test="status != null" >
-				#{status,jdbcType=TINYINT},
-			</if>
-			<if test="remarks != null" >
-				#{remarks,jdbcType=VARCHAR},
-			</if>
-			<if test="createDate != null" >
-				#{createDate,jdbcType=TIMESTAMP},
-			</if>
-		</trim>
-	</insert>
-
-	<update id="updateByPrimaryKeySelective" parameterType="cn.com.ty.lift.system.user.dao.entity.UserAccount" >
-		update user_account
-		<set >
-			<if test="type != null" >
-				type = #{type,jdbcType=TINYINT},
-			</if>
-			<if test="account != null" >
-				account = #{account,jdbcType=VARCHAR},
-			</if>
-			<if test="password != null" >
-				password = #{password,jdbcType=VARCHAR},
-			</if>
-			<if test="salt != null" >
-				salt = #{salt,jdbcType=VARCHAR},
-			</if>
-			<if test="mobile != null" >
-				mobile = #{mobile,jdbcType=CHAR},
-			</if>
-			<if test="wechatOpenId != null" >
-				wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},
-			</if>
-			<if test="email != null" >
-				email = #{email,jdbcType=VARCHAR},
-			</if>
-			<if test="otherAccount != null" >
-				other_account = #{otherAccount,jdbcType=VARCHAR},
-			</if>
-			<if test="otherAccount2 != null" >
-				other_account2 = #{otherAccount2,jdbcType=VARCHAR},
-			</if>
-			<if test="status != null" >
-				status = #{status,jdbcType=TINYINT},
-			</if>
-			<if test="remarks != null" >
-				remarks = #{remarks,jdbcType=VARCHAR},
-			</if>
-			<if test="createDate != null" >
-				create_date = #{createDate,jdbcType=TIMESTAMP},
-			</if>
-		</set>
-		where user_id = #{userId,jdbcType=BIGINT}
-	</update>
-
-	<update id="updateByPrimaryKey" parameterType="cn.com.ty.lift.system.user.dao.entity.UserAccount" >
-		update user_account
-		set type = #{type,jdbcType=TINYINT},
-			account = #{account,jdbcType=VARCHAR},
-			password = #{password,jdbcType=VARCHAR},
-			salt = #{salt,jdbcType=VARCHAR},
-			mobile = #{mobile,jdbcType=CHAR},
-			wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},
-			email = #{email,jdbcType=VARCHAR},
-			other_account = #{otherAccount,jdbcType=VARCHAR},
-			other_account2 = #{otherAccount2,jdbcType=VARCHAR},
-			status = #{status,jdbcType=TINYINT},
-			remarks = #{remarks,jdbcType=VARCHAR},
-			create_date = #{createDate,jdbcType=TIMESTAMP}
-		where user_id = #{userId,jdbcType=BIGINT}
-	</update>
 
 	<!--通过账户对象,多维度查询用户账户信息 -->
 	<select id="getByUserAccount" parameterType="cn.com.ty.lift.system.user.dao.entity.UserAccount" resultType="cn.com.ty.lift.system.user.dao.entity.UserAccount">
@@ -199,6 +29,9 @@
 		<include refid="Base_Column_List" />
 		from user_account
 		where 1 = 1
+		<if test="userId != null">
+			and <![CDATA[ user_id <> #{userId, jdbcType=BIGINT} ]]>
+		</if>
 		<if test="mobile != null">
 			and mobile = #{mobile,jdbcType=VARCHAR}
 		</if>