Ver Fonte

优化组织架构

zhouhao há 7 anos atrás
pai
commit
d62b9770cd
14 ficheiros alterados com 433 adições e 38 exclusões
  1. 35 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-controller/src/main/java/org/hswebframework/web/controller/organizational/DistrictController.java
  2. 11 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-api/src/main/java/org/hswebframework/web/dao/organizational/DistrictDao.java
  3. 54 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/DistrictMapper.xml
  4. 12 12
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/OrganizationalMapper.xml
  5. 125 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/DistrictEntity.java
  6. 2 2
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/OrganizationalEntity.java
  7. 138 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleDistrictEntity.java
  8. 3 3
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleOrganizationalEntity.java
  9. 0 14
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/authorization/AreaAttachEntity.java
  10. 14 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/authorization/DistrictAttachEntity.java
  11. 13 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-api/src/main/java/org/hswebframework/web/service/organizational/DistrictService.java
  12. 2 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-simple/src/main/java/org/hswebframework/web/service/organizational/simple/SimpleOrganizationalService.java
  13. 9 7
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-simple/src/main/java/org/hswebframework/web/service/organizational/simple/SimplePersonService.java
  14. 15 0
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/src/main/resources/hsweb-starter.js

+ 35 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-controller/src/main/java/org/hswebframework/web/controller/organizational/DistrictController.java

@@ -0,0 +1,35 @@
+package org.hswebframework.web.controller.organizational;
+
+import org.hswebframework.web.authorization.annotation.Authorize;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.SimpleGenericEntityController;
+import org.hswebframework.web.entity.organizational.DistrictEntity;
+import org.hswebframework.web.logging.AccessLogger;
+import  org.hswebframework.web.service.organizational.DistrictService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *  表单发布日志
+ *
+ * @author hsweb-generator-online
+ */
+@RestController
+@RequestMapping("${hsweb.web.mappings.district:district}")
+@Authorize(permission = "district")
+@AccessLogger("行政区域")
+public class DistrictController implements SimpleGenericEntityController<DistrictEntity, String, QueryParamEntity> {
+
+    private DistrictService districtService;
+  
+    @Autowired
+    public void setDistrictService(DistrictService districtService) {
+        this.districtService = districtService;
+    }
+  
+    @Override
+    public DistrictService getService() {
+        return districtService;
+    }
+}

+ 11 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-api/src/main/java/org/hswebframework/web/dao/organizational/DistrictDao.java

@@ -0,0 +1,11 @@
+package org.hswebframework.web.dao.organizational;
+
+import org.hswebframework.web.dao.CrudDao;
+import org.hswebframework.web.entity.organizational.DistrictEntity;
+
+/**
+*  表单发布日志 DAO接口
+*  @author hsweb-generator-online
+ */
+public interface DistrictDao extends CrudDao<DistrictEntity,String> {
+}

+ 54 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/DistrictMapper.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hswebframework.web.dao.organizational.DistrictDao">
+    <resultMap id="DistrictResultMap" type="org.hswebframework.web.entity.organizational.DistrictEntity">
+        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="fullName" column="full_name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="levelName" column="level_name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="levelCode" column="level_code" javaType="String" jdbcType="VARCHAR"/>
+        <result property="code" column="code" javaType="String" jdbcType="VARCHAR"/>
+        <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>
+        <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
+        <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
+    </resultMap>
+
+    <!--用于动态生成sql所需的配置-->
+    <sql id="config">
+        <bind name="resultMapId" value="'DistrictResultMap'"/>
+        <bind name="tableName" value="'s_district'"/>
+    </sql>
+
+    <insert id="insert" parameterType="org.hswebframework.web.entity.organizational.DistrictEntity">
+        <include refid="config"/>
+        <include refid="BasicMapper.buildInsertSql"/>
+    </insert>
+
+    <delete id="deleteByPk" parameterType="String">
+        delete from s_district where u_id =#{id}
+    </delete>
+
+    <delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
+        <include refid="config"/>
+        <include refid="BasicMapper.buildDeleteSql"/>
+    </delete>
+
+    <update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
+        <include refid="config"/>
+        <include refid="BasicMapper.buildUpdateSql"/>
+    </update>
+
+    <select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="DistrictResultMap">
+        <include refid="config"/>
+        <include refid="BasicMapper.buildSelectSql"/>
+    </select>
+
+    <select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
+        <include refid="config"/>
+        <include refid="BasicMapper.buildTotalSql"/>
+    </select>
+</mapper>

+ 12 - 12
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/OrganizationalMapper.xml

@@ -19,17 +19,17 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.hswebframework.web.dao.organizational.OrganizationalDao">
-    <resultMap id="OrganizationalResultMap" type="org.hswebframework.web.entity.organizational.SimpleOrganizationalEntity">
+    <resultMap id="OrganizationalResultMap" type="org.hswebframework.web.entity.organizational.OrganizationalEntity">
         <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-            <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-            <result property="fullName" column="full_name" javaType="String" jdbcType="VARCHAR"/>
