提交 399ba952 编写于 作者: IIIllI's avatar IIIllI

修改user映射

上级 3efbe4b3
......@@ -23,7 +23,7 @@ public interface UserDao {
* @Author: Lyc
* @Date: 2022/4/29 19:45
*/
public int insertUser(User user);
int insertUser(User user);
/**
* @Description:根据id查找用户
......@@ -32,7 +32,7 @@ public interface UserDao {
* @Author: Lyc
* @Date: 2022/4/29 19:45
*/
public User selectUserByID(long id);
User selectUserByID(long id);
/* *
* @Description: 根据手机号、密码查找用户
......@@ -41,7 +41,7 @@ public interface UserDao {
* @Author: Lyc
* @Date: 2022/4/29 19:46
*/
public User selectUserByPhoneAndPwd(@Param("phoneNum") String phoneNum, @Param("password") String password);
User selectUserByPhoneAndPwd(@Param("phoneNum") String phoneNum, @Param("password") String password);
/* *
* @Description:根据手机号获取加密盐
......@@ -50,14 +50,14 @@ public interface UserDao {
* @Author: Lyc
* @Date: 2022/4/29 19:47
*/
public User selectUserByPhoneNum(String phoneNum);
User selectUserByPhoneNum(String phoneNum);
/**
* @Description: 更改用户信息
* @Param: [user]
* @Return: java.lang.Integer
* @Return: void
* @Author: Lyc
* @Date: 2022/4/30 20:11
*/
public Integer updateUser(User user);
void updateUser(User user);
}
......@@ -26,6 +26,7 @@ public class User {
private String password;
private Date gmtCreate;
private Date gmtModified;
private Date gmtActive;
private long userState;
}
......@@ -47,5 +47,5 @@ public interface UserService {
* @Author: Lyc
* @Date: 2022/4/30 19:45
*/
Integer updateUser(User user);
void updateUser(User user);
}
......@@ -39,8 +39,8 @@ public class UserServiceImp implements UserService {
}
@Override
public Integer updateUser(User user) {
return userDao.updateUser(user);
public void updateUser(User user) {
userDao.updateUser(user);
}
}
......@@ -33,7 +33,7 @@
limit 1
</select>
<select id="updateUser" parameterType="com.nav.pojo.User" resultType="java.lang.Integer">
<update id="updateUser" parameterType="com.nav.pojo.User">
update user
<trim prefix="set" suffixOverrides=",">
<if test="nickname!=null">`nickname` = #{nickname},</if>
......@@ -42,7 +42,8 @@
<if test="profilePicture!=null">`profile_picture` = #{profilePicture},</if>
<if test="userState!=null">`user_state` = #{userState},</if>
<if test="gmtModified!=null">`gmt_modified` = #{gmtModified},</if>
<if test="gmtActive!=null">`gmt_active` = #{gmtActive},</if>
</trim>
where `id` = #{id}
</select>
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册