style(代码优化): userId由Long类型改为String类型

This commit is contained in:
MAC 2023-02-15 23:31:23 +08:00
parent c31053087a
commit 6bc4b2dd94
3 changed files with 4 additions and 4 deletions

View File

@ -16,6 +16,6 @@ public class UserRole {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@TableId(type = IdType.AUTO)
private Long userRoleId;
private Long userId;
private String userId;
private Long roleId;
}

View File

@ -10,7 +10,7 @@ import java.util.List;
public interface UserMapper extends BaseMapper<UserBean> {
int insertUser(UserBean userBean);
int insertUserRole(String userId, long roleId);
int insertUserRole(@Param("userId") String userId, @Param("roleId") long roleId);
List<Role> selectRoleListByUserId(@Param("userId") String userId);

View File

@ -11,9 +11,9 @@
VALUES (#{userId}, #{username},#{salt}, #{password}, #{telephone}, #{sex}, #{imageUrl}, #{registerTime}, 1);
</insert>
<insert id="insertUserRole" parameterType="Long">
<insert id="insertUserRole">
INSERT INTO user_role (userId, roleId)
VALUES (#{param1}, #{param2});
VALUES (#{userId}, #{roleId});
</insert>
<select id="selectRoleListByUserId" resultType="com.qiwenshare.file.domain.user.Role">