|
@@ -1,18 +1,20 @@
|
|
|
package cc.iotkit.data.model;
|
|
package cc.iotkit.data.model;
|
|
|
|
|
|
|
|
import cc.iotkit.common.constant.UserConstants;
|
|
import cc.iotkit.common.constant.UserConstants;
|
|
|
|
|
+import cc.iotkit.common.tenant.dao.TenantAware;
|
|
|
|
|
+import cc.iotkit.common.tenant.listener.TenantListener;
|
|
|
import cc.iotkit.model.system.SysDept;
|
|
import cc.iotkit.model.system.SysDept;
|
|
|
import io.github.linpeilie.annotations.AutoMapper;
|
|
import io.github.linpeilie.annotations.AutoMapper;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
import lombok.EqualsAndHashCode;
|
|
|
|
|
+import org.hibernate.annotations.Filter;
|
|
|
|
|
+import org.hibernate.annotations.FilterDef;
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
|
|
|
+import org.hibernate.annotations.ParamDef;
|
|
|
|
|
|
|
|
-import javax.persistence.Entity;
|
|
|
|
|
-import javax.persistence.GeneratedValue;
|
|
|
|
|
-import javax.persistence.Id;
|
|
|
|
|
-import javax.persistence.Table;
|
|
|
|
|
|
|
+import javax.persistence.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 部门表 sys_dept
|
|
* 部门表 sys_dept
|
|
@@ -26,7 +28,10 @@ import javax.persistence.Table;
|
|
|
@Table(name = "sys_dept")
|
|
@Table(name = "sys_dept")
|
|
|
@AutoMapper(target = SysDept.class)
|
|
@AutoMapper(target = SysDept.class)
|
|
|
@ApiModel(value = "部门表")
|
|
@ApiModel(value = "部门表")
|
|
|
-public class TbSysDept extends BaseEntity {
|
|
|
|
|
|
|
+@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "string")})
|
|
|
|
|
+@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
|
|
|
|
|
+@EntityListeners(TenantListener.class)
|
|
|
|
|
+public class TbSysDept extends BaseEntity implements TenantAware {
|
|
|
private static final long serialVersionUID = 1L;
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
/**
|
|
/**
|