Selaa lähdekoodia

日期时间选项优化,可大于、可小于、可等于、时间区间。
字典类型,暂缓

周壕 1 vuosi sitten
vanhempi
commit
2410dcfd5a

+ 5 - 0
src/main/java/com/bowintek/practice/controller/TempController.java

@@ -89,4 +89,9 @@ public class TempController {
 
         return RespGenerstor.success(result);
     }
+
+    @PostMapping("/getDictionaryList")
+    public BaseResponse getDictionaryList(@RequestBody List<String> codeList) {
+        return RespGenerstor.success(tempService.getDictionaryToHashMap(codeList));
+    }
 }

+ 1 - 0
src/main/java/com/bowintek/practice/mapper/cquery/TempCQuery.java

@@ -12,6 +12,7 @@ public interface TempCQuery {
     List<SaerchtempVo> getList(String tempNo, String tempName, String tempIdsString);
     List<HashMap<String,Object>> getListBySqlString(String sqlString);
     List<HashMap<String,Object>> getListToHashMap(String tempName);
+    List<HashMap<String,Object>> getDictionaryToHashMap(List<String> codeList);
     Integer batchInsertDimension(@Param("dataList") List<SrTempdimension> dataList);
     Integer batchInsertField(@Param("dataList") List<SrTempfield> dataList);
     Integer batchInsertMeasure(@Param("dataList") List<SrTempmeasure> dataList);

+ 10 - 0
src/main/java/com/bowintek/practice/model/SrTempdimension.java

@@ -19,6 +19,8 @@ public class SrTempdimension {
 
     private String displayName;
 
+    private Integer queryType;
+
     public String getTempFeildId() {
         return tempFeildId;
     }
@@ -90,4 +92,12 @@ public class SrTempdimension {
     public void setDisplayName(String displayName) {
         this.displayName = displayName == null ? null : displayName.trim();
     }
+
+    public Integer getQueryType() {
+        return queryType;
+    }
+
+    public void setQueryType(Integer queryType) {
+        this.queryType = queryType;
+    }
 }

+ 60 - 0
src/main/java/com/bowintek/practice/model/SrTempdimensionExample.java

@@ -723,6 +723,66 @@ public class SrTempdimensionExample {
             addCriterion("displayName not between", value1, value2, "displayName");
             return (Criteria) this;
         }
+
+        public Criteria andQueryTypeIsNull() {
+            addCriterion("queryType is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIsNotNull() {
+            addCriterion("queryType is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeEqualTo(Integer value) {
+            addCriterion("queryType =", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotEqualTo(Integer value) {
+            addCriterion("queryType <>", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThan(Integer value) {
+            addCriterion("queryType >", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("queryType >=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThan(Integer value) {
+            addCriterion("queryType <", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("queryType <=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIn(List<Integer> values) {
+            addCriterion("queryType in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotIn(List<Integer> values) {
+            addCriterion("queryType not in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeBetween(Integer value1, Integer value2) {
+            addCriterion("queryType between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("queryType not between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 20 - 0
src/main/java/com/bowintek/practice/model/SrTempfield.java

@@ -23,6 +23,10 @@ public class SrTempfield {
 
     private String operation;
 
+    private Integer queryType;
+
+    private String dictionaryCode;
+
     public String getTempFeildId() {
         return tempFeildId;
     }
@@ -110,4 +114,20 @@ public class SrTempfield {
     public void setOperation(String operation) {
         this.operation = operation == null ? null : operation.trim();
     }
+
+    public Integer getQueryType() {
+        return queryType;
+    }
+
+    public void setQueryType(Integer queryType) {
+        this.queryType = queryType;
+    }
+
+    public String getDictionaryCode() {
+        return dictionaryCode;
+    }
+
+    public void setDictionaryCode(String dictionaryCode) {
+        this.dictionaryCode = dictionaryCode == null ? null : dictionaryCode.trim();
+    }
 }

+ 130 - 0
src/main/java/com/bowintek/practice/model/SrTempfieldExample.java

@@ -863,6 +863,136 @@ public class SrTempfieldExample {
             addCriterion("operation not between", value1, value2, "operation");
             return (Criteria) this;
         }
+
+        public Criteria andQueryTypeIsNull() {
+            addCriterion("queryType is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIsNotNull() {
+            addCriterion("queryType is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeEqualTo(Integer value) {
+            addCriterion("queryType =", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotEqualTo(Integer value) {
+            addCriterion("queryType <>", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThan(Integer value) {
+            addCriterion("queryType >", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("queryType >=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThan(Integer value) {
+            addCriterion("queryType <", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("queryType <=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIn(List<Integer> values) {
+            addCriterion("queryType in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotIn(List<Integer> values) {
+            addCriterion("queryType not in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeBetween(Integer value1, Integer value2) {
+            addCriterion("queryType between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("queryType not between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeIsNull() {
+            addCriterion("dictionaryCode is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeIsNotNull() {
+            addCriterion("dictionaryCode is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeEqualTo(String value) {
+            addCriterion("dictionaryCode =", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeNotEqualTo(String value) {
+            addCriterion("dictionaryCode <>", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeGreaterThan(String value) {
+            addCriterion("dictionaryCode >", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("dictionaryCode >=", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeLessThan(String value) {
+            addCriterion("dictionaryCode <", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeLessThanOrEqualTo(String value) {
+            addCriterion("dictionaryCode <=", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeLike(String value) {
+            addCriterion("dictionaryCode like", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeNotLike(String value) {
+            addCriterion("dictionaryCode not like", value, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeIn(List<String> values) {
+            addCriterion("dictionaryCode in", values, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeNotIn(List<String> values) {
+            addCriterion("dictionaryCode not in", values, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeBetween(String value1, String value2) {
+            addCriterion("dictionaryCode between", value1, value2, "dictionaryCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andDictionaryCodeNotBetween(String value1, String value2) {
+            addCriterion("dictionaryCode not between", value1, value2, "dictionaryCode");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 10 - 0
src/main/java/com/bowintek/practice/model/SrTempmeasure.java

@@ -23,6 +23,8 @@ public class SrTempmeasure {
 
     private String operation;
 
+    private Integer queryType;
+
     public String getTempFeildId() {
         return tempFeildId;
     }
@@ -110,4 +112,12 @@ public class SrTempmeasure {
     public void setOperation(String operation) {
         this.operation = operation == null ? null : operation.trim();
     }
+
+    public Integer getQueryType() {
+        return queryType;
+    }
+
+    public void setQueryType(Integer queryType) {
+        this.queryType = queryType;
+    }
 }

+ 60 - 0
src/main/java/com/bowintek/practice/model/SrTempmeasureExample.java

@@ -863,6 +863,66 @@ public class SrTempmeasureExample {
             addCriterion("operation not between", value1, value2, "operation");
             return (Criteria) this;
         }
+
+        public Criteria andQueryTypeIsNull() {
+            addCriterion("queryType is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIsNotNull() {
+            addCriterion("queryType is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeEqualTo(Integer value) {
+            addCriterion("queryType =", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotEqualTo(Integer value) {
+            addCriterion("queryType <>", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThan(Integer value) {
+            addCriterion("queryType >", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("queryType >=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThan(Integer value) {
+            addCriterion("queryType <", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("queryType <=", value, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeIn(List<Integer> values) {
+            addCriterion("queryType in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotIn(List<Integer> values) {
+            addCriterion("queryType not in", values, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeBetween(Integer value1, Integer value2) {
+            addCriterion("queryType between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
+
+        public Criteria andQueryTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("queryType not between", value1, value2, "queryType");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 18 - 15
src/main/java/com/bowintek/practice/services/impl/GenSqlStringServiceImpl.java

@@ -142,8 +142,8 @@ public class GenSqlStringServiceImpl implements GenSqlStringService {
         String whereString = "";
         for(int i=0;i<data.wheres.size();i++){
             SrTempfield stf = data.wheres.get(i);
-            int dataType = getDataType(stf.getDataType());
-            if(dataType==0) whereString += genWhereString(stf);
+            int dataType = getDataType(stf.getQueryType());
+            if(dataType==0 || dataType==3) whereString += genWhereString(stf);
             else if(dataType==1) whereString += genWhereNumber(stf);
             else if(dataType==2) whereString += genWhereDate(stf);
         }
@@ -178,13 +178,8 @@ public class GenSqlStringServiceImpl implements GenSqlStringService {
     }
 
 
-    public int getDataType(String typeString){
-        List<String> strings = Arrays.asList(new String[]{"char","varchar","text"});
-        List<String> numbers = Arrays.asList(new String[]{"int","bigint","decimal"});
-        List<String> dates = Arrays.asList(new String[]{"date"});
-        if(strings.indexOf(typeString.toLowerCase(Locale.ROOT))>=0) return 0;
-        if(numbers.indexOf(typeString.toLowerCase(Locale.ROOT))>=0) return 1;
-        if(dates.indexOf(typeString.toLowerCase(Locale.ROOT))>=0) return 2;
+    public int getDataType(Integer queryType){
+        if(queryType!=null && (queryType<=4)) return queryType-1;
         return -1;
     }
 
@@ -221,12 +216,20 @@ public class GenSqlStringServiceImpl implements GenSqlStringService {
         if(IsNullEmpty(stf.getOperation())) return genRemark("genWhereDate", stf.getTempFeildId());
 
         String where = "";
-        if(!IsNullEmpty(stf.getValue1()))
-            where += MessageFormat.format("\n\tAND T.{0} >= {1}", stf.getFieldAlias(),
-                    "'"+stf.getValue1()+"'");
-        if(!IsNullEmpty(stf.getValue2()))
-            where += MessageFormat.format("\n\tAND T.{0} <= {1}", stf.getFieldAlias(),
-                    "'"+stf.getValue2()+"'");
+        String[] arys = stf.getOperation().split(",");
+        if(stf.getOperation().equals("date") || stf.getOperation().equals("datetime")) {
+            if (!IsNullEmpty(stf.getValue1()))
+                where += MessageFormat.format("\n\tAND T.{0} >= {1}", stf.getFieldAlias(),
+                        "'" + stf.getValue1() + "'");
+            if (!IsNullEmpty(stf.getValue2()))
+                where += MessageFormat.format("\n\tAND T.{0} <= {1}", stf.getFieldAlias(),
+                        "'" + stf.getValue2() + "'");
+        }
+        else if(arys.length>1){
+            if (!IsNullEmpty(stf.getValue1()))
+                where += MessageFormat.format("\n\tAND T.{0} {1} {2}", stf.getFieldAlias(),
+                        arys[1], "'" + stf.getValue1() + "'");
+        }
 
         return IsNullEmpty(where)?genRemark("genWhereDate", stf.getTempFeildId()) : where;
     }

+ 12 - 0
src/main/java/com/bowintek/practice/services/impl/TempServiceImpl.java

@@ -168,4 +168,16 @@ public class TempServiceImpl implements TempService {
         });
         return fields;
     }
+
+    public HashMap<String, Object> getDictionaryToHashMap(List<String> codeList){
+        List<HashMap<String, Object>> resultList = tempCQuery.getDictionaryToHashMap(codeList);
+        HashMap<String, Object> rtnMaps = new HashMap<>();
+        codeList.forEach(str->{
+            List<HashMap<String, Object>> dics = resultList.stream()
+                    .filter(e -> str.equals(e.get("dictionaryCode")))
+                    .collect(Collectors.toList());
+            rtnMaps.put(str, dics);
+        });
+        return rtnMaps;
+    }
 }

+ 1 - 0
src/main/java/com/bowintek/practice/services/service/TempService.java

@@ -17,4 +17,5 @@ public interface TempService {
     TempSaveResult saveTemp(TempObjectModel data, String userID);
     TempObjectModel getTemp(String tempId);
     int deleteTemp(List<String> idList);
+    HashMap<String, Object> getDictionaryToHashMap(List<String> codeList);
 }

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

@@ -4,7 +4,7 @@
 
 <generatorConfiguration>
     <!--mysql 连接数据库jar 这里选择自己本地位置-->
-    <classPathEntry location=".\lib\mysql-connector-java-5.1.46.jar"/>
+    <classPathEntry location="./lib/mysql-connector-java-5.1.46.jar"/>
     <context id="testTables" targetRuntime="MyBatis3">
         <!-- 运行环境配置 -->
         <!--<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>-->
@@ -120,7 +120,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="sr_tag"><property name="useActualColumnNames" value="true"/></table>
-        <table schema="" tableName="sr_subjectFieldTag"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="sr_tempfield"><property name="useActualColumnNames" value="true"/></table>
     </context>
 </generatorConfiguration>

+ 0 - 276
src/main/resources/mapping/SrTempdimensionMapper.xml

@@ -1,276 +0,0 @@
-<?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.SrTempdimensionMapper">
-  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SrTempdimension">
-    <id column="tempFeildId" jdbcType="VARCHAR" property="tempFeildId" />
-    <result column="tempId" jdbcType="VARCHAR" property="tempId" />
-    <result column="fieldId" jdbcType="VARCHAR" property="fieldId" />
-    <result column="disOrder" jdbcType="DECIMAL" property="disOrder" />
-    <result column="fieldCode" jdbcType="VARCHAR" property="fieldCode" />
-    <result column="fieldName" jdbcType="VARCHAR" property="fieldName" />
-    <result column="fieldAlias" jdbcType="VARCHAR" property="fieldAlias" />
-    <result column="dataType" jdbcType="VARCHAR" property="dataType" />
-    <result column="displayName" jdbcType="VARCHAR" property="displayName" />
-  </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">
-    tempFeildId, tempId, fieldId, disOrder, fieldCode, fieldName, fieldAlias, dataType, 
-    displayName
-  </sql>
-  <select id="selectByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from sr_tempdimension
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from sr_tempdimension
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from sr_tempdimension
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample">
-    delete from sr_tempdimension
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.bowintek.practice.model.SrTempdimension">
-    insert into sr_tempdimension (tempFeildId, tempId, fieldId, 
-      disOrder, fieldCode, fieldName, 
-      fieldAlias, dataType, displayName
-      )
-    values (#{tempFeildId,jdbcType=VARCHAR}, #{tempId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, 
-      #{disOrder,jdbcType=DECIMAL}, #{fieldCode,jdbcType=VARCHAR}, #{fieldName,jdbcType=VARCHAR}, 
-      #{fieldAlias,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{displayName,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.bowintek.practice.model.SrTempdimension">
-    insert into sr_tempdimension
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        tempFeildId,
-      </if>
-      <if test="tempId != null">
-        tempId,
-      </if>
-      <if test="fieldId != null">
-        fieldId,
-      </if>
-      <if test="disOrder != null">
-        disOrder,
-      </if>
-      <if test="fieldCode != null">
-        fieldCode,
-      </if>
-      <if test="fieldName != null">
-        fieldName,
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias,
-      </if>
-      <if test="dataType != null">
-        dataType,
-      </if>
-      <if test="displayName != null">
-        displayName,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        #{tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="tempId != null">
-        #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        #{disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="fieldCode != null">
-        #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="displayName != null">
-        #{displayName,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.bowintek.practice.model.SrTempdimensionExample" resultType="java.lang.Long">
-    select count(*) from sr_tempdimension
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update sr_tempdimension
-    <set>
-      <if test="row.tempFeildId != null">
-        tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.tempId != null">
-        tempId = #{row.tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldId != null">
-        fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.disOrder != null">
-        disOrder = #{row.disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="row.fieldCode != null">
-        fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldName != null">
-        fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldAlias != null">
-        fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="row.dataType != null">
-        dataType = #{row.dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="row.displayName != null">
-        displayName = #{row.displayName,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update sr_tempdimension
-    set tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      tempId = #{row.tempId,jdbcType=VARCHAR},
-      fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      disOrder = #{row.disOrder,jdbcType=DECIMAL},
-      fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      dataType = #{row.dataType,jdbcType=VARCHAR},
-      displayName = #{row.displayName,jdbcType=VARCHAR}
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SrTempdimension">
-    update sr_tempdimension
-    <set>
-      <if test="tempId != null">
-        tempId = #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        fieldId = #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        disOrder = #{disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="fieldCode != null">
-        fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        fieldName = #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        dataType = #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="displayName != null">
-        displayName = #{displayName,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SrTempdimension">
-    update sr_tempdimension
-    set tempId = #{tempId,jdbcType=VARCHAR},
-      fieldId = #{fieldId,jdbcType=VARCHAR},
-      disOrder = #{disOrder,jdbcType=DECIMAL},
-      fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      fieldName = #{fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      dataType = #{dataType,jdbcType=VARCHAR},
-      displayName = #{displayName,jdbcType=VARCHAR}
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-</mapper>

+ 0 - 306
src/main/resources/mapping/SrTempfieldMapper.xml

@@ -1,306 +0,0 @@
-<?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.SrTempfieldMapper">
-  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SrTempfield">
-    <id column="tempFeildId" jdbcType="VARCHAR" property="tempFeildId" />
-    <result column="tempId" jdbcType="VARCHAR" property="tempId" />
-    <result column="fieldId" jdbcType="VARCHAR" property="fieldId" />
-    <result column="value1" jdbcType="VARCHAR" property="value1" />
-    <result column="value2" jdbcType="VARCHAR" property="value2" />
-    <result column="disOrder" jdbcType="INTEGER" property="disOrder" />
-    <result column="fieldCode" jdbcType="VARCHAR" property="fieldCode" />
-    <result column="fieldName" jdbcType="VARCHAR" property="fieldName" />
-    <result column="fieldAlias" jdbcType="VARCHAR" property="fieldAlias" />
-    <result column="dataType" jdbcType="VARCHAR" property="dataType" />
-    <result column="operation" jdbcType="VARCHAR" property="operation" />
-  </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">
-    tempFeildId, tempId, fieldId, value1, value2, disOrder, fieldCode, fieldName, fieldAlias, 
-    dataType, operation
-  </sql>
-  <select id="selectByExample" parameterType="com.bowintek.practice.model.SrTempfieldExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from sr_tempfield
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from sr_tempfield
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from sr_tempfield
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SrTempfieldExample">
-    delete from sr_tempfield
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.bowintek.practice.model.SrTempfield">
-    insert into sr_tempfield (tempFeildId, tempId, fieldId, 
-      value1, value2, disOrder, 
-      fieldCode, fieldName, fieldAlias, 
-      dataType, operation)
-    values (#{tempFeildId,jdbcType=VARCHAR}, #{tempId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, 
-      #{value1,jdbcType=VARCHAR}, #{value2,jdbcType=VARCHAR}, #{disOrder,jdbcType=INTEGER}, 
-      #{fieldCode,jdbcType=VARCHAR}, #{fieldName,jdbcType=VARCHAR}, #{fieldAlias,jdbcType=VARCHAR}, 
-      #{dataType,jdbcType=VARCHAR}, #{operation,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.bowintek.practice.model.SrTempfield">
-    insert into sr_tempfield
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        tempFeildId,
-      </if>
-      <if test="tempId != null">
-        tempId,
-      </if>
-      <if test="fieldId != null">
-        fieldId,
-      </if>
-      <if test="value1 != null">
-        value1,
-      </if>
-      <if test="value2 != null">
-        value2,
-      </if>
-      <if test="disOrder != null">
-        disOrder,
-      </if>
-      <if test="fieldCode != null">
-        fieldCode,
-      </if>
-      <if test="fieldName != null">
-        fieldName,
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias,
-      </if>
-      <if test="dataType != null">
-        dataType,
-      </if>
-      <if test="operation != null">
-        operation,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        #{tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="tempId != null">
-        #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="value1 != null">
-        #{value1,jdbcType=VARCHAR},
-      </if>
-      <if test="value2 != null">
-        #{value2,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        #{disOrder,jdbcType=INTEGER},
-      </if>
-      <if test="fieldCode != null">
-        #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="operation != null">
-        #{operation,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.bowintek.practice.model.SrTempfieldExample" resultType="java.lang.Long">
-    select count(*) from sr_tempfield
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update sr_tempfield
-    <set>
-      <if test="row.tempFeildId != null">
-        tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.tempId != null">
-        tempId = #{row.tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldId != null">
-        fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.value1 != null">
-        value1 = #{row.value1,jdbcType=VARCHAR},
-      </if>
-      <if test="row.value2 != null">
-        value2 = #{row.value2,jdbcType=VARCHAR},
-      </if>
-      <if test="row.disOrder != null">
-        disOrder = #{row.disOrder,jdbcType=INTEGER},
-      </if>
-      <if test="row.fieldCode != null">
-        fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldName != null">
-        fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldAlias != null">
-        fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="row.dataType != null">
-        dataType = #{row.dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="row.operation != null">
-        operation = #{row.operation,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update sr_tempfield
-    set tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      tempId = #{row.tempId,jdbcType=VARCHAR},
-      fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      value1 = #{row.value1,jdbcType=VARCHAR},
-      value2 = #{row.value2,jdbcType=VARCHAR},
-      disOrder = #{row.disOrder,jdbcType=INTEGER},
-      fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      dataType = #{row.dataType,jdbcType=VARCHAR},
-      operation = #{row.operation,jdbcType=VARCHAR}
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SrTempfield">
-    update sr_tempfield
-    <set>
-      <if test="tempId != null">
-        tempId = #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        fieldId = #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="value1 != null">
-        value1 = #{value1,jdbcType=VARCHAR},
-      </if>
-      <if test="value2 != null">
-        value2 = #{value2,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        disOrder = #{disOrder,jdbcType=INTEGER},
-      </if>
-      <if test="fieldCode != null">
-        fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        fieldName = #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        dataType = #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="operation != null">
-        operation = #{operation,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SrTempfield">
-    update sr_tempfield
-    set tempId = #{tempId,jdbcType=VARCHAR},
-      fieldId = #{fieldId,jdbcType=VARCHAR},
-      value1 = #{value1,jdbcType=VARCHAR},
-      value2 = #{value2,jdbcType=VARCHAR},
-      disOrder = #{disOrder,jdbcType=INTEGER},
-      fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      fieldName = #{fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      dataType = #{dataType,jdbcType=VARCHAR},
-      operation = #{operation,jdbcType=VARCHAR}
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-</mapper>

+ 0 - 306
src/main/resources/mapping/SrTempmeasureMapper.xml

@@ -1,306 +0,0 @@
-<?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.SrTempmeasureMapper">
-  <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SrTempmeasure">
-    <id column="tempFeildId" jdbcType="VARCHAR" property="tempFeildId" />
-    <result column="tempId" jdbcType="VARCHAR" property="tempId" />
-    <result column="fieldId" jdbcType="VARCHAR" property="fieldId" />
-    <result column="functionName" jdbcType="VARCHAR" property="functionName" />
-    <result column="disOrder" jdbcType="DECIMAL" property="disOrder" />
-    <result column="fieldCode" jdbcType="VARCHAR" property="fieldCode" />
-    <result column="fieldName" jdbcType="VARCHAR" property="fieldName" />
-    <result column="fieldAlias" jdbcType="VARCHAR" property="fieldAlias" />
-    <result column="dataType" jdbcType="VARCHAR" property="dataType" />
-    <result column="displayName" jdbcType="VARCHAR" property="displayName" />
-    <result column="operation" jdbcType="VARCHAR" property="operation" />
-  </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">
-    tempFeildId, tempId, fieldId, functionName, disOrder, fieldCode, fieldName, fieldAlias, 
-    dataType, displayName, operation
-  </sql>
-  <select id="selectByExample" parameterType="com.bowintek.practice.model.SrTempmeasureExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from sr_tempmeasure
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from sr_tempmeasure
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from sr_tempmeasure
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SrTempmeasureExample">
-    delete from sr_tempmeasure
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.bowintek.practice.model.SrTempmeasure">
-    insert into sr_tempmeasure (tempFeildId, tempId, fieldId, 
-      functionName, disOrder, fieldCode, 
-      fieldName, fieldAlias, dataType, 
-      displayName, operation)
-    values (#{tempFeildId,jdbcType=VARCHAR}, #{tempId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, 
-      #{functionName,jdbcType=VARCHAR}, #{disOrder,jdbcType=DECIMAL}, #{fieldCode,jdbcType=VARCHAR}, 
-      #{fieldName,jdbcType=VARCHAR}, #{fieldAlias,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, 
-      #{displayName,jdbcType=VARCHAR}, #{operation,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.bowintek.practice.model.SrTempmeasure">
-    insert into sr_tempmeasure
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        tempFeildId,
-      </if>
-      <if test="tempId != null">
-        tempId,
-      </if>
-      <if test="fieldId != null">
-        fieldId,
-      </if>
-      <if test="functionName != null">
-        functionName,
-      </if>
-      <if test="disOrder != null">
-        disOrder,
-      </if>
-      <if test="fieldCode != null">
-        fieldCode,
-      </if>
-      <if test="fieldName != null">
-        fieldName,
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias,
-      </if>
-      <if test="dataType != null">
-        dataType,
-      </if>
-      <if test="displayName != null">
-        displayName,
-      </if>
-      <if test="operation != null">
-        operation,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="tempFeildId != null">
-        #{tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="tempId != null">
-        #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="functionName != null">
-        #{functionName,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        #{disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="fieldCode != null">
-        #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="displayName != null">
-        #{displayName,jdbcType=VARCHAR},
-      </if>
-      <if test="operation != null">
-        #{operation,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.bowintek.practice.model.SrTempmeasureExample" resultType="java.lang.Long">
-    select count(*) from sr_tempmeasure
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update sr_tempmeasure
-    <set>
-      <if test="row.tempFeildId != null">
-        tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.tempId != null">
-        tempId = #{row.tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldId != null">
-        fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="row.functionName != null">
-        functionName = #{row.functionName,jdbcType=VARCHAR},
-      </if>
-      <if test="row.disOrder != null">
-        disOrder = #{row.disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="row.fieldCode != null">
-        fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldName != null">
-        fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="row.fieldAlias != null">
-        fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="row.dataType != null">
-        dataType = #{row.dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="row.displayName != null">
-        displayName = #{row.displayName,jdbcType=VARCHAR},
-      </if>
-      <if test="row.operation != null">
-        operation = #{row.operation,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update sr_tempmeasure
-    set tempFeildId = #{row.tempFeildId,jdbcType=VARCHAR},
-      tempId = #{row.tempId,jdbcType=VARCHAR},
-      fieldId = #{row.fieldId,jdbcType=VARCHAR},
-      functionName = #{row.functionName,jdbcType=VARCHAR},
-      disOrder = #{row.disOrder,jdbcType=DECIMAL},
-      fieldCode = #{row.fieldCode,jdbcType=VARCHAR},
-      fieldName = #{row.fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{row.fieldAlias,jdbcType=VARCHAR},
-      dataType = #{row.dataType,jdbcType=VARCHAR},
-      displayName = #{row.displayName,jdbcType=VARCHAR},
-      operation = #{row.operation,jdbcType=VARCHAR}
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SrTempmeasure">
-    update sr_tempmeasure
-    <set>
-      <if test="tempId != null">
-        tempId = #{tempId,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldId != null">
-        fieldId = #{fieldId,jdbcType=VARCHAR},
-      </if>
-      <if test="functionName != null">
-        functionName = #{functionName,jdbcType=VARCHAR},
-      </if>
-      <if test="disOrder != null">
-        disOrder = #{disOrder,jdbcType=DECIMAL},
-      </if>
-      <if test="fieldCode != null">
-        fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldName != null">
-        fieldName = #{fieldName,jdbcType=VARCHAR},
-      </if>
-      <if test="fieldAlias != null">
-        fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      </if>
-      <if test="dataType != null">
-        dataType = #{dataType,jdbcType=VARCHAR},
-      </if>
-      <if test="displayName != null">
-        displayName = #{displayName,jdbcType=VARCHAR},
-      </if>
-      <if test="operation != null">
-        operation = #{operation,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SrTempmeasure">
-    update sr_tempmeasure
-    set tempId = #{tempId,jdbcType=VARCHAR},
-      fieldId = #{fieldId,jdbcType=VARCHAR},
-      functionName = #{functionName,jdbcType=VARCHAR},
-      disOrder = #{disOrder,jdbcType=DECIMAL},
-      fieldCode = #{fieldCode,jdbcType=VARCHAR},
-      fieldName = #{fieldName,jdbcType=VARCHAR},
-      fieldAlias = #{fieldAlias,jdbcType=VARCHAR},
-      dataType = #{dataType,jdbcType=VARCHAR},
-      displayName = #{displayName,jdbcType=VARCHAR},
-      operation = #{operation,jdbcType=VARCHAR}
-    where tempFeildId = #{tempFeildId,jdbcType=VARCHAR}
-  </update>
-</mapper>

+ 16 - 6
src/main/resources/mapping/cquery/TempCQuery.xml

@@ -24,6 +24,16 @@
         #{sqlString}
     </select>
 
+    <select id="getDictionaryToHashMap" resultType="java.util.HashMap">
+        select  CAST(dic.Value AS CHAR) value, dic.name label, dictionaryCode
+        from sys_dictionary_item dic
+        where dictionaryCode in
+        <foreach collection="codeList" item="dictionaryCode" index="index" open="(" close=")" separator=",">
+            #{dictionaryCode}
+        </foreach>
+        order by dic.Value
+    </select>
+
     <select id="getListToHashMap" resultType="java.util.HashMap">
         select *
         from sr_saerchtemp st
@@ -86,26 +96,26 @@
     </delete>
 
     <insert id="batchInsertDimension" parameterType="java.util.List">
-        insert into sr_tempdimension(tempFeildId,tempId,fieldId,disOrder,fieldCode,fieldName,fieldAlias,dataType,displayName)
+        insert into sr_tempdimension(tempFeildId,tempId,fieldId,disOrder,fieldCode,fieldName,fieldAlias,dataType,displayName,queryType)
         values
         <foreach collection="dataList" item="item" separator=",">
-            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.displayName})
+            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.displayName},#{item.queryType})
         </foreach>
     </insert>
 
     <insert id="batchInsertField" parameterType="java.util.List">
-        insert into sr_tempfield(tempFeildId,tempId,fieldId,value1,value2,disOrder,fieldCode,fieldName,fieldAlias,dataType,operation)
+        insert into sr_tempfield(tempFeildId,tempId,fieldId,value1,value2,disOrder,fieldCode,fieldName,fieldAlias,dataType,operation,queryType, dictionaryCode)
         values
         <foreach collection="dataList" item="item" separator=",">
-            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.value1},#{item.value2},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.operation})
+            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.value1},#{item.value2},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.operation},#{item.queryType},#{item.dictionaryCode})
         </foreach>
     </insert>
 
     <insert id="batchInsertMeasure" parameterType="java.util.List">
-        insert into sr_tempmeasure(tempFeildId,tempId,fieldId,functionName,disOrder,fieldCode,fieldName,fieldAlias,dataType,displayName,operation)
+        insert into sr_tempmeasure(tempFeildId,tempId,fieldId,functionName,disOrder,fieldCode,fieldName,fieldAlias,dataType,displayName,operation,queryType)
         values
         <foreach collection="dataList" item="item" separator=",">
-            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.functionName},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.displayName},#{item.operation})
+            (#{item.tempFeildId},#{item.tempId},#{item.fieldId},#{item.functionName},#{item.disOrder},#{item.fieldCode},#{item.fieldName},#{item.fieldAlias},#{item.dataType},#{item.displayName},#{item.operation},#{item.queryType})
         </foreach>
     </insert>
 </mapper>

+ 2 - 3
target/classes/generatorConfig.xml

@@ -4,7 +4,7 @@
 
 <generatorConfiguration>
     <!--mysql 连接数据库jar 这里选择自己本地位置-->
-    <classPathEntry location=".\lib\mysql-connector-java-5.1.46.jar"/>
+    <classPathEntry location="./lib/mysql-connector-java-5.1.46.jar"/>
     <context id="testTables" targetRuntime="MyBatis3">
         <!-- 运行环境配置 -->
         <!--<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>-->
@@ -120,7 +120,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="sr_tag"><property name="useActualColumnNames" value="true"/></table>
-        <table schema="" tableName="sr_subjectFieldTag"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="sr_tempfield"><property name="useActualColumnNames" value="true"/></table>
     </context>
 </generatorConfiguration>

+ 2 - 1
vue/src/components/basic/query/drag-base.vue

@@ -90,7 +90,8 @@
           operation: data.operation ? data.operation : 'SUM({$FIELD$})',
 
           subId : data.subId? data.subId : null,
-          subjectName : data.subjectName? data.subjectName : null
+          subjectName : data.subjectName? data.subjectName : null,
+          queryType : data.queryType? data.queryType : null
         };
       },
       handleDragOver : function (ev) {

+ 93 - 24
vue/src/components/basic/query/drag-where.vue

@@ -7,7 +7,7 @@
   >
     <template v-for="(it, index) in tagList">
       <div class="query-area-item"
-           :class="((this.index == index?'query-area-item-active':'') + (convertDataType(tagList[index].dataType)==2?' query-area-item-time':''))"
+           :class="((this.index == index?'query-area-item-active':'') + (convertDataType(tagList[index])==2?' query-area-item-time':''))"
            draggable="true"
            @dragstart="childDragstart($event, index)"
            @dragenter.prevent="childDragEnter($event, index)"
@@ -17,7 +17,7 @@
           <div class="query-area-item-close" @click="childDelete(index)"><CloseOutlined style="color: white;"/></div>
         </div>
         <template v-for="(op, idx) in tagList[index].values">
-          <div v-if="convertDataType(tagList[index].dataType)==0" class="query-area-body">
+          <div v-if="convertDataType(tagList[index])==0" class="query-area-body">
             <div class="query-area-body-oper">
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operTexts"></a-select>
             </div>
@@ -30,7 +30,7 @@
             </div>
           </div>
 
-          <div v-if="convertDataType(tagList[index].dataType)==1" class="query-area-body">
+          <div v-if="convertDataType(tagList[index])==1" class="query-area-body">
             <div class="query-area-body-oper">
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operNumbers"></a-select>
             </div>
@@ -49,8 +49,8 @@
             </div>
           </div>
 
-          <div v-if="convertDataType(tagList[index].dataType)==2" class="query-area-body">
-            <div class="query-area-body-oper">
+          <div v-if="convertDataType(tagList[index])==2" class="query-area-body">
+            <div :class="(getIsTimeLimit(tagList[index].values[idx].operation)?'query-area-body-oper':'query-area-body-time')">
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operTimes"></a-select>
             </div>
             <div class="query-area-body-input">
@@ -64,8 +64,31 @@
                 @ok="onRangeOk"
               />
               <a-range-picker
-                v-if="(tagList[index].values[idx].operation=='date')"
-                v-model:value="tagList[index].values[idx].val"/>
+                v-else-if="(tagList[index].values[idx].operation=='date')"
+                v-model:value="tagList[index].values[idx].val2"/>
+              <a-date-picker
+                v-else-if="(getTimeType(tagList[index].values[idx].operation)=='datetime')"
+                v-model:value="tagList[index].values[idx].val2"
+                :show-time="{ format: 'HH:mm' }"
+                placeholder="日期时间..."
+                format="YYYY-MM-DD HH:mm"/>
+              <a-date-picker
+                v-else-if="(getTimeType(tagList[index].values[idx].operation)=='date')"
+                v-model:value="tagList[index].values[idx].val2"
+                placeholder="日期..." />
+            </div>
+            <div v-if="false" class="query-area-body-edit">
+              <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
+              <MinusSquareOutlined  v-if="(idx>0)" @click="operationDelete(index, idx)"/>
+            </div>
+          </div>
+
+          <div v-if="convertDataType(tagList[index])==3" class="query-area-body">
+            <div class="query-area-body-oper">
+              <a-select v-model:value="tagList[index].values[idx].operation" :options="operDics"></a-select>
+            </div>
+            <div class="query-area-body-input">
+              <a-select v-model:value="tagList[index].values[idx].val" :options="(dics[tagList[index].dictionaryCode])"></a-select>
             </div>
             <div v-if="false" class="query-area-body-edit">
               <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
@@ -90,6 +113,7 @@
   import DragBase from './drag-base.vue'
   import type {SelectProps} from 'ant-design-vue';
   import dayjs, { Dayjs } from 'dayjs';
+  import { postData} from '@/api/common';
 
   export default defineComponent({
     name : 'DragWhere',
@@ -102,9 +126,24 @@
           { value: 'null', label: '为空'},
           { value: 'not null', label: '不为空'}
         ] as SelectProps['options'],
+        operDics : [
+          { value: '=', label: '等于'}
+        ] as SelectProps['options'],
         operTimes : [
-          { value: 'date', label: '日期'},
-          { value: 'datetime', label: '日期时间'}
+          { label: '日期', options:[
+              { value: 'date', label: '日期区间'},
+              { value: 'date,>', label: '日期大于'},
+              { value: 'date,<', label: '日期小于'},
+              { value: 'date,=', label: '日期等于'},
+              { value: 'date,>=', label: '日期大于等于'},
+              { value: 'date,<=', label: '日期小于等于'}]},
+          { label: '日期时间', options:[
+              { value: 'datetime', label: '时间区间'},
+              { value: 'datetime,>', label: '时间大于'},
+              { value: 'datetime,<', label: '时间小于'},
+              { value: 'datetime,=', label: '时间等于'},
+              { value: 'datetime,>=', label: '时间大于等于'},
+              { value: 'datetime,<=', label: '时间小于等于'}]}
         ] as SelectProps['options'],
         operNumbers : [
           { value: '>', label: '大于'},
@@ -114,6 +153,8 @@
           { value: '<=', label: '小于等于'},
           { value: 'limit', label: '区间'}
         ] as SelectProps['options'],
+        dics:{},
+        dicTest :[]
       }
     },
     setup(props, context){
@@ -135,6 +176,8 @@
     },
     methods:{
       getObject:function (data){
+        console.log("getObject", data);
+        if(data.dictionaryCode) this.getDictionary(data.dictionaryCode);
         return {
           tempFeildId : data.tempFeildId,
           tempId: data.tempId ? data.tempId : null,
@@ -147,10 +190,12 @@
           isDrag : 1,
           displayName: data.displayName ? data.displayName : null,
           values : data.values ? data.values :
-            [{ operation : (this.convertDataType(data.dataType)==2?'date':'='), val :'', val2 : '' }],
+            [{ operation : (this.convertDataType(data)==2?'date':'='), val :'', val2 : '' }],
 
           subId : data.subId? data.subId : null,
-          subjectName : data.subjectName? data.subjectName : null
+          subjectName : data.subjectName? data.subjectName : null,
+          queryType : data.queryType? data.queryType : null,
+          dictionaryCode : data.dictionaryCode? data.dictionaryCode : null
         };
       },
       operationInsert(index){
@@ -159,11 +204,9 @@
       operationDelete(index, idx){
         this.tagList[index].values.splice(idx, 1);
       },
-      convertDataType(typeStr:string){
-        typeStr = typeStr.toLowerCase();
-        if(["char","varchar","text"].indexOf(typeStr)>=0) return 0;
-        if(["int","bigint","decimal"].indexOf(typeStr)>=0) return 1;
-        if(["date"].indexOf(typeStr)>=0) return 2;
+      convertDataType(row : any){
+        if(row.queryType && row.queryType<=4) return row.queryType-1;
+        else return 0;
       },
       onRangeChange(value: [Dayjs, Dayjs], dateString: [string, string]) {
         console.log('Selected Time: ', value);
@@ -173,18 +216,21 @@
         this.tagList.forEach((row, index)=>{
           row.disOrder = index;
           row.operation = row.values[0].operation;
-          if(this.convertDataType(row.dataType)==2) {
+          if(this.convertDataType(row)==2) {
+            row.value1 = row.value2 = null;
+
             let formatString = "YYYY-MM-DD";
-            if (row.values[0].operation == "datetime") formatString = "YYYY-MM-DD HH:mm:ss";
+            if (this.getTimeType(row.values[0].operation) == "datetime") formatString = "YYYY-MM-DD HH:mm:ss";
 
-            if (row.values[0].val && row.values[0].val.length > 0 && row.values[0].val[0]) {
-              //row.value1 = row.values[0].val[0].toDate().getTime();
+            if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 0 && row.values[0].val[0]) {
               row.value1 = row.values[0].val[0].format(formatString);
             }
-            if (row.values[0].val && row.values[0].val.length > 1 && row.values[0].val[1]) {
-              //row.value2 = row.values[0].val[1].toDate().getTime();
+            if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 1 && row.values[0].val[1]) {
               row.value2 = row.values[0].val[1].format(formatString);
             }
+            if (!this.getIsTimeLimit(row.operation) && row.values[0].val2) {
+              row.value1 = row.values[0].val2.format(formatString);
+            }
           }
           else {
             row.value1 = row.values[0].val;
@@ -197,21 +243,41 @@
         list.forEach((row)=>{
           row.values = [{ operation : row.operation, val :row.value1, val2 : row.value2 }];
 
-          if(this.convertDataType(row.dataType)==2){
+          if(this.convertDataType(row)==2){
             let formatString = "YYYY-MM-DD";
-            if(row.values[0].operation=="datetime") formatString="YYYY-MM-DD HH:mm:ss";
+            if(this.getTimeType(row.values[0].operation)=="datetime") formatString="YYYY-MM-DD HH:mm:ss";
 
             row.values[0].val = [];
+            row.values[0].val2 = null;
             if(row.value1 && row.value1.length>0){
               row.values[0].val.push(dayjs(row.value1,formatString));
+              row.values[0].val2 = dayjs(row.value1,formatString);
             }
             if(row.value2 && row.value2.length>0){
               row.values[0].val.push(dayjs(row.value2,formatString));
             }
           }
+          if(row.dictionaryCode) this.getDictionary(row.dictionaryCode);
         });
 
         this.tagList = list;
+      },
+      getIsTimeLimit:function (operStr:String){
+        if(operStr==undefined || operStr==null) return true;
+        return operStr.split(',').length == 1;
+      },
+      getTimeType : function (operStr:String){
+        if(operStr==undefined || operStr==null) return 'date';
+        return operStr.split(',')[0];
+      },
+      getDictionary:async function (dicCode){
+        if(!this.dics[dicCode]) {
+          const result: any = await postData('temp/getDictionaryList', [dicCode]);
+          this.dics[dicCode] = result[dicCode];
+          this.dics[dicCode].splice(0, 0, {value:'', label:'空'});
+        }
+        console.log("dicCode", dicCode, this.dics);
+        return this.dics[dicCode];
       }
     }
   })
@@ -233,6 +299,9 @@
   .query-area-body-oper{
     width: 100px;
   }
+  .query-area-body-time{
+    width: 150px;
+  }
   .query-area-body-input{
     flex-grow: 1;
   }

+ 2 - 2
vue/src/views/query/index.vue

@@ -13,10 +13,10 @@
           :show-line="true"
           v-model:expandedKeys="subjectTrees.expandedKeys"
           :tree-data="subjectTrees.data">
-          <template #title="{ title, key, subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName }">
+          <template #title="{ title, key, subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryTypeId, dictionaryCode }">
             <div v-if="(fieldAlias)" class="query-index-tree-item"
                  draggable="true"
-                 @dragstart="onDragStart($event,{subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName})"
+                 @dragstart="onDragStart($event,{subId, fieldCode, fieldId, fieldName, fieldAlias, dataType, subjectName, queryType:queryTypeId, dictionaryCode})"
             >{{ title }}</div>
             <div v-else class="query-index-tree-item">{{ title }}</div>
           </template>