瀏覽代碼

字典排序

liuyc 2 年之前
父節點
當前提交
3dd4eb2260

+ 20 - 18
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -56,6 +56,7 @@
         <result column="primaryKeyId" property="primaryKeyId"/>
         <result column="nodeType" property="nodeType"/>
         <result column="isExistForm" property="isExistForm"/>
+        <result column="majorDataType" property="majorDataType"/>
     </resultMap>
     <insert id="insertCombination1">
         INSERT INTO m_wbs_tree_private(p_key_id, id, wbs_id, wbs_type, project_id, tenant_id, parent_id, ancestors,
@@ -268,36 +269,37 @@
 
     <select id="lazyTree" resultMap="treeNodeResultMap">
         SELECT
-        dept.p_key_id as "primaryKeyId",
-        dept.type AS "type",
-        dept.table_type,
-        dept.id,
-        dept.parent_id,
-        dept.node_name AS title,
-        dept.node_type AS "nodeType",
-        dept.id AS "value",
-        dept.id AS "key",
-        dept.is_exist_form AS "isExistForm",
+        d.p_key_id as "primaryKeyId",
+        d.type AS "type",
+        d.table_type,
+        d.id,
+        d.parent_id,
+        d.node_name AS title,
+        d.node_type AS "nodeType",
+        d.id AS "value",
+        d.id AS "key",
+        d.major_data_type AS "majorDataType",
+        d.is_exist_form AS "isExistForm",
         (
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
         FROM
         m_wbs_tree_private
         WHERE
-        parent_id = dept.id and is_deleted = 0
+        parent_id = d.id and is_deleted = 0
         ) AS "has_children"
         FROM
-        m_wbs_tree_private dept
+        m_wbs_tree_private d
         WHERE
-        dept.parent_id = #{parentId} AND dept.is_deleted = 0
+        d.parent_id = #{parentId} AND d.is_deleted = 0
         <if test="tenantId!=null and tenantId!=''">
-            and dept.tenant_id = #{tenantId}
+            and d.tenant_id = #{tenantId}
         </if>
-        AND dept.project_id = #{projectId}
-        AND dept.wbs_id = #{wbsId}
-        AND dept.type = 1
+        AND d.project_id = #{projectId}
+        AND d.wbs_id = #{wbsId}
+        AND d.type = 1
         AND status = 1
-        ORDER BY dept.sort
+        ORDER BY d.sort
     </select>
 
 

+ 1 - 0
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml

@@ -42,6 +42,7 @@
             and parent_id > 0
         </if>
         and is_sealed = 0 and is_deleted = 0
+        order by sort
     </select>
 
     <select id="tree" resultMap="treeNodeResultMap">

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml

@@ -40,7 +40,7 @@
     </select>-->
 
     <select id="getList" resultMap="dictResultMap">
-        select id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0
+        select id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0 order by sort
     </select>
 
     <select id="tree" resultMap="treeNodeResultMap">