-            <result property="code" column="code" javaType="String" jdbcType="VARCHAR"/>
-            <result property="optionalRoles" column="optional_roles" javaType="java.util.List" jdbcType="CLOB"/>
-            <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
-            <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>
-            <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
-            <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
-            <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="fullName" column="full_name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="code" column="code" javaType="String" jdbcType="VARCHAR"/>
+        <result property="optionalRoles" column="optional_roles" javaType="java.util.List" jdbcType="CLOB"/>
+        <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>
+        <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
+        <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
     </resultMap>
 
     <!--用于动态生成sql所需的配置-->
@@ -37,8 +37,8 @@
         <bind name="resultMapId" value="'OrganizationalResultMap'"/>
         <bind name="tableName" value="'S_ORGANIZATION'"/>
     </sql>
-  
-    <insert id="insert" parameterType="org.hswebframework.web.entity.organizational.SimpleOrganizationalEntity" >
+
+    <insert id="insert" parameterType="org.hswebframework.web.entity.organizational.OrganizationalEntity">
         <include refid="config"/>
         <include refid="BasicMapper.buildInsertSql"/>
     </insert>

+ 125 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/DistrictEntity.java

@@ -0,0 +1,125 @@
+package org.hswebframework.web.entity.organizational;
+
+import org.hswebframework.web.commons.entity.GenericEntity;
+import org.hswebframework.web.commons.entity.TreeSortSupportEntity;
+
+import java.util.List;
+
+/**
+ * 行政区域 实体
+ *
+ * @author hsweb-generator-online
+ */
+public interface DistrictEntity extends TreeSortSupportEntity<String> {
+ /*-------------------------------------------
+    |               属性名常量               |
+    ===========================================*/
+    /**
+     * 区域名称,如重庆市
+     */
+    String name      = "name";
+    /**
+     * 区域全程,如重庆市江津区
+     */
+    String fullName  = "fullName";
+    /**
+     * 区域级别名称,如:省
+     */
+    String levelName = "levelName";
+    /**
+     * 区域级别编码,如:province
+     */
+    String levelCode = "levelCode";
+    /**
+     * 行政区域代码,如:500000
+     */
+    String code      = "code";
+    /**
+     * 树路径,如: asb3-lsat
+     */
+    String path      = "path";
+    /**
+     * 说明
+     */
+    String describe  = "describe";
+    /**
+     * 状态
+     */
+    String status    = "status";
+
+    /**
+     * @return 区域名称, 如重庆市
+     */
+    String getName();
+
+    /**
+     * @param name 区域名称,如重庆市
+     */
+    void setName(String name);
+
+    /**
+     * @return 区域全称, 如重庆市江津区
+     */
+    String getFullName();
+
+    /**
+     * @param fullName 区域全程,如重庆市江津区
+     */
+    void setFullName(String fullName);
+
+    /**
+     * @return 区域级别名称, 如:省
+     */
+    String getLevelName();
+
+    /**
+     * @param levelName 区域级别名称,如:省
+     */
+    void setLevelName(String levelName);
+
+    /**
+     * @return 区域级别编码, 如:province
+     */
+    String getLevelCode();
+
+    /**
+     * @param levelCode 区域级别编码,如:province
+     */
+    void setLevelCode(String levelCode);
+
+    /**
+     * @return 行政区域代码, 如:500000
+     */
+    String getCode();
+
+    /**
+     * @param code 行政区域代码,如:500000
+     */
+    void setCode(String code);
+
+
+    /**
+     * @return 说明
+     */
+    String getDescribe();
+
+    /**
+     * @param describe 说明
+     */
+    void setDescribe(String describe);
+
+    /**
+     * @return 状态
+     */
+    Byte getStatus();
+
+    /**
+     * @param status 状态
+     */
+    void setStatus(Byte status);
+
+    void setChildren(List<DistrictEntity> children);
+
+    List<DistrictEntity> getChildren();
+
+}

+ 2 - 2
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/OrganizationalEntity.java

@@ -17,7 +17,7 @@
 package org.hswebframework.web.entity.organizational;
 
 import org.hswebframework.web.commons.entity.TreeSortSupportEntity;
-import org.hswebframework.web.entity.organizational.authorization.AreaAttachEntity;
+import org.hswebframework.web.entity.organizational.authorization.DistrictAttachEntity;
 import org.hswebframework.web.entity.organizational.authorization.OrgAttachEntity;
 
 import java.util.List;
@@ -27,7 +27,7 @@ import java.util.List;
  *
  * @author hsweb-generator-online
  */
