Browse Source

组织路径、地址路径模糊查询

da-xian 3 months ago
parent
commit
7685f392a2

+ 2 - 0
src/main/java/com/bowintek/smartsearch/vo/query/WellInfoParams.java

@@ -25,4 +25,6 @@ public class WellInfoParams {
     private String project_id;
     private List<String> orgList;
     private List<String> unitList;
+    private String project_path;
+    private String org_path;
 }

+ 12 - 0
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -146,6 +146,12 @@
                 #{unitId}
             </foreach>
         </if>
+        <if test="project_path!='' and project_path!=null">
+            and well.project_path like Concat('%',#{project_path},'%')
+        </if>
+        <if test="org_path!='' and org_path!=null">
+            and well.org_path like Concat('%',#{org_path},'%')
+        </if>
     </select>
 
     <select id="getWellMapList" parameterType="com.bowintek.smartsearch.vo.query.WellInfoParams"
@@ -188,6 +194,12 @@
         <if test="project_id!='' and project_id!=null">
             and well.project_id =#{project_id}
         </if>
+        <if test="project_path!='' and project_path!=null">
+            and well.project_path like Concat('%',#{project_path},'%')
+        </if>
+        <if test="org_path!='' and org_path!=null">
+            and well.org_path like Concat('%',#{org_path},'%')
+        </if>
         order by well.well_common_name
     </select>
 

+ 27 - 18
vue/src/views/wellinfo/index.vue

@@ -133,7 +133,8 @@
                   multiple
                   tree-line
                   :tree-data="filterUnitTree(subjectTrees.constructUnitTree)"
-                  tree-node-filter-prop="label" @change="onUnitTreeChange">
+                  tree-node-filter-prop="label"
+                  @change="onUnitTreeChange">
                 </a-tree-select>
               </a-form-item>
             </a-col>
@@ -712,11 +713,13 @@ export default defineComponent({
     };
     const tabChange = (key) => {
       console.log("tabChange", key);
-      formState.org_id_a1 = '';
-      formState.org_name_a2 = '';
-      formState.project_id = '';
-      formState.orgList = [];
-      formState.unitList = [];
+      // formState.org_id_a1 = '';
+      // formState.org_name_a2 = '';
+      // formState.project_id = '';
+      // formState.orgList = [];
+      // formState.unitList = [];
+      formState.org_path = "";
+      formState.project_path = "";
       if (key == "2") {
         subjectTrees.value.data = Object.assign(subjectTrees.value.constructUnitTree);
       } else {
@@ -826,21 +829,27 @@ export default defineComponent({
       subjectTrees.value.autoExpandParent = false;
     }
     const treeOnSelect = function (selected, selectedNodes, node) {
+      debugger;
       console.log(selected, selectedNodes, node);
-      if (selectedNodes.node.parent != undefined || activeTab.value == "1") {
-        if (activeTab.value == "1") {
-          formState.org_name_a2 = selected.length > 0 ? selectedNodes.node.label : '';
-          // formState.org_id_a1 = selected.length > 0 ? selectedNodes.node.key : '';
-          // formState.orgList = selected.length > 0 ? [formState.org_id_a1] : [];
+      //组织机构
+      if (activeTab.value == "1") {
+        formState.org_path = selected.length > 0 ? selectedNodes.node.label : '';
+        // formState.org_name_a2 = selected.length > 0 ? selectedNodes.node.label : '';
+        // formState.org_id_a1 = selected.length > 0 ? selectedNodes.node.key : '';
+        // formState.orgList = selected.length > 0 ? [formState.org_id_a1] : [];
+
+        onOrgTreeChange();
+      }
 
-          onOrgTreeChange();
-        } else {
-          formState.project_id = selected.length > 0 ? selectedNodes.node.key : '';
-          formState.unitList = selected.length > 0 ? [formState.project_id] : [];
-          onUnitTreeChange();
-        }
-        loadData();
+      //地质单元
+      if (activeTab.value == "2") {
+        formState.project_path = selected.length > 0 ? selectedNodes.node.label : '';
+        // formState.project_id = selected.length > 0 ? selectedNodes.node.key : '';
+        // formState.unitList = selected.length > 0 ? [formState.project_id] : [];
+        onUnitTreeChange();
       }
+
+      loadData();
     }
     const orgUnitList: any = ref([]);
     const unitOrgList: any = ref([]);

+ 2 - 0
vue/src/views/wellinfo/table.ts

@@ -136,6 +136,8 @@ export const formState = reactive({
   orgList: [] as any[],
   unitList: [] as any[],
   org_name_a2: '',
+  org_path: '',
+  project_path: '',
 });
 export const columns: TableColumnsType = [
   {