Former-commit-id: a508ab293543e4c3c695253ef35e35e28a7388a4
Former-commit-id: 6a2314d68afb535383495398b60413ab637808b2
1.0
wanggang 5 years ago
parent b3e40160b2
commit 12df383da0

@ -19,7 +19,7 @@
<div class="form-group row" title="@uihit">
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-2 col-form-label",style= "text-align: right;overflow:hidden;" })
<div class="col-sm-10">
<div class="form-control" style="border-color:transparent;">
<div class="form-control" style="border-color:transparent;height:auto;">
@Html.Display(prop.PropertyName, uihit)
</div>
</div>

@ -1,5 +1,5 @@
@{
var htmlClass = "form-control select2bs4 search";
var htmlClass = "form-control select2bs4 ajax";
var list = (ViewData[ViewData.ModelMetadata.PropertyName + "SelectList"] as SelectList) ?? new SelectList(new List<SelectListItem>());
@Html.DropDownList("", list, "请选择", new { @class = htmlClass })
}

@ -1,4 +1,5 @@
@using System.Reflection
@using System.ComponentModel
@using Microsoft.AspNetCore.Mvc.Controllers
@using Infrastructure.Web.Mvc
@{
@ -13,12 +14,18 @@
<div class="card-body">
@Html.AntiForgeryToken()
<div class="form-group row">
<div class="col-sm-1 col-form-label"></div>
@Html.ValidationSummary(true, "错误:", new { @class = "text-danger col-sm-8" }, "div")
<div class="col-sm-2 col-form-label"></div>
@Html.ValidationSummary(true, "错误:", new { @class = "text-danger col-sm-6" }, "div")
<div class="col-sm-4"></div>
</div>
@foreach (var prop in props)
{
var metadata = prop as Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata;
var isReadOnly = metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(ReadOnlyAttribute));
if (action == "Edit")
{
isReadOnly = isReadOnly || metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(ReadOnlyForEditAttribute));
}
if (scope != null && scope == ControllerScopeType.Organ && prop.PropertyName == "OrganId")
{
@Html.Hidden(prop.PropertyName)
@ -33,9 +40,9 @@
<div class="form-group row @prop.ModelType.Name @uihit">
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-2 col-form-label", style = "text-align: right;overflow:hidden;" })
<div class="col-sm-6">
@if (metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(System.ComponentModel.ReadOnlyAttribute)))
@if (isReadOnly)
{
<div class="form-control" style="border-color:transparent;">
<div class="form-control" style="border-color:transparent;height:auto;">
@Html.Hidden(prop.PropertyName)
@Html.Display(prop.PropertyName, uihit)
</div>

@ -159,24 +159,30 @@ function InitControls() {
theme: "bootstrap4",
language: "zh-CN",
placeholder: '请选择',
//allowClear: true,
//minimumInputLength: 2,
//ajax: {
// url: $(this).attr('data-ajax-url'),
// data: function (params) {
// var query = {
// search: params.term,
// type: 'public'
// }
// return query;
// },
// dataType: 'json',
// processResults: function (data) {
// return {
// results: Enumerable.from(data).select(function (o) { return { id: o.value, text: o.text }; }).toArray()
// };
// }
//}
allowClear: true
});
$('select.select2bs4.ajax').select2({
theme: "bootstrap4",
language: "zh-CN",
placeholder: '请选择',
allowClear: true,
minimumInputLength: 2,
ajax: {
url: $(this).attr('data-ajax-url'),
data: function (params) {
var query = {
search: params.term,
type: 'public'
}
return query;
},
dataType: 'json',
processResults: function (data) {
return {
results: Enumerable.from(data).select(function (o) { return { id: o.value, text: o.text }; }).toArray()
};
}
}
});
//
$('input.cron').each(function () {

@ -14,7 +14,7 @@ namespace IoT.Shared.Application.Domain.Entities
public string CustomType { get; set; }
public string Image { get; set; }
public string Description { get; set; }
public Guid? OrganId { get; set; }
public Guid OrganId { get; set; }
public Organ Organ { get; set; }
public List<BuildingIoTGateway> BuildingIoTGateways { get; set; } = new List<BuildingIoTGateway>();
}

@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations;
namespace IoT.Shared.Application.Domain.Entities
{
[Display(Name = "机构用户")]
[Scope(ScopeAttribute.PlatformAll | ScopeAttribute.OrganAll | ScopeType.UserRead | ScopeType.UserEdit)]
[Scope(ScopeAttribute.PlatformAll | ScopeAttribute.OrganAll | ScopeType.UserRead | ScopeType.UserDelete)]
[Group("基础设置", "Admin")]
public class OrganUser : BaseEntity
{

@ -13,18 +13,18 @@ namespace Platform.Application.Models
[Display(Name = "机构")]
[SelectList]
[ReadOnlyForEdit]
[Required]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public Guid? OrganId { get; set; }
[Display(Name = "用户")]
[ReadOnlyForEdit]
[AjaxSelect("GetUser", "Ajax")]
[Required]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public Guid? UserId { get; set; }
[Display(Name = "类型")]
[DataType("SelectList")]
[Required]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public OrganUserType? Type { get; set; }
[Display(Name = "自定义类型")]

@ -14,6 +14,9 @@ namespace IoT.Shared.Application.Models
[Required(ErrorMessage = nameof(RequiredAttribute))]
[Display(Name = "名称")]
public string Name { get; set; }
[Required(ErrorMessage = nameof(RequiredAttribute))]
[Display(Name = "编号")]
public string Number { get; set; }
[Display(Name = "权限")]
[MultiSelectList]
public List<Guid> Permissions { get; set; } = new List<Guid>();

@ -44,7 +44,8 @@ namespace Platform.Areas.Admin.Controllers
if (model.ParentId.HasValue)
{
var name = this.Repo.ReadOnlyTable()
.Where(o => o.Left < entity.Left && o.Left > 1).ToList()
.Where(o => o.ParentId != null)
.Where(o => o.Left < entity.Left && o.Right > entity.Right).ToList()
.ToList()
.ToTree()
.FirstOrDefault(o => o.Id == model.ParentId.Value)?.GetDisplayName();

@ -50,19 +50,21 @@ namespace Platform.Areas.Admin.Controllers
if (entity.ParentId.HasValue)
{
var name = this.Repo.ReadOnlyTable()
.Where(o => o.Left < entity.Left && o.Left > 1)
.Where(o=>o.ParentId!=null)
.Where(o => o.Left < entity.Left && o.Right > entity.Right)
.ToList()
.ToTree()
.FirstOrDefault(o => o.Id == model.ParentId.Value)?.GetDisplayName();
ViewData.Add(model.ParentId.Value, name);
}
if (entity.OrganId.HasValue)
if (entity != null)
{
var name = this._organRepo.ReadOnlyTable()
.Where(o => o.Left < entity.Left && o.Left > 1)
.Where(o => o.ParentId != null)
.Where(o => o.Left <= entity.Organ.Left && o.Right >= entity.Organ.Right)
.ToList()
.ToTree()
.FirstOrDefault(o => o.Id == entity.OrganId.Value)?.GetDisplayName();
.FirstOrDefault(o => o.Id == entity.OrganId)?.GetDisplayName();
ViewData.Add(model.OrganId, name);
}
}
@ -71,7 +73,10 @@ namespace Platform.Areas.Admin.Controllers
{
base.ToEditModel(entity, model);
this.ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList());
ViewData.SelectList(o => model.ParentId, () => this._ajax.GetOrganBuilding(model.OrganId, model.ParentId).SelectList());
if (model.OrganId.HasValue)
{
ViewData.SelectList(o => model.ParentId, () => this._ajax.GetOrganBuilding(model.OrganId, model.ParentId).SelectList());
}
}
}
}

