package com.xdap.self_development.domain.view;

import com.definesys.mpaas.query.annotation.SQL;
import com.definesys.mpaas.query.annotation.SQLQuery;
import lombok.Data;

@SQLQuery(value = {
        @SQL(view = "selectRoleAndPerInfo",
                sql = "SELECT r.id AS roleId, r.role_name AS roleName, r.role_name AS role_Name, r.role_code AS roleCode, r.role_description AS roleDescription, dur.user_or_dep AS userOrDep, dur.user_or_dep AS user_Or_Dep , dur.is_dep AS isDep, mp.permission_path AS permissionPath, mp.parameter_per as parameterPer FROM yfsjglpt_model_roles r LEFT JOIN yfsjglpt_model_dep_user_role dur ON r.id = dur.role_id LEFT JOIN yfsjglpt_model_role_permission rp ON dur.role_id = rp.role_id LEFT JOIN yfsjglpt_model_menu_parameter mp ON mp.id = rp.per_id WHERE r.is_enabled = 1 and dur.is_enable = 1 and (rp.is_enable is null or rp.is_enable = 1)")
})
@Data
public class RoleAndPreView {
    // 角色相关
    // 角色Id
    private String roleId;
    // 角色名称
    private String roleName;
    // 角色描述
    private String roleDescription;

    // 关联相关
    // 用户或部门ID
    private String userOrDep;
    // 是否是部门,0：个人；1：部门
    private Integer isDep;

    // 权限相关
    // 参数权限
    private Integer parameterPer;
    // 权限路径
    private String permissionPath;
}
