新增角色编码字段

This commit is contained in:
阿沐 2023-08-09 23:26:26 +08:00
parent 7a176f40fb
commit bf5a15add3
3 changed files with 13 additions and 0 deletions

View File

@ -23,6 +23,10 @@ public class SysRoleEntity extends BaseEntity {
*/ */
private String name; private String name;
/** /**
* 角色编码
*/
private String roleCode;
/**
* 备注 * 备注
*/ */
private String remark; private String remark;

View File

@ -27,6 +27,10 @@ public class SysRoleVO implements Serializable {
@Schema(description = "角色名称") @Schema(description = "角色名称")
@NotBlank(message = "角色名称不能为空") @NotBlank(message = "角色名称不能为空")
private String name; private String name;
@Schema(description = "角色编码")
@NotBlank(message = "角色编码不能为空")
private String roleCode;
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;

View File

@ -8,4 +8,9 @@
where t1.id = t2.role_id and t2.user_id = #{userId} and t1.deleted = 0 and t2.deleted = 0 where t1.id = t2.role_id and t2.user_id = #{userId} and t1.deleted = 0 and t2.deleted = 0
</select> </select>
<select id="geRoleCodeByUserId" resultType="string">
select t1.role_code from sys_role t1, sys_user_role t2
where t1.id = t2.role_id and t2.user_id = #{userId} and t1.deleted = 0 and t2.deleted = 0
</select>
</mapper> </mapper>