Kaynağa Gözat

领域检索优化

xiaoqiao 2 ay önce
ebeveyn
işleme
2aea927c17

+ 4 - 0
src/main/java/com/bowintek/practice/controller/QueryLogController.java

@@ -47,4 +47,8 @@ public class QueryLogController {
     public BaseResponse save(@RequestBody EsQueryLogVo model) {
         return RespGenerstor.success(queryLogService.save(model.getQueryText(), accountService.getLoginUserID()));
     }
+    @GetMapping("/getRelationLogList")
+    public BaseResponse getRelationLogList(String well_common_name) {
+        return RespGenerstor.success(queryLogService.getRelationLogList(well_common_name));
+    }
 }

+ 22 - 0
src/main/java/com/bowintek/practice/mapper/EsRelationLogMapper.java

@@ -0,0 +1,22 @@
+package com.bowintek.practice.mapper;
+
+import com.bowintek.practice.model.EsRelationLog;
+import com.bowintek.practice.model.EsRelationLogExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface EsRelationLogMapper {
+    long countByExample(EsRelationLogExample example);
+
+    int deleteByExample(EsRelationLogExample example);
+
+    int insert(EsRelationLog row);
+
+    int insertSelective(EsRelationLog row);
+
+    List<EsRelationLog> selectByExample(EsRelationLogExample example);
+
+    int updateByExampleSelective(@Param("row") EsRelationLog row, @Param("example") EsRelationLogExample example);
+
+    int updateByExample(@Param("row") EsRelationLog row, @Param("example") EsRelationLogExample example);
+}

+ 43 - 0
src/main/java/com/bowintek/practice/model/EsRelationLog.java

@@ -0,0 +1,43 @@
+package com.bowintek.practice.model;
+
+public class EsRelationLog {
+    private String well_common_name;
+
+    private String well_type;
+
+    private String linked_well;
+
+    private String project_name;
+
+    public String getWell_common_name() {
+        return well_common_name;
+    }
+
+    public void setWell_common_name(String well_common_name) {
+        this.well_common_name = well_common_name == null ? null : well_common_name.trim();
+    }
+
+    public String getWell_type() {
+        return well_type;
+    }
+
+    public void setWell_type(String well_type) {
+        this.well_type = well_type == null ? null : well_type.trim();
+    }
+
+    public String getLinked_well() {
+        return linked_well;
+    }
+
+    public void setLinked_well(String linked_well) {
+        this.linked_well = linked_well == null ? null : linked_well.trim();
+    }
+
+    public String getProject_name() {
+        return project_name;
+    }
+
+    public void setProject_name(String project_name) {
+        this.project_name = project_name == null ? null : project_name.trim();
+    }
+}

+ 479 - 0
src/main/java/com/bowintek/practice/model/EsRelationLogExample.java