@ -52,7 +52,8 @@ namespace Platform.Areas.Admin.Controllers
if(model.AreaId.HasValue)
{
var name = this._areaRepo.ReadOnlyTable()
.Where(o => o.Left <= entity.Area.Left && o.Left > 1)
.Where(o => o.ParentId != null)
.Where(o => o.Left <= entity.Area.Left && o.Right > entity.Area.Right)
.ToList()
.ToTree().FirstOrDefault(o => o.Id == model.AreaId.Value)?.GetDisplayName();
ViewData.Add(model.AreaId.Value, name);
@ -60,7 +61,8 @@ namespace Platform.Areas.Admin.Controllers
if(model.ParentId.HasValue)
{
var name = this.Repo.ReadOnlyTable()
.Where(o => o.Left < entity.Left && o.Left > 1)
.Where(o => o.ParentId != null)
.Where(o => o.Left < entity.Left && o.Right > entity.Right)
.ToList()
.ToTree()
.FirstOrDefault(o => o.Id == model.ParentId.Value)?.GetDisplayName();

@ -65,10 +65,7 @@ namespace Platform.Areas.Admin.Controllers
public override void ToEditModel(OrganUser entity, EditOrganUserModel model)
{
this.ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList());
if (model.OrganId.HasValue)
{
ViewData.SelectList(o => model.UserId, () => this._ajax.GetUser(model.OrganId.Value, model.UserId).SelectList());
}
ViewData.SelectList(o => model.UserId, () => this._ajax.GetUser(model.OrganId, model.UserId).SelectList());
if (entity != null)
{
model.Roles = entity.UserRoles.Select(o => o.OrganRoleId).ToList();

@ -28,53 +28,74 @@ namespace Platform
public void OnModelCreating(ModelBuilder modelBuilder)
{
IoTSharedDbConfig.OnModelCreating(modelBuilder);
//
//Admin
//User
modelBuilder.Entity<User>().Property(o => o.UserName).IsRequired();
modelBuilder.Entity<User>().HasIndex(o => o.UserName).IsUnique();
modelBuilder.Entity<User>().HasIndex(o => o.Email).IsUnique();
modelBuilder.Entity<User>().HasIndex(o => o.PhoneNumber).IsUnique();
//OrganRole
modelBuilder.Entity<OrganRole>().Property(o => o.Name).IsRequired();
modelBuilder.Entity<OrganRole>().HasIndex(o => new { o.OrganId, o.Name }).IsUnique();
modelBuilder.Entity<OrganRole>().Property(o => o.Number).IsRequired();
modelBuilder.Entity<OrganRole>().HasIndex(o => new { o.OrganId, o.Number }).IsUnique();
modelBuilder.Entity<OrganRole>().HasOne(o => o.Organ).WithMany(o => o.Roles).HasForeignKey(o => o.OrganId).OnDelete(DeleteBehavior.Cascade);
//Permission
modelBuilder.Entity<Permission>().Property(o => o.Name).IsRequired();
modelBuilder.Entity<Permission>().Property(o => o.Number).IsRequired();
modelBuilder.Entity<Permission>().HasIndex(o => o.Number).IsUnique();
modelBuilder.Entity<Permission>().HasOne(o => o.Category).WithMany(o => o.Permissions).HasForeignKey(o => o.CategoryId).OnDelete(DeleteBehavior.SetNull);
//OrganUserRole
modelBuilder.Entity<OrganUserRole>().HasOne(o => o.OrganUser).WithMany(o => o.UserRoles).HasForeignKey(o => o.OrganUserId);
modelBuilder.Entity<OrganUserRole>().HasOne(o => o.OrganRole).WithMany(o => o.UserRoles).HasForeignKey(o => o.OrganRoleId);
modelBuilder.Entity<OrganUserRole>().HasIndex(o => new { o.OrganUserId, o.OrganRoleId }).IsUnique();
//OrganRolePermission
modelBuilder.Entity<OrganRolePermission>().HasOne(o => o.Role).WithMany(o => o.RolePermissions).HasForeignKey(o => o.RoleId);
modelBuilder.Entity<OrganRolePermission>().HasOne(o => o.Permission).WithMany(o => o.RolePermissions).HasForeignKey(o => o.PermissionId);
modelBuilder.Entity<OrganRolePermission>().HasIndex(o => new { o.RoleId, o.PermissionId }).IsUnique();
//基础设置
//Site
modelBuilder.Entity<Site>().Property(o => o.Name).IsRequired();
modelBuilder.Entity<Site>().HasIndex(o => o.Name).IsUnique();
modelBuilder.Entity<Area>().HasIndex(o => o.Number).IsUnique(); ;
modelBuilder.Entity<Department>().HasIndex(o => new { o.OrganId, o.Number }).IsUnique();
//Area
modelBuilder.Entity<Area>().HasIndex(o => o.Number).IsUnique();
//Organ
modelBuilder.Entity<Organ>().HasIndex(o => o.Name).IsUnique();
modelBuilder.Entity<Organ>().HasIndex(o => o.Number).IsUnique();
modelBuilder.Entity<Organ>().HasOne(o => o.Area).WithMany(o => o.Organs).HasForeignKey(o => o.AreaId).OnDelete(DeleteBehavior.SetNull);
modelBuilder.Entity<Building>().HasIndex(o => o.Number).IsUnique();
modelBuilder.Entity<Building>().HasOne(o => o.Organ).WithMany(o => o.Buildings).HasForeignKey(o => o.OrganId).OnDelete(DeleteBehavior.SetNull);
//Building
modelBuilder.Entity<Building>().Property(o => o.OrganId).IsRequired();
modelBuilder.Entity<Building>().HasIndex(o => new { o.OrganId, o.ParentId, o.Number }).IsUnique();
modelBuilder.Entity<Building>().HasOne(o => o.Organ).WithMany(o => o.Buildings).HasForeignKey(o => o.OrganId);
//OrganUser
modelBuilder.Entity<OrganUser>().HasOne(o => o.Organ).WithMany(o => o.OrganUsers).HasForeignKey(o => o.OrganId);
modelBuilder.Entity<OrganUser>().HasOne(o => o.User).WithMany(o => o.OrganUsers).HasForeignKey(o => o.UserId);
modelBuilder.Entity<OrganUser>().HasIndex(o => new { o.OrganId, o.UserId }).IsUnique();
//Department
modelBuilder.Entity<Department>().HasIndex(o => new { o.OrganId, o.Number }).IsUnique();
//物联网
//IoTCenter
//IoTCommand
modelBuilder.Entity<IoTCommand>().HasOne(o => o.Api).WithMany().HasForeignKey(o => o.ApiId);
//OrganIoTScene
modelBuilder.Entity<OrganIoTScene>().HasOne(o => o.Organ).WithMany(o => o.OrganScenes).HasForeignKey(o => o.OrganId);
//OrganIoTSceneIoTCommand
modelBuilder.Entity<OrganIoTSceneIoTCommand>().HasOne(o => o.OrganScene).WithMany(o => o.OrganSceneCommands).HasForeignKey(o => o.OrganSceneId);
modelBuilder.Entity<OrganIoTSceneIoTCommand>().HasOne(o => o.Command).WithMany().HasForeignKey(o => o.CommandId);
//OrganIoTSceneTimer
modelBuilder.Entity<OrganIoTSceneTimer>().HasOne(o => o.OrganScene).WithMany(o => o.OrganSceneTimers).HasForeignKey(o => o.OrganSceneId);
//OrganIoTSceneTigger
modelBuilder.Entity<OrganIoTSceneTigger>().HasOne(o => o.OrganScene).WithMany(o => o.OrganSceneTiggers).HasForeignKey(o => o.OrganSceneId);
modelBuilder.Entity<OrganIoTSceneTigger>().HasOne(o => o.Data).WithMany().HasForeignKey(o => o.DataId);
//IoTGatewayCategoryIoTGateway
modelBuilder.Entity<IoTGatewayCategoryIoTGateway>().HasOne(o => o.Node).WithMany(o => o.CategoryNodes).HasForeignKey(o => o.NodeId);
modelBuilder.Entity<IoTGatewayCategoryIoTGateway>().HasOne(o => o.Category).WithMany(o => o.CategoryNodes).HasForeignKey(o => o.CategoryId);
modelBuilder.Entity<IoTGatewayCategoryIoTGateway>().HasIndex(o => new { o.CategoryId, o.NodeId }).IsUnique();
modelBuilder.Entity<LiveRecord>().Property(o => o.DeviceNumber).IsRequired();
//BuildingIoTGateway
modelBuilder.Entity<BuildingIoTGateway>().HasOne(o => o.Building).WithMany(o => o.BuildingIoTGateways).HasForeignKey(o => o.BuildingId);
modelBuilder.Entity<BuildingIoTGateway>().HasOne(o => o.IoTGateway).WithMany().HasForeignKey(o => o.IoTGatewayId);
modelBuilder.Entity<BuildingIoTGateway>().HasIndex(o => new { o.BuildingId, o.IoTGatewayId }).IsUnique();
//LiveRecord
modelBuilder.Entity<LiveRecord>().Property(o => o.DeviceNumber).IsRequired();
}
public void Seed(DbContext db)
@ -259,34 +280,36 @@ namespace Platform
db.SaveChanges();
//初始化建筑
var organId = db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao").Id;
var buildingRoot = new Building
{
Name = "建筑",
Number = "root",
OrganId = organRoot.Id,
Children = new List<Building>
{
new Building
{
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Building,
Name="默认建筑",
Number="1",
Children = new List<Building> {
new Building {
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Layer,
Name="1楼",
Number="11",
Children=new List<Building>
{
new Building{
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Room,
Name="101室",
Number="101"
},
new Building{
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Room,
Name="102室",
Number="102"
@ -294,20 +317,20 @@ namespace Platform
}
},
new Building {
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Layer,
Name="2楼",
Number="12",
Children=new List<Building>
{
new Building{
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Room,
Name="201室",
Number="201"
},
new Building{
Organ= db.Set<Organ>().FirstOrDefault(o => o.Number == "xuexiao"),
OrganId=organId,
Type= BuildingType.Room,
Name="202室",
Number="202"
@ -327,10 +350,10 @@ namespace Platform
db.Set<Building>().FirstOrDefault(o => o.Number == "root").Update();
db.SaveChanges();
var organId = db.Set<Organ>().FirstOrDefault(o => o.IsReadOnly).Id;
var superRole = new OrganRole { OrganId = organId, Name = "超级管理员", IsReadOnly = true };
var adminRole = new OrganRole { OrganId = organId, Name = "管理员" };
var organRole = new OrganRole { OrganId = organId, Name = "机构管理员" };
var defaultOrganId = db.Set<Organ>().FirstOrDefault(o => o.IsReadOnly).Id;
var superRole = new OrganRole { OrganId = defaultOrganId,Number="super", Name = "超级管理员", IsReadOnly = true };
var adminRole = new OrganRole { OrganId = defaultOrganId, Number = "admin", Name = "管理员" };
var organRole = new OrganRole { OrganId = defaultOrganId, Number = "organ", Name = "机构管理员" };
//初始化角色
var skips = new string[] {
@ -366,7 +389,7 @@ namespace Platform
new OrganUser {
IsReadOnly=true,
Type= OrganUserType.Type1,
OrganId=organId,
OrganId=defaultOrganId,
UserRoles=new List<OrganUserRole>
{
new OrganUserRole{
@ -394,7 +417,7 @@ namespace Platform
OrganUsers = new List<OrganUser> {
new OrganUser {
Type= OrganUserType.Type1,
OrganId=organId,
OrganId=defaultOrganId,
UserRoles=new List<OrganUserRole>
{
new OrganUserRole{ OrganRoleId=adminRole.Id}
@ -414,7 +437,7 @@ namespace Platform
OrganUsers = new List<OrganUser> {
new OrganUser {
Type= OrganUserType.Type1,
OrganId=organId,
OrganId=defaultOrganId,
UserRoles=new List<OrganUserRole>
{
new OrganUserRole{ OrganRoleId=organRole.Id}

@ -169,11 +169,11 @@ CREATE TABLE `iot_Building` (
`CustomType` longtext CHARACTER SET utf8mb4 NULL,
`Image` longtext CHARACTER SET utf8mb4 NULL,
`Description` longtext CHARACTER SET utf8mb4 NULL,
`OrganId` char(36) NULL,
`OrganId` char(36) NOT NULL,
`AreaId` char(36) NULL,
CONSTRAINT `PK_iot_Building` PRIMARY KEY (`Id`),
CONSTRAINT `FK_iot_Building_iot_Area_AreaId` FOREIGN KEY (`AreaId`) REFERENCES `iot_Area` (`Id`) ON DELETE RESTRICT,
CONSTRAINT `FK_iot_Building_iot_Organ_OrganId` FOREIGN KEY (`OrganId`) REFERENCES `iot_Organ` (`Id`) ON DELETE SET NULL,
CONSTRAINT `FK_iot_Building_iot_Organ_OrganId` FOREIGN KEY (`OrganId`) REFERENCES `iot_Organ` (`Id`) ON DELETE CASCADE,
CONSTRAINT `FK_iot_Building_iot_Building_ParentId` FOREIGN KEY (`ParentId`) REFERENCES `iot_Building` (`Id`) ON DELETE RESTRICT
);
@ -209,8 +209,8 @@ CREATE TABLE `iot_OrganIoTScene` (
CREATE TABLE `iot_OrganRole` (
`Id` char(36) NOT NULL,
`IsDeleted` longtext CHARACTER SET utf8mb4 NULL,
`Name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`Number` longtext CHARACTER SET utf8mb4 NULL,
`Name` longtext CHARACTER SET utf8mb4 NOT NULL,
`Number` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`IsReadOnly` tinyint(1) NOT NULL,
`OrganId` char(36) NOT NULL,
CONSTRAINT `PK_iot_OrganRole` PRIMARY KEY (`Id`),
@ -327,8 +327,8 @@ CREATE TABLE `iot_OrganUserRole` (
CREATE TABLE `iot_Permission` (
`Id` char(36) NOT NULL,
`IsDeleted` longtext CHARACTER SET utf8mb4 NULL,
`Name` longtext CHARACTER SET utf8mb4 NULL,
`Number` varchar(255) CHARACTER SET utf8mb4 NULL,
`Name` longtext CHARACTER SET utf8mb4 NOT NULL,
`Number` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`IsReadOnly` tinyint(1) NOT NULL,
`Type` int NOT NULL,
`CategoryId` char(36) NULL,
@ -453,12 +453,10 @@ CREATE INDEX `IX_iot_Area_ParentId` ON `iot_Area` (`ParentId`);
CREATE INDEX `IX_iot_Building_AreaId` ON `iot_Building` (`AreaId`);
CREATE UNIQUE INDEX `IX_iot_Building_Number` ON `iot_Building` (`Number`);
CREATE INDEX `IX_iot_Building_OrganId` ON `iot_Building` (`OrganId`);
CREATE INDEX `IX_iot_Building_ParentId` ON `iot_Building` (`ParentId`);
CREATE UNIQUE INDEX `IX_iot_Building_OrganId_ParentId_Number` ON `iot_Building` (`OrganId`, `ParentId`, `Number`);
CREATE INDEX `IX_iot_BuildingIoTGateway_IoTGatewayId` ON `iot_BuildingIoTGateway` (`IoTGatewayId`);
CREATE UNIQUE INDEX `IX_iot_BuildingIoTGateway_BuildingId_IoTGatewayId` ON `iot_BuildingIoTGateway` (`BuildingId`, `IoTGatewayId`);
@ -533,7 +531,7 @@ CREATE INDEX `IX_iot_OrganIoTSceneTigger_OrganSceneId` ON `iot_OrganIoTSceneTigg
CREATE INDEX `IX_iot_OrganIoTSceneTimer_OrganSceneId` ON `iot_OrganIoTSceneTimer` (`OrganSceneId`);
CREATE UNIQUE INDEX `IX_iot_OrganRole_OrganId_Name` ON `iot_OrganRole` (`OrganId`, `Name`);
CREATE UNIQUE INDEX `IX_iot_OrganRole_OrganId_Number` ON `iot_OrganRole` (`OrganId`, `Number`);
CREATE INDEX `IX_iot_OrganRolePermission_PermissionId` ON `iot_OrganRolePermission` (`PermissionId`);

Loading…
Cancel
Save