-public interface OrganizationalEntity extends TreeSortSupportEntity<String>, AreaAttachEntity, OrgAttachEntity {
+public interface OrganizationalEntity extends TreeSortSupportEntity<String>, DistrictAttachEntity, OrgAttachEntity {
  /*-------------------------------------------
     |               属性名常量               |
     ===========================================*/

+ 138 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleDistrictEntity.java

@@ -0,0 +1,138 @@
+package org.hswebframework.web.entity.organizational;
+
+import org.hswebframework.web.commons.entity.SimpleGenericEntity;
+import org.hswebframework.web.commons.entity.SimpleTreeSortSupportEntity;
+
+import java.util.List;
+
+/**
+ * 表单发布日志
+ *
+ * @author hsweb-generator-online
+ */
+public class SimpleDistrictEntity extends SimpleTreeSortSupportEntity<String> implements DistrictEntity {
+    //区域名称,如重庆市
+    private String name;
+    //区域全程,如重庆市江津区
+    private String fullName;
+    //区域级别名称,如:省
+    private String levelName;
+    //区域级别编码,如:province
+    private String levelCode;
+    //行政区域代码,如:500000
+    private String code;
+    //说明
+    private String describe;
+    //状态
+    private Byte   status;
+
+    private List<DistrictEntity> children;
+
+    /**
+     * @return 区域名称, 如重庆市
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * @param name 区域名称,如重庆市
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return 区域全称, 如重庆市江津区
+     */
+    public String getFullName() {
+        return this.fullName;
+    }
+
+    /**
+     * @param fullName 区域全称,如重庆市江津区
+     */
+    public void setFullName(String fullName) {
+        this.fullName = fullName;
+    }
+
+    /**
+     * @return 区域级别名称, 如:省
+     */
+    public String getLevelName() {
+        return this.levelName;
+    }
+
+    /**
+     * @param levelName 区域级别名称,如:省
+     */
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    /**
+     * @return 区域级别编码, 如:province
+     */
+    public String getLevelCode() {
+        return this.levelCode;
+    }
+
+    /**
+     * @param levelCode 区域级别编码,如:province
+     */
+    public void setLevelCode(String levelCode) {
+        this.levelCode = levelCode;
+    }
+
+    /**
+     * @return 行政区域代码, 如:500000
+     */
+    public String getCode() {
+        return this.code;
+    }
+
+    /**
+     * @param code 行政区域代码,如:500000
+     */
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    /**
+     * @return 说明
+     */
+    public String getDescribe() {
+        return this.describe;
+    }
+
+    /**
+     * @param describe 说明
+     */
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    /**
+     * @return 状态
+     */
+    public Byte getStatus() {
+        return this.status;
+    }
+
+    /**
+     * @param status 状态
+     */
+    public void setStatus(Byte status) {
+        this.status = status;
+    }
+
+    @Override
+    public List<DistrictEntity> getChildren() {
+        return children;
+    }
+
+    @Override
+    public void setChildren(List<DistrictEntity> children) {
+        this.children = children;
+    }
+}

+ 3 - 3
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleOrganizationalEntity.java

@@ -42,13 +42,13 @@ public class SimpleOrganizationalEntity extends SimpleTreeSortSupportEntity<Stri
     private String areaId;
 
     @Override
-    public String getAreaId() {
+    public String getDistrictId() {
         return areaId;
     }
 
     @Override
-    public void setAreaId(String areaId) {
-        this.areaId = areaId;
+    public void setDistrictId(String districtId) {
+        this.areaId = districtId;
     }
 
     /**

+ 0 - 14
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/authorization/AreaAttachEntity.java

@@ -1,14 +0,0 @@
-package org.hswebframework.web.entity.organizational.authorization;
-
-import org.hswebframework.web.commons.entity.Entity;
-
-/**
- * @author zhouhao
- */
-public interface AreaAttachEntity extends Entity {
-    String areaId = "areaId";
-
-    String getAreaId();
-
-    void setAreaId(String areaId);
-}

+ 14 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/authorization/DistrictAttachEntity.java

@@ -0,0 +1,14 @@
+package org.hswebframework.web.entity.organizational.authorization;
+
+import org.hswebframework.web.commons.entity.Entity;
+
+/**
+ * @author zhouhao
+ */
+public interface DistrictAttachEntity extends Entity {
+    String districtId = "districtId";
+
+    String getDistrictId();
+
+    void setDistrictId(String districtId);
+}

+ 13 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-api/src/main/java/org/hswebframework/web/service/organizational/DistrictService.java

@@ -0,0 +1,13 @@
+package org.hswebframework.web.service.organizational;
+
+import org.hswebframework.web.entity.organizational.DistrictEntity;
+import org.hswebframework.web.service.CrudService;
+
+/**
+ *  表单发布日志 服务类
+ *
+ * @author hsweb-generator-online
+ */
+public interface DistrictService extends CrudService<DistrictEntity, String> {
+
+}

+ 2 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-simple/src/main/java/org/hswebframework/web/service/organizational/simple/SimpleOrganizationalService.java

@@ -16,9 +16,11 @@
  */
 package org.hswebframework.web.service.organizational.simple;
 
+import com.alibaba.fastjson.JSON;
 import org.hswebframework.web.commons.entity.GenericEntity;
 import org.hswebframework.web.dao.organizational.OrganizationalDao;
 import org.hswebframework.web.entity.organizational.OrganizationalEntity;
+import org.hswebframework.web.entity.organizational.SimpleOrganizationalEntity;
 import org.hswebframework.web.id.IDGenerator;
 import org.hswebframework.web.service.AbstractTreeSortService;
 import org.hswebframework.web.service.GenericEntityService;

+ 9 - 7
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-service/hsweb-system-organizational-service-simple/src/main/java/org/hswebframework/web/service/organizational/simple/SimplePersonService.java

@@ -24,10 +24,10 @@ import org.hswebframework.web.entity.authorization.UserEntity;
 import org.hswebframework.web.entity.authorization.bind.BindRoleUserEntity;
 import org.hswebframework.web.entity.organizational.*;
 import org.hswebframework.web.id.IDGenerator;
+import org.hswebframework.web.organizational.authorization.Personnel;
 import org.hswebframework.web.organizational.authorization.PersonnelAuthorization;
 import org.hswebframework.web.organizational.authorization.PersonnelAuthorizationManager;
 import org.hswebframework.web.organizational.authorization.TreeNode;
-import org.hswebframework.web.organizational.authorization.simple.SimplePersonnel;
 import org.hswebframework.web.organizational.authorization.simple.SimplePersonnelAuthorization;
 import org.hswebframework.web.service.DefaultDSLQueryService;
 import org.hswebframework.web.service.EnableCacheGenericEntityService;
@@ -219,12 +219,14 @@ public class SimplePersonService extends EnableCacheGenericEntityService<PersonE
         PersonEntity entity = selectByPk(personId);
         assertNotNull(entity);
 
-        SimplePersonnel personnel = new SimplePersonnel();
-        personnel.setId(entity.getId());
-        personnel.setEmail(entity.getEmail());
-        personnel.setName(entity.getName());
-        personnel.setPhone(entity.getPhone());
-        personnel.setPhoto(entity.getPhoto());
+//        SimplePersonnel personnel = new SimplePersonnel();
+//        personnel.setId(entity.getId());
+//        personnel.setEmail(entity.getEmail());
+//        personnel.setName(entity.getName());
+//        personnel.setPhone(entity.getPhone());
+//        personnel.setPhoto(entity.getPhoto());
+        Personnel personnel = entityFactory.newInstance(Personnel.class, SimplePositionEntity.class);
+        entityFactory.copyProperties(entity, personnel);
         authorization.setPersonnel(personnel);
 
         // 获取用户的职位ID集合(多个职位)

+ 15 - 0
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/src/main/resources/hsweb-starter.js

@@ -36,11 +36,26 @@ var versions = [
 var JDBCType = java.sql.JDBCType;
 function install(context) {
     var database = context.database;
+    database.createOrAlter("s_district")
+        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
+        .addColumn().name("name").alias("name").comment("区域名称,如重庆市").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("full_name").alias("fullName").comment("区域全程,如重庆市江津区").jdbcType(java.sql.JDBCType.VARCHAR).length(512).commit()
+        .addColumn().name("level_name").alias("levelName").comment("区域级别名称,如:省").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("level_code").alias("levelCode").comment("区域级别编码,如:province").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("code").alias("code").comment("行政区域代码,如:500000").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("parent_id").alias("parentId").comment("父级行政区域").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("path").alias("path").comment("树路径,如: asb3-lsat").jdbcType(java.sql.JDBCType.VARCHAR).length(3000).commit()
+        .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(65535, 32767).commit()
+        .addColumn().name("sort_index").alias("sortIndex").comment("排序索引").jdbcType(java.sql.JDBCType.DECIMAL).length(65535, 32767).commit()
+        .comment("行政区域").commit();
+
     database.createOrAlter("s_organization")
         .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
         .addColumn().name("name").alias("name").comment("名称").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("full_name").alias("fullName").comment("全称").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
         .addColumn().name("code").alias("code").comment("机构编码").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("district_id").alias("districtId").comment("所在行政区域ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("optional_roles").alias("optionalRoles").comment("可选角色").jdbcType(java.sql.JDBCType.CLOB).commit()
         .addColumn().name("parent_id").alias("parentId").comment("上级机构id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("path").alias("path").comment("树定位码").jdbcType(java.sql.JDBCType.VARCHAR).length(1024).commit()