@@ -0,0 +1,479 @@
+package com.bowintek.practice.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EsRelationLogExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public EsRelationLogExample() {
+        oredCriteria = new ArrayList<>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andWell_common_nameIsNull() {
+            addCriterion("well_common_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameIsNotNull() {
+            addCriterion("well_common_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameEqualTo(String value) {
+            addCriterion("well_common_name =", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameNotEqualTo(String value) {
+            addCriterion("well_common_name <>", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameGreaterThan(String value) {
+            addCriterion("well_common_name >", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameGreaterThanOrEqualTo(String value) {
+            addCriterion("well_common_name >=", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameLessThan(String value) {
+            addCriterion("well_common_name <", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameLessThanOrEqualTo(String value) {
+            addCriterion("well_common_name <=", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameLike(String value) {
+            addCriterion("well_common_name like", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameNotLike(String value) {
+            addCriterion("well_common_name not like", value, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameIn(List<String> values) {
+            addCriterion("well_common_name in", values, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameNotIn(List<String> values) {
+            addCriterion("well_common_name not in", values, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameBetween(String value1, String value2) {
+            addCriterion("well_common_name between", value1, value2, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_common_nameNotBetween(String value1, String value2) {
+            addCriterion("well_common_name not between", value1, value2, "well_common_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeIsNull() {
+            addCriterion("well_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeIsNotNull() {
+            addCriterion("well_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeEqualTo(String value) {
+            addCriterion("well_type =", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeNotEqualTo(String value) {
+            addCriterion("well_type <>", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeGreaterThan(String value) {
+            addCriterion("well_type >", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeGreaterThanOrEqualTo(String value) {
+            addCriterion("well_type >=", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeLessThan(String value) {
+            addCriterion("well_type <", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeLessThanOrEqualTo(String value) {
+            addCriterion("well_type <=", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeLike(String value) {
+            addCriterion("well_type like", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeNotLike(String value) {
+            addCriterion("well_type not like", value, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeIn(List<String> values) {
+            addCriterion("well_type in", values, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeNotIn(List<String> values) {
+            addCriterion("well_type not in", values, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeBetween(String value1, String value2) {
+            addCriterion("well_type between", value1, value2, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andWell_typeNotBetween(String value1, String value2) {
+            addCriterion("well_type not between", value1, value2, "well_type");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellIsNull() {
+            addCriterion("linked_well is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellIsNotNull() {
+            addCriterion("linked_well is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellEqualTo(String value) {
+            addCriterion("linked_well =", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellNotEqualTo(String value) {
+            addCriterion("linked_well <>", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellGreaterThan(String value) {
+            addCriterion("linked_well >", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellGreaterThanOrEqualTo(String value) {
+            addCriterion("linked_well >=", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellLessThan(String value) {
+            addCriterion("linked_well <", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellLessThanOrEqualTo(String value) {
+            addCriterion("linked_well <=", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellLike(String value) {
+            addCriterion("linked_well like", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellNotLike(String value) {
+            addCriterion("linked_well not like", value, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellIn(List<String> values) {
+            addCriterion("linked_well in", values, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellNotIn(List<String> values) {
+            addCriterion("linked_well not in", values, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellBetween(String value1, String value2) {
+            addCriterion("linked_well between", value1, value2, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andLinked_wellNotBetween(String value1, String value2) {
+            addCriterion("linked_well not between", value1, value2, "linked_well");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameIsNull() {
+            addCriterion("project_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameIsNotNull() {
+            addCriterion("project_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameEqualTo(String value) {
+            addCriterion("project_name =", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameNotEqualTo(String value) {
+            addCriterion("project_name <>", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameGreaterThan(String value) {
+            addCriterion("project_name >", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameGreaterThanOrEqualTo(String value) {
+            addCriterion("project_name >=", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameLessThan(String value) {
+            addCriterion("project_name <", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameLessThanOrEqualTo(String value) {
+            addCriterion("project_name <=", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameLike(String value) {
+            addCriterion("project_name like", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameNotLike(String value) {
+            addCriterion("project_name not like", value, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameIn(List<String> values) {
+            addCriterion("project_name in", values, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameNotIn(List<String> values) {
+            addCriterion("project_name not in", values, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameBetween(String value1, String value2) {
+            addCriterion("project_name between", value1, value2, "project_name");
+            return (Criteria) this;
+        }
+
+        public Criteria andProject_nameNotBetween(String value1, String value2) {
+            addCriterion("project_name not between", value1, value2, "project_name");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 10 - 3
src/main/java/com/bowintek/practice/services/impl/QueryLogServiceImpl.java

@@ -2,10 +2,9 @@ package com.bowintek.practice.services.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.bowintek.practice.mapper.EsQueryLogMapper;
+import com.bowintek.practice.mapper.EsRelationLogMapper;
 import com.bowintek.practice.mapper.cquery.EsQueryLogCQuery;
-import com.bowintek.practice.model.CfPosition;
-import com.bowintek.practice.model.EsQueryKeyword;
-import com.bowintek.practice.model.EsQueryLog;
+import com.bowintek.practice.model.*;
 import com.bowintek.practice.services.service.QueryLogService;
 import com.bowintek.practice.vo.EsQueryLogVo;
 import com.bowintek.practice.vo.PositionModel;
@@ -24,6 +23,8 @@ public class QueryLogServiceImpl implements QueryLogService {
     private EsQueryLogCQuery esQueryLogCQuery;
     @Autowired
     private EsQueryLogMapper esQueryLogMapper;
+    @Autowired
+    private EsRelationLogMapper esRelationLogMapper;
 
     private static Object lockObject = new Object();
     private static List<EsQueryLogVo> queryTextCache = null;
@@ -69,4 +70,10 @@ public class QueryLogServiceImpl implements QueryLogService {
 
         return esQueryLogMapper.insert(log);
     }
+    @Override
+    public List<EsRelationLog> getRelationLogList(String well_common_name){
+        EsRelationLogExample example=new EsRelationLogExample();
+        example.or().andWell_common_nameEqualTo(well_common_name);
+        return  esRelationLogMapper.selectByExample(example);
+    }
 }

+ 2 - 0
src/main/java/com/bowintek/practice/services/service/QueryLogService.java

@@ -1,5 +1,6 @@
 package com.bowintek.practice.services.service;
 
+import com.bowintek.practice.model.EsRelationLog;
 import com.bowintek.practice.vo.Analyze.ComparisonResult;
 import com.bowintek.practice.vo.EsQueryLogVo;
 import com.github.pagehelper.PageInfo;
@@ -11,4 +12,5 @@ public interface QueryLogService {
     List<EsQueryLogVo> getHotspotList(Integer maxRows);
     List<EsQueryLogVo> getQueryList(String queryText);
     int save(String queryText, String userId);
+    List<EsRelationLog> getRelationLogList(String well_common_name);
 }

+ 1 - 3
src/main/resources/generatorConfig.xml

@@ -118,8 +118,6 @@
             <columnOverride column="StandardMajorID" javaType="java.lang.Integer" jdbcType="INTEGER" />
             <table schema="" tableName="Sys_Log"><property name="useActualColumnNames" value="true"/></table>
         </table>-->
-        <table schema="" tableName="cf_apply_form"><property name="useActualColumnNames" value="true"/></table>
-        <table schema="" tableName="cf_apply_form_reviewer"><property name="useActualColumnNames" value="true"/></table>
-        <table schema="" tableName="cf_apply_form_well_file"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="es_relation_log"><property name="useActualColumnNames" value="true"/></table>
     </context>
 </generatorConfiguration>

+ 164 - 0
src/main/resources/mapping/EsRelationLogMapper.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bowintek.practice.mapper.EsRelationLogMapper">
+  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.EsRelationLog">
+    <result column="well_common_name" jdbcType="VARCHAR" property="well_common_name" />
+    <result column="well_type" jdbcType="VARCHAR" property="well_type" />
+    <result column="linked_well" jdbcType="VARCHAR" property="linked_well" />
+    <result column="project_name" jdbcType="VARCHAR" property="project_name" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    well_common_name, well_type, linked_well, project_name
+  </sql>
+  <select id="selectByExample" parameterType="com.bowintek.practice.model.EsRelationLogExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from es_relation_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.EsRelationLogExample">
+    delete from es_relation_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.bowintek.practice.model.EsRelationLog">
+    insert into es_relation_log (well_common_name, well_type, linked_well, 
+      project_name)
+    values (#{well_common_name,jdbcType=VARCHAR}, #{well_type,jdbcType=VARCHAR}, #{linked_well,jdbcType=VARCHAR}, 
+      #{project_name,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.bowintek.practice.model.EsRelationLog">
+    insert into es_relation_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="well_common_name != null">
+        well_common_name,
+      </if>
+      <if test="well_type != null">
+        well_type,
+      </if>
+      <if test="linked_well != null">
+        linked_well,
+      </if>
+      <if test="project_name != null">
+        project_name,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="well_common_name != null">
+        #{well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="well_type != null">
+        #{well_type,jdbcType=VARCHAR},
+      </if>
+      <if test="linked_well != null">
+        #{linked_well,jdbcType=VARCHAR},
+      </if>
+      <if test="project_name != null">
+        #{project_name,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.bowintek.practice.model.EsRelationLogExample" resultType="java.lang.Long">
+    select count(*) from es_relation_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update es_relation_log
+    <set>
+      <if test="row.well_common_name != null">
+        well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      </if>
+      <if test="row.well_type != null">
+        well_type = #{row.well_type,jdbcType=VARCHAR},
+      </if>
+      <if test="row.linked_well != null">
+        linked_well = #{row.linked_well,jdbcType=VARCHAR},
+      </if>
+      <if test="row.project_name != null">
+        project_name = #{row.project_name,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update es_relation_log
+    set well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
+      well_type = #{row.well_type,jdbcType=VARCHAR},
+      linked_well = #{row.linked_well,jdbcType=VARCHAR},
+      project_name = #{row.project_name,jdbcType=VARCHAR}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+</mapper>

+ 25 - 14
vue/src/views/esdomain/result.vue

@@ -120,11 +120,11 @@
           </div>
           <div class="search-sider-block">
             <b>你可能要找的对象</b>
-            <a-list size="small" :data-source="listData">
+            <a-list size="small" :data-source="relationLogList">
               <template #renderItem="{ item }">
-                <a-list-item>{{ item }}
+                <a-list-item>{{ item.well_common_name }}
                   <template #actions>
-                    <a key="list-loadmore-edit">井筒</a>
+                    <a key="list-loadmore-edit">{{ item.well_type }}</a>
                   </template>
                 </a-list-item>
               </template>
@@ -176,6 +176,7 @@ export default defineComponent({
     const dataList = ref<any>([]);
     const indexList = ref<any>([]);
     const keyList = ref<any>([]);
+    const relationLogList = ref<any>([]);
     const formState = reactive({
       page: 1, rows: 10, subjectName: '', tabName: '', tabCode: null, total: 0
     });
@@ -222,31 +223,39 @@ export default defineComponent({
       tabsViewStore.addTabByPath('/domain/well', {id: well_id});
     }
 
-    function onQuery(args) {
+    const onQuery = (args) => {
       pageParams.value.current = 1;
       queryObject.value = args;
       loadData();
     }
 
-    function loadData() {
+    const loadData = () => {
       queryObject.value.page = pageParams.value.current - 1;
       queryObject.value.limit = pageParams.value.pageSize;
       queryObject.value.orderType = pageState.orderType;
       queryObject.value.orderBy = pageState.orderBy;
 
       pageState.loading = true;
-      postData('esquery/Query', queryObject.value).then(result => {
+      postData('esquery/Query', queryObject.value).then((result: any) => {
         pageState.loading = false;
         console.log(result);
-        dataList.value = (result as any).rows;
-        pageParams.value.total = (result as any).total;
+        dataList.value = result.rows;
+        pageParams.value.total = result.total;
 
-        keyList.value = (result as any).agg;
+        keyList.value = result.agg;
         getIndexSetting();
+        getRelationLogList();
       });
     }
-
-    function getIndexSetting() {
+    const getRelationLogList = () => {
+      if (dataList.value.length > 0) {
+        let well_common_name = dataList.value[0].well_common_name;
+        get('queryLog/getRelationLogList', {well_common_name: well_common_name}).then(data => {
+          relationLogList.value = data;
+        })
+      }
+    }
+    const getIndexSetting = () => {
       dataList.value.forEach(it => {
         let itSetting = indexList.value.find(ind => ind.indexCode == it.index);
         if (itSetting) {
@@ -258,7 +267,7 @@ export default defineComponent({
 
     const wellInfo = ref();
 
-    function onVisible(visible, key) {
+    const onVisible = (visible, key) => {
       console.log(visible, key);
       if (visible) {
         get('wellInfo/getWellBaseInfo', {well_id: key}).then(data => {
@@ -293,7 +302,7 @@ export default defineComponent({
       handleChange,
       getIndex,
       pageParams,
-      keyList, onVisible, wellInfo,
+      keyList, onVisible, wellInfo,relationLogList,
       queryObject
     };
   },
@@ -437,9 +446,10 @@ export default defineComponent({
 .search-view {
   width: 100%;
 
-  .key-tag{
+  .key-tag {
     color: #666161;
   }
+
   .search-view-chat {
     display: flex;
     flex-flow: wrap;
@@ -475,6 +485,7 @@ export default defineComponent({
     line-height: 25px;
   }
 }
+
 .even {
   background-color: #f2f2f2;
 }