浏览代码

更改系统配置方式

Menethil 7 年之前
父节点
当前提交
83f86785ad

+ 28 - 324
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallSystem.java

@@ -16,92 +16,20 @@ public class LitemallSystem {
     /**
      *
      * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.key
+     * This field corresponds to the database column litemall_system.key_name
      *
      * @mbg.generated
      */
-    private String key;
+    private String keyName;
 
     /**
      *
      * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.name
+     * This field corresponds to the database column litemall_system.key_value
      *
      * @mbg.generated
      */
-    private String name;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.base_value
-     *
-     * @mbg.generated
-     */
-    private String baseValue;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.group
-     *
-     * @mbg.generated
-     */
-    private String group;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_1
-     *
-     * @mbg.generated
-     */
-    private String extraValue1;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_2
-     *
-     * @mbg.generated
-     */
-    private String extraValue2;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_3
-     *
-     * @mbg.generated
-     */
-    private String extraValue3;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_4
-     *
-     * @mbg.generated
-     */
-    private String extraValue4;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_5
-     *
-     * @mbg.generated
-     */
-    private String extraValue5;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column litemall_system.extra_value_6
-     *
-     * @mbg.generated
-     */
-    private String extraValue6;
+    private String keyValue;
 
     /**
      * This method was generated by MyBatis Generator.
@@ -129,242 +57,50 @@ public class LitemallSystem {
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.key
-     *
-     * @return the value of litemall_system.key
-     *
-     * @mbg.generated
-     */
-    public String getKey() {
-        return key;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.key
-     *
-     * @param key the value for litemall_system.key
-     *
-     * @mbg.generated
-     */
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.name
-     *
-     * @return the value of litemall_system.name
-     *
-     * @mbg.generated
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.name
-     *
-     * @param name the value for litemall_system.name
-     *
-     * @mbg.generated
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.base_value
-     *
-     * @return the value of litemall_system.base_value
-     *
-     * @mbg.generated
-     */
-    public String getBaseValue() {
-        return baseValue;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.base_value
-     *
-     * @param baseValue the value for litemall_system.base_value
-     *
-     * @mbg.generated
-     */
-    public void setBaseValue(String baseValue) {
-        this.baseValue = baseValue;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.group
-     *
-     * @return the value of litemall_system.group
-     *
-     * @mbg.generated
-     */
-    public String getGroup() {
-        return group;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.group
-     *
-     * @param group the value for litemall_system.group
-     *
-     * @mbg.generated
-     */
-    public void setGroup(String group) {
-        this.group = group;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_1
-     *
-     * @return the value of litemall_system.extra_value_1
-     *
-     * @mbg.generated
-     */
-    public String getExtraValue1() {
-        return extraValue1;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_1
-     *
-     * @param extraValue1 the value for litemall_system.extra_value_1
-     *
-     * @mbg.generated
-     */
-    public void setExtraValue1(String extraValue1) {
-        this.extraValue1 = extraValue1;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_2
-     *
-     * @return the value of litemall_system.extra_value_2
-     *
-     * @mbg.generated
-     */
-    public String getExtraValue2() {
-        return extraValue2;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_2
-     *
-     * @param extraValue2 the value for litemall_system.extra_value_2
-     *
-     * @mbg.generated
-     */
-    public void setExtraValue2(String extraValue2) {
-        this.extraValue2 = extraValue2;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_3
-     *
-     * @return the value of litemall_system.extra_value_3
-     *
-     * @mbg.generated
-     */
-    public String getExtraValue3() {
-        return extraValue3;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_3
-     *
-     * @param extraValue3 the value for litemall_system.extra_value_3
-     *
-     * @mbg.generated
-     */
-    public void setExtraValue3(String extraValue3) {
-        this.extraValue3 = extraValue3;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_4
-     *
-     * @return the value of litemall_system.extra_value_4
-     *
-     * @mbg.generated
-     */
-    public String getExtraValue4() {
-        return extraValue4;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_4
-     *
-     * @param extraValue4 the value for litemall_system.extra_value_4
-     *
-     * @mbg.generated
-     */
-    public void setExtraValue4(String extraValue4) {
-        this.extraValue4 = extraValue4;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_5
+     * This method returns the value of the database column litemall_system.key_name
      *
-     * @return the value of litemall_system.extra_value_5
+     * @return the value of litemall_system.key_name
      *
      * @mbg.generated
      */
-    public String getExtraValue5() {
-        return extraValue5;
+    public String getKeyName() {
+        return keyName;
     }
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_5
+     * This method sets the value of the database column litemall_system.key_name
      *
-     * @param extraValue5 the value for litemall_system.extra_value_5
+     * @param keyName the value for litemall_system.key_name
      *
      * @mbg.generated
      */
-    public void setExtraValue5(String extraValue5) {
-        this.extraValue5 = extraValue5;
+    public void setKeyName(String keyName) {
+        this.keyName = keyName;
     }
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column litemall_system.extra_value_6
+     * This method returns the value of the database column litemall_system.key_value
      *
-     * @return the value of litemall_system.extra_value_6
+     * @return the value of litemall_system.key_value
      *
      * @mbg.generated
      */
-    public String getExtraValue6() {
-        return extraValue6;
+    public String getKeyValue() {
+        return keyValue;
     }
 
     /**
      * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column litemall_system.extra_value_6
+     * This method sets the value of the database column litemall_system.key_value
      *
-     * @param extraValue6 the value for litemall_system.extra_value_6
+     * @param keyValue the value for litemall_system.key_value
      *
      * @mbg.generated
      */
-    public void setExtraValue6(String extraValue6) {
-        this.extraValue6 = extraValue6;
+    public void setKeyValue(String keyValue) {
+        this.keyValue = keyValue;
     }
 
     /**
@@ -380,16 +116,8 @@ public class LitemallSystem {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
-        sb.append(", key=").append(key);
-        sb.append(", name=").append(name);
-        sb.append(", baseValue=").append(baseValue);
-        sb.append(", group=").append(group);
-        sb.append(", extraValue1=").append(extraValue1);
-        sb.append(", extraValue2=").append(extraValue2);
-        sb.append(", extraValue3=").append(extraValue3);
-        sb.append(", extraValue4=").append(extraValue4);
-        sb.append(", extraValue5=").append(extraValue5);
-        sb.append(", extraValue6=").append(extraValue6);
+        sb.append(", keyName=").append(keyName);
+        sb.append(", keyValue=").append(keyValue);
         sb.append("]");
         return sb.toString();
     }
@@ -413,16 +141,8 @@ public class LitemallSystem {
         }
         LitemallSystem other = (LitemallSystem) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey()))
-            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
-            && (this.getBaseValue() == null ? other.getBaseValue() == null : this.getBaseValue().equals(other.getBaseValue()))
-            && (this.getGroup() == null ? other.getGroup() == null : this.getGroup().equals(other.getGroup()))
-            && (this.getExtraValue1() == null ? other.getExtraValue1() == null : this.getExtraValue1().equals(other.getExtraValue1()))
-            && (this.getExtraValue2() == null ? other.getExtraValue2() == null : this.getExtraValue2().equals(other.getExtraValue2()))
-            && (this.getExtraValue3() == null ? other.getExtraValue3() == null : this.getExtraValue3().equals(other.getExtraValue3()))
-            && (this.getExtraValue4() == null ? other.getExtraValue4() == null : this.getExtraValue4().equals(other.getExtraValue4()))
-            && (this.getExtraValue5() == null ? other.getExtraValue5() == null : this.getExtraValue5().equals(other.getExtraValue5()))
-            && (this.getExtraValue6() == null ? other.getExtraValue6() == null : this.getExtraValue6().equals(other.getExtraValue6()));
+            && (this.getKeyName() == null ? other.getKeyName() == null : this.getKeyName().equals(other.getKeyName()))
+            && (this.getKeyValue() == null ? other.getKeyValue() == null : this.getKeyValue().equals(other.getKeyValue()));
     }
 
     /**
@@ -436,16 +156,8 @@ public class LitemallSystem {
         final int prime = 31;
         int result = 1;
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
-        result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode());
-        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
-        result = prime * result + ((getBaseValue() == null) ? 0 : getBaseValue().hashCode());
-        result = prime * result + ((getGroup() == null) ? 0 : getGroup().hashCode());
-        result = prime * result + ((getExtraValue1() == null) ? 0 : getExtraValue1().hashCode());
-        result = prime * result + ((getExtraValue2() == null) ? 0 : getExtraValue2().hashCode());
-        result = prime * result + ((getExtraValue3() == null) ? 0 : getExtraValue3().hashCode());
-        result = prime * result + ((getExtraValue4() == null) ? 0 : getExtraValue4().hashCode());
-        result = prime * result + ((getExtraValue5() == null) ? 0 : getExtraValue5().hashCode());
-        result = prime * result + ((getExtraValue6() == null) ? 0 : getExtraValue6().hashCode());
+        result = prime * result + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
+        result = prime * result + ((getKeyValue() == null) ? 0 : getKeyValue().hashCode());
         return result;
     }
 
@@ -458,16 +170,8 @@ public class LitemallSystem {
      */
     public enum Column {
         id("id", "id", "INTEGER"),
-        key("key", "key", "VARCHAR"),
-        name("name", "name", "VARCHAR"),
-        baseValue("base_value", "baseValue", "VARCHAR"),
-        group("group", "group", "VARCHAR"),
-        extraValue1("extra_value_1", "extraValue1", "VARCHAR"),
-        extraValue2("extra_value_2", "extraValue2", "VARCHAR"),
-        extraValue3("extra_value_3", "extraValue3", "VARCHAR"),
-        extraValue4("extra_value_4", "extraValue4", "VARCHAR"),
-        extraValue5("extra_value_5", "extraValue5", "VARCHAR"),
-        extraValue6("extra_value_6", "extraValue6", "VARCHAR");
+        keyName("key_name", "keyName", "VARCHAR"),
+        keyValue("key_value", "keyValue", "VARCHAR");
 
         /**
          * This field was generated by MyBatis Generator.

+ 56 - 616
litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallSystemExample.java

@@ -285,703 +285,143 @@ public class LitemallSystemExample {
             return (Criteria) this;
         }
 
-        public Criteria andKeyIsNull() {
-            addCriterion("`key` is null");
+        public Criteria andKeyNameIsNull() {
+            addCriterion("key_name is null");
             return (Criteria) this;
         }
 
-        public Criteria andKeyIsNotNull() {
-            addCriterion("`key` is not null");
+        public Criteria andKeyNameIsNotNull() {
+            addCriterion("key_name is not null");
             return (Criteria) this;
         }
 
-        public Criteria andKeyEqualTo(String value) {
-            addCriterion("`key` =", value, "key");
+        public Criteria andKeyNameEqualTo(String value) {
+            addCriterion("key_name =", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyNotEqualTo(String value) {
-            addCriterion("`key` <>", value, "key");
+        public Criteria andKeyNameNotEqualTo(String value) {
+            addCriterion("key_name <>", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyGreaterThan(String value) {
-            addCriterion("`key` >", value, "key");
+        public Criteria andKeyNameGreaterThan(String value) {
+            addCriterion("key_name >", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyGreaterThanOrEqualTo(String value) {
-            addCriterion("`key` >=", value, "key");
+        public Criteria andKeyNameGreaterThanOrEqualTo(String value) {
+            addCriterion("key_name >=", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyLessThan(String value) {
-            addCriterion("`key` <", value, "key");
+        public Criteria andKeyNameLessThan(String value) {
+            addCriterion("key_name <", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyLessThanOrEqualTo(String value) {
-            addCriterion("`key` <=", value, "key");
+        public Criteria andKeyNameLessThanOrEqualTo(String value) {
+            addCriterion("key_name <=", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyLike(String value) {
-            addCriterion("`key` like", value, "key");
+        public Criteria andKeyNameLike(String value) {
+            addCriterion("key_name like", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyNotLike(String value) {
-            addCriterion("`key` not like", value, "key");
+        public Criteria andKeyNameNotLike(String value) {
+            addCriterion("key_name not like", value, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyIn(List<String> values) {
-            addCriterion("`key` in", values, "key");
+        public Criteria andKeyNameIn(List<String> values) {
+            addCriterion("key_name in", values, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyNotIn(List<String> values) {
-            addCriterion("`key` not in", values, "key");
+        public Criteria andKeyNameNotIn(List<String> values) {
+            addCriterion("key_name not in", values, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyBetween(String value1, String value2) {
-            addCriterion("`key` between", value1, value2, "key");
+        public Criteria andKeyNameBetween(String value1, String value2) {
+            addCriterion("key_name between", value1, value2, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andKeyNotBetween(String value1, String value2) {
-            addCriterion("`key` not between", value1, value2, "key");
+        public Criteria andKeyNameNotBetween(String value1, String value2) {
+            addCriterion("key_name not between", value1, value2, "keyName");
             return (Criteria) this;
         }
 
-        public Criteria andNameIsNull() {
-            addCriterion("`name` is null");
+        public Criteria andKeyValueIsNull() {
+            addCriterion("key_value is null");
             return (Criteria) this;
         }
 
-        public Criteria andNameIsNotNull() {
-            addCriterion("`name` is not null");
+        public Criteria andKeyValueIsNotNull() {
+            addCriterion("key_value is not null");
             return (Criteria) this;
         }
 
-        public Criteria andNameEqualTo(String value) {
-            addCriterion("`name` =", value, "name");
+        public Criteria andKeyValueEqualTo(String value) {
+            addCriterion("key_value =", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameNotEqualTo(String value) {
-            addCriterion("`name` <>", value, "name");
+        public Criteria andKeyValueNotEqualTo(String value) {
+            addCriterion("key_value <>", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameGreaterThan(String value) {
-            addCriterion("`name` >", value, "name");
+        public Criteria andKeyValueGreaterThan(String value) {
+            addCriterion("key_value >", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameGreaterThanOrEqualTo(String value) {
-            addCriterion("`name` >=", value, "name");
+        public Criteria andKeyValueGreaterThanOrEqualTo(String value) {
+            addCriterion("key_value >=", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameLessThan(String value) {
-            addCriterion("`name` <", value, "name");
+        public Criteria andKeyValueLessThan(String value) {
+            addCriterion("key_value <", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameLessThanOrEqualTo(String value) {
-            addCriterion("`name` <=", value, "name");
+        public Criteria andKeyValueLessThanOrEqualTo(String value) {
+            addCriterion("key_value <=", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameLike(String value) {
-            addCriterion("`name` like", value, "name");
+        public Criteria andKeyValueLike(String value) {
+            addCriterion("key_value like", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameNotLike(String value) {
-            addCriterion("`name` not like", value, "name");
+        public Criteria andKeyValueNotLike(String value) {
+            addCriterion("key_value not like", value, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameIn(List<String> values) {
-            addCriterion("`name` in", values, "name");
+        public Criteria andKeyValueIn(List<String> values) {
+            addCriterion("key_value in", values, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameNotIn(List<String> values) {
-            addCriterion("`name` not in", values, "name");
+        public Criteria andKeyValueNotIn(List<String> values) {
+            addCriterion("key_value not in", values, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameBetween(String value1, String value2) {
-            addCriterion("`name` between", value1, value2, "name");
+        public Criteria andKeyValueBetween(String value1, String value2) {
+            addCriterion("key_value between", value1, value2, "keyValue");
             return (Criteria) this;
         }
 
-        public Criteria andNameNotBetween(String value1, String value2) {
-            addCriterion("`name` not between", value1, value2, "name");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueIsNull() {
-            addCriterion("base_value is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueIsNotNull() {
-            addCriterion("base_value is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueEqualTo(String value) {
-            addCriterion("base_value =", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueNotEqualTo(String value) {
-            addCriterion("base_value <>", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueGreaterThan(String value) {
-            addCriterion("base_value >", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueGreaterThanOrEqualTo(String value) {
-            addCriterion("base_value >=", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueLessThan(String value) {
-            addCriterion("base_value <", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueLessThanOrEqualTo(String value) {
-            addCriterion("base_value <=", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueLike(String value) {
-            addCriterion("base_value like", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueNotLike(String value) {
-            addCriterion("base_value not like", value, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueIn(List<String> values) {
-            addCriterion("base_value in", values, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueNotIn(List<String> values) {
-            addCriterion("base_value not in", values, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueBetween(String value1, String value2) {
-            addCriterion("base_value between", value1, value2, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andBaseValueNotBetween(String value1, String value2) {
-            addCriterion("base_value not between", value1, value2, "baseValue");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupIsNull() {
-            addCriterion("`group` is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupIsNotNull() {
-            addCriterion("`group` is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupEqualTo(String value) {
-            addCriterion("`group` =", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupNotEqualTo(String value) {
-            addCriterion("`group` <>", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupGreaterThan(String value) {
-            addCriterion("`group` >", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupGreaterThanOrEqualTo(String value) {
-            addCriterion("`group` >=", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupLessThan(String value) {
-            addCriterion("`group` <", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupLessThanOrEqualTo(String value) {
-            addCriterion("`group` <=", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupLike(String value) {
-            addCriterion("`group` like", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupNotLike(String value) {
-            addCriterion("`group` not like", value, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupIn(List<String> values) {
-            addCriterion("`group` in", values, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupNotIn(List<String> values) {
-            addCriterion("`group` not in", values, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupBetween(String value1, String value2) {
-            addCriterion("`group` between", value1, value2, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andGroupNotBetween(String value1, String value2) {
-            addCriterion("`group` not between", value1, value2, "group");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1IsNull() {
-            addCriterion("extra_value_1 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1IsNotNull() {
-            addCriterion("extra_value_1 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1EqualTo(String value) {
-            addCriterion("extra_value_1 =", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1NotEqualTo(String value) {
-            addCriterion("extra_value_1 <>", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1GreaterThan(String value) {
-            addCriterion("extra_value_1 >", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_1 >=", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1LessThan(String value) {
-            addCriterion("extra_value_1 <", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_1 <=", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1Like(String value) {
-            addCriterion("extra_value_1 like", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1NotLike(String value) {
-            addCriterion("extra_value_1 not like", value, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1In(List<String> values) {
-            addCriterion("extra_value_1 in", values, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1NotIn(List<String> values) {
-            addCriterion("extra_value_1 not in", values, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1Between(String value1, String value2) {
-            addCriterion("extra_value_1 between", value1, value2, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue1NotBetween(String value1, String value2) {
-            addCriterion("extra_value_1 not between", value1, value2, "extraValue1");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2IsNull() {
-            addCriterion("extra_value_2 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2IsNotNull() {
-            addCriterion("extra_value_2 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2EqualTo(String value) {
-            addCriterion("extra_value_2 =", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2NotEqualTo(String value) {
-            addCriterion("extra_value_2 <>", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2GreaterThan(String value) {
-            addCriterion("extra_value_2 >", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_2 >=", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2LessThan(String value) {
-            addCriterion("extra_value_2 <", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_2 <=", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2Like(String value) {
-            addCriterion("extra_value_2 like", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2NotLike(String value) {
-            addCriterion("extra_value_2 not like", value, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2In(List<String> values) {
-            addCriterion("extra_value_2 in", values, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2NotIn(List<String> values) {
-            addCriterion("extra_value_2 not in", values, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2Between(String value1, String value2) {
-            addCriterion("extra_value_2 between", value1, value2, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue2NotBetween(String value1, String value2) {
-            addCriterion("extra_value_2 not between", value1, value2, "extraValue2");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3IsNull() {
-            addCriterion("extra_value_3 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3IsNotNull() {
-            addCriterion("extra_value_3 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3EqualTo(String value) {
-            addCriterion("extra_value_3 =", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3NotEqualTo(String value) {
-            addCriterion("extra_value_3 <>", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3GreaterThan(String value) {
-            addCriterion("extra_value_3 >", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_3 >=", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3LessThan(String value) {
-            addCriterion("extra_value_3 <", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_3 <=", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3Like(String value) {
-            addCriterion("extra_value_3 like", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3NotLike(String value) {
-            addCriterion("extra_value_3 not like", value, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3In(List<String> values) {
-            addCriterion("extra_value_3 in", values, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3NotIn(List<String> values) {
-            addCriterion("extra_value_3 not in", values, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3Between(String value1, String value2) {
-            addCriterion("extra_value_3 between", value1, value2, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue3NotBetween(String value1, String value2) {
-            addCriterion("extra_value_3 not between", value1, value2, "extraValue3");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4IsNull() {
-            addCriterion("extra_value_4 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4IsNotNull() {
-            addCriterion("extra_value_4 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4EqualTo(String value) {
-            addCriterion("extra_value_4 =", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4NotEqualTo(String value) {
-            addCriterion("extra_value_4 <>", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4GreaterThan(String value) {
-            addCriterion("extra_value_4 >", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_4 >=", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4LessThan(String value) {
-            addCriterion("extra_value_4 <", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_4 <=", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4Like(String value) {
-            addCriterion("extra_value_4 like", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4NotLike(String value) {
-            addCriterion("extra_value_4 not like", value, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4In(List<String> values) {
-            addCriterion("extra_value_4 in", values, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4NotIn(List<String> values) {
-            addCriterion("extra_value_4 not in", values, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4Between(String value1, String value2) {
-            addCriterion("extra_value_4 between", value1, value2, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue4NotBetween(String value1, String value2) {
-            addCriterion("extra_value_4 not between", value1, value2, "extraValue4");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5IsNull() {
-            addCriterion("extra_value_5 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5IsNotNull() {
-            addCriterion("extra_value_5 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5EqualTo(String value) {
-            addCriterion("extra_value_5 =", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5NotEqualTo(String value) {
-            addCriterion("extra_value_5 <>", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5GreaterThan(String value) {
-            addCriterion("extra_value_5 >", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_5 >=", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5LessThan(String value) {
-            addCriterion("extra_value_5 <", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_5 <=", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5Like(String value) {
-            addCriterion("extra_value_5 like", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5NotLike(String value) {
-            addCriterion("extra_value_5 not like", value, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5In(List<String> values) {
-            addCriterion("extra_value_5 in", values, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5NotIn(List<String> values) {
-            addCriterion("extra_value_5 not in", values, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5Between(String value1, String value2) {
-            addCriterion("extra_value_5 between", value1, value2, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue5NotBetween(String value1, String value2) {
-            addCriterion("extra_value_5 not between", value1, value2, "extraValue5");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6IsNull() {
-            addCriterion("extra_value_6 is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6IsNotNull() {
-            addCriterion("extra_value_6 is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6EqualTo(String value) {
-            addCriterion("extra_value_6 =", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6NotEqualTo(String value) {
-            addCriterion("extra_value_6 <>", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6GreaterThan(String value) {
-            addCriterion("extra_value_6 >", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6GreaterThanOrEqualTo(String value) {
-            addCriterion("extra_value_6 >=", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6LessThan(String value) {
-            addCriterion("extra_value_6 <", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6LessThanOrEqualTo(String value) {
-            addCriterion("extra_value_6 <=", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6Like(String value) {
-            addCriterion("extra_value_6 like", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6NotLike(String value) {
-            addCriterion("extra_value_6 not like", value, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6In(List<String> values) {
-            addCriterion("extra_value_6 in", values, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6NotIn(List<String> values) {
-            addCriterion("extra_value_6 not in", values, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6Between(String value1, String value2) {
-            addCriterion("extra_value_6 between", value1, value2, "extraValue6");
-            return (Criteria) this;
-        }
-
-        public Criteria andExtraValue6NotBetween(String value1, String value2) {
-            addCriterion("extra_value_6 not between", value1, value2, "extraValue6");
+        public Criteria andKeyValueNotBetween(String value1, String value2) {
+            addCriterion("key_value not between", value1, value2, "keyValue");
             return (Criteria) this;
         }
     }

+ 2 - 8
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallSystemCfgService.java

@@ -9,7 +9,7 @@ import javax.annotation.Resource;
 import java.util.List;
 
 @Service
-public class LitemallSystemCfgService {
+public class LitemallSystemConfigService {
     @Resource
     private LitemallSystemMapper systemMapper;
 
@@ -25,16 +25,10 @@ public class LitemallSystemCfgService {
 
     public LitemallSystem queryByKeyName(String keyName, String groupName) {
         LitemallSystemExample example = new LitemallSystemExample();
-        example.or().andGroupEqualTo(groupName).andKeyEqualTo(keyName);
+        example.or().andKeyNameEqualTo(keyName);
         return systemMapper.selectOneByExample(example);
     }
 
-    public List<LitemallSystem> queryByGroup(String groupName) {
-        LitemallSystemExample example = new LitemallSystemExample();
-        example.or().andGroupEqualTo(groupName);
-        return systemMapper.selectByExample(example);
-    }
-
     public void deleteById(Integer id) {
         systemMapper.deleteByPrimaryKey(id);
     }

+ 31 - 161
litemall-db/src/main/resources/org/linlinjava/litemall/db/dao/LitemallSystemMapper.xml

@@ -7,16 +7,8 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="key" jdbcType="VARCHAR" property="key" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="base_value" jdbcType="VARCHAR" property="baseValue" />
-    <result column="group" jdbcType="VARCHAR" property="group" />
-    <result column="extra_value_1" jdbcType="VARCHAR" property="extraValue1" />
-    <result column="extra_value_2" jdbcType="VARCHAR" property="extraValue2" />
-    <result column="extra_value_3" jdbcType="VARCHAR" property="extraValue3" />
-    <result column="extra_value_4" jdbcType="VARCHAR" property="extraValue4" />
-    <result column="extra_value_5" jdbcType="VARCHAR" property="extraValue5" />
-    <result column="extra_value_6" jdbcType="VARCHAR" property="extraValue6" />
+    <result column="key_name" jdbcType="VARCHAR" property="keyName" />
+    <result column="key_value" jdbcType="VARCHAR" property="keyValue" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -89,8 +81,7 @@
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
-    id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3, 
-    extra_value_4, extra_value_5, extra_value_6
+    id, key_name, key_value
   </sql>
   <select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample" resultMap="BaseResultMap">
     <!--
@@ -121,14 +112,13 @@
       distinct
     </if>
     <choose>
-      <when test="selective != null and selective.length > 0">
+      <when test="selective != null and selective.length &gt; 0">
         <foreach collection="selective" item="column" separator=",">
           ${column.value}
         </foreach>
       </when>
       <otherwise>
-        id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3, 
-          extra_value_4, extra_value_5, extra_value_6
+        id, key_name, key_value
       </otherwise>
     </choose>
     from litemall_system
@@ -157,14 +147,13 @@
     -->
     select
     <choose>
-      <when test="selective != null and selective.length > 0">
+      <when test="selective != null and selective.length &gt; 0">
         <foreach collection="selective" item="column" separator=",">
           ${column.value}
         </foreach>
       </when>
       <otherwise>
-        id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3, 
-          extra_value_4, extra_value_5, extra_value_6
+        id, key_name, key_value
       </otherwise>
     </choose>
     from litemall_system
@@ -196,14 +185,8 @@
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
       SELECT LAST_INSERT_ID()
     </selectKey>
-    insert into litemall_system (`key`, `name`, base_value, 
-      `group`, extra_value_1, extra_value_2, 
-      extra_value_3, extra_value_4, extra_value_5, 
-      extra_value_6)
-    values (#{key,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{baseValue,jdbcType=VARCHAR}, 
-      #{group,jdbcType=VARCHAR}, #{extraValue1,jdbcType=VARCHAR}, #{extraValue2,jdbcType=VARCHAR}, 
-      #{extraValue3,jdbcType=VARCHAR}, #{extraValue4,jdbcType=VARCHAR}, #{extraValue5,jdbcType=VARCHAR}, 
-      #{extraValue6,jdbcType=VARCHAR})
+    insert into litemall_system (key_name, key_value)
+    values (#{keyName,jdbcType=VARCHAR}, #{keyValue,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallSystem">
     <!--
@@ -215,67 +198,19 @@
     </selectKey>
     insert into litemall_system
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="key != null">
-        `key`,
+      <if test="keyName != null">
+        key_name,
       </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="baseValue != null">
-        base_value,
-      </if>
-      <if test="group != null">
-        `group`,
-      </if>
-      <if test="extraValue1 != null">
-        extra_value_1,
-      </if>
-      <if test="extraValue2 != null">
-        extra_value_2,
-      </if>
-      <if test="extraValue3 != null">
-        extra_value_3,
-      </if>
-      <if test="extraValue4 != null">
-        extra_value_4,
-      </if>
-      <if test="extraValue5 != null">
-        extra_value_5,
-      </if>
-      <if test="extraValue6 != null">
-        extra_value_6,
+      <if test="keyValue != null">
+        key_value,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="key != null">
-        #{key,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="baseValue != null">
-        #{baseValue,jdbcType=VARCHAR},
-      </if>
-      <if test="group != null">
-        #{group,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue1 != null">
-        #{extraValue1,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue2 != null">
-        #{extraValue2,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue3 != null">
-        #{extraValue3,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue4 != null">
-        #{extraValue4,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue5 != null">
-        #{extraValue5,jdbcType=VARCHAR},
+      <if test="keyName != null">
+        #{keyName,jdbcType=VARCHAR},
       </if>
-      <if test="extraValue6 != null">
-        #{extraValue6,jdbcType=VARCHAR},
+      <if test="keyValue != null">
+        #{keyValue,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -299,35 +234,11 @@
       <if test="record.id != null">
         id = #{record.id,jdbcType=INTEGER},
       </if>
-      <if test="record.key != null">
-        `key` = #{record.key,jdbcType=VARCHAR},
+      <if test="record.keyName != null">
+        key_name = #{record.keyName,jdbcType=VARCHAR},
       </if>
-      <if test="record.name != null">
-        `name` = #{record.name,jdbcType=VARCHAR},
-      </if>
-      <if test="record.baseValue != null">
-        base_value = #{record.baseValue,jdbcType=VARCHAR},
-      </if>
-      <if test="record.group != null">
-        `group` = #{record.group,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue1 != null">
-        extra_value_1 = #{record.extraValue1,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue2 != null">
-        extra_value_2 = #{record.extraValue2,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue3 != null">
-        extra_value_3 = #{record.extraValue3,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue4 != null">
-        extra_value_4 = #{record.extraValue4,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue5 != null">
-        extra_value_5 = #{record.extraValue5,jdbcType=VARCHAR},
-      </if>
-      <if test="record.extraValue6 != null">
-        extra_value_6 = #{record.extraValue6,jdbcType=VARCHAR},
+      <if test="record.keyValue != null">
+        key_value = #{record.keyValue,jdbcType=VARCHAR},
       </if>
     </set>
     <if test="_parameter != null">
@@ -341,16 +252,8 @@
     -->
     update litemall_system
     set id = #{record.id,jdbcType=INTEGER},
-      `key` = #{record.key,jdbcType=VARCHAR},
-      `name` = #{record.name,jdbcType=VARCHAR},
-      base_value = #{record.baseValue,jdbcType=VARCHAR},
-      `group` = #{record.group,jdbcType=VARCHAR},
-      extra_value_1 = #{record.extraValue1,jdbcType=VARCHAR},
-      extra_value_2 = #{record.extraValue2,jdbcType=VARCHAR},
-      extra_value_3 = #{record.extraValue3,jdbcType=VARCHAR},
-      extra_value_4 = #{record.extraValue4,jdbcType=VARCHAR},
-      extra_value_5 = #{record.extraValue5,jdbcType=VARCHAR},
-      extra_value_6 = #{record.extraValue6,jdbcType=VARCHAR}
+      key_name = #{record.keyName,jdbcType=VARCHAR},
+      key_value = #{record.keyValue,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -362,35 +265,11 @@
     -->
     update litemall_system
     <set>
-      <if test="key != null">
-        `key` = #{key,jdbcType=VARCHAR},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="baseValue != null">
-        base_value = #{baseValue,jdbcType=VARCHAR},
-      </if>
-      <if test="group != null">
-        `group` = #{group,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue1 != null">
-        extra_value_1 = #{extraValue1,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue2 != null">
-        extra_value_2 = #{extraValue2,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue3 != null">
-        extra_value_3 = #{extraValue3,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue4 != null">
-        extra_value_4 = #{extraValue4,jdbcType=VARCHAR},
-      </if>
-      <if test="extraValue5 != null">
-        extra_value_5 = #{extraValue5,jdbcType=VARCHAR},
+      <if test="keyName != null">
+        key_name = #{keyName,jdbcType=VARCHAR},
       </if>
-      <if test="extraValue6 != null">
-        extra_value_6 = #{extraValue6,jdbcType=VARCHAR},
+      <if test="keyValue != null">
+        key_value = #{keyValue,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
@@ -401,16 +280,8 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     update litemall_system
-    set `key` = #{key,jdbcType=VARCHAR},
-      `name` = #{name,jdbcType=VARCHAR},
-      base_value = #{baseValue,jdbcType=VARCHAR},
-      `group` = #{group,jdbcType=VARCHAR},
-      extra_value_1 = #{extraValue1,jdbcType=VARCHAR},
-      extra_value_2 = #{extraValue2,jdbcType=VARCHAR},
-      extra_value_3 = #{extraValue3,jdbcType=VARCHAR},
-      extra_value_4 = #{extraValue4,jdbcType=VARCHAR},
-      extra_value_5 = #{extraValue5,jdbcType=VARCHAR},
-      extra_value_6 = #{extraValue6,jdbcType=VARCHAR}
+    set key_name = #{keyName,jdbcType=VARCHAR},
+      key_value = #{keyValue,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample" resultMap="BaseResultMap">
@@ -438,14 +309,13 @@
     -->
     select
     <choose>
-      <when test="selective != null and selective.length > 0">
+      <when test="selective != null and selective.length &gt; 0">
         <foreach collection="selective" item="column" separator=",">
           ${column.value}
         </foreach>
       </when>
       <otherwise>
-        id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3, 
-          extra_value_4, extra_value_5, extra_value_6
+        id, key_name, key_value
       </otherwise>
     </choose>
     from litemall_system

+ 79 - 0
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/ConfigService.java

@@ -0,0 +1,79 @@
+package org.linlinjava.litemall.wx.service;
+
+import org.linlinjava.litemall.db.domain.LitemallSystem;
+import org.linlinjava.litemall.db.service.LitemallSystemConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class ConfigService {
+    private static ConfigService systemConfigService;
+
+    //系统配置组
+    private Map<String, String> systemConfig;
+
+    @Autowired
+    private LitemallSystemConfigService litemallSystemConfigService;
+
+    //不允许实例化
+    private ConfigService() {
+
+    }
+
+    /**
+     * 获取系统配置
+     *
+     * @param keyName 例如 : litemall.system.freight.value
+     * @return 返回该值的字符串
+     */
+    public String getSysValue(String keyName) {
+        keyName = "litemall.system." + keyName;
+        return systemConfig.get(keyName);
+    }
+
+    /**
+     * 获取系统配置数值型
+     *
+     * @param keyName 例如 : litemall.system.freight.value
+     * @return 返回该值的字符串
+     */
+    public Integer getSysValueInt(String keyName) {
+        keyName = "litemall.system." + keyName;
+        return Integer.parseInt(systemConfig.get(keyName));
+    }
+
+
+    /**
+     * 获取系统设置实例
+     *
+     * @return
+     */
+    public static ConfigService getCfg() {
+        return systemConfigService;
+    }
+
+
+    @PostConstruct
+    public void inist() {
+        systemConfigService = this;
+        systemConfigService.systemConfig = new HashMap<>();
+        systemConfigService.inistConfigs();
+    }
+
+    /**
+     * 读取全部配置
+     */
+    private void inistConfigs() {
+        List<LitemallSystem> list = litemallSystemConfigService.queryAll();
+        for (LitemallSystem item : list) {
+            //属于系统配置,放置到系统配置组
+            if (item.getKeyName().startsWith("litemall.system"))
+                systemConfig.put(item.getKeyName(), item.getKeyValue());
+        }
+    }
+}

+ 34 - 83
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/SystemConfig.java

@@ -1,106 +1,57 @@
 package org.linlinjava.litemall.wx.service;
 
-import org.linlinjava.litemall.db.domain.LitemallSystem;
-import org.linlinjava.litemall.db.service.LitemallSystemCfgService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-import java.util.List;
+import java.math.BigDecimal;
 
 /**
- * 系统通用设置服务类,注意用 getSystemConfig() 方法直接获取初始化的静态实例,重新读取配置调用 inist() 方法
+ * 系统设置
  */
-@Component
-public class SystemConfig {
-    public final static int LIMIT_NEW = 10001;
-    public final static int LIMIT_HOT = 10002;
-    public final static int LIMIT_BRAND = 10003;
-    public final static int LIMIT_TOPIC = 10004;
-    public final static int LIMIT_CALLIST = 10005;
-    public final static int LIMIT_CALGOOD = 10006;
-
-    public final static int BANNER_NEW = 11001;
-    public final static int BANNER_HOT = 11002;
-
-    public final static int BANNER_TITLE = 11101;
-    public final static int BANNER_IMAGE = 11102;
 
-    @Autowired
-    private LitemallSystemCfgService systemCfgService;
-    private List<LitemallSystem> systemConfigs;
-
-    private LitemallSystem indexLimitCfg;
-    private LitemallSystem newBannerCfg;
-    private LitemallSystem hotBannerCfg;
-
-    private static SystemConfig systemConfig;
-
-    public static SystemConfig getSystemConfig() {
-        return systemConfig;
+public class SystemConfig {
+    public static Integer getNewLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.new");
     }
 
-    @PostConstruct
-    public void inist() {
-        systemConfig = this;
-        systemConfig.systemConfigs = systemCfgService.queryAll();
-        systemConfig.inistConfigs();
+    public static Integer getHotLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.hot");
     }
 
-    public String getBannerInfo(final int banner, final int field) {
-        LitemallSystem cfg = null;
-        switch (banner) {
-            case BANNER_NEW:
-                cfg = newBannerCfg;
-                break;
-            case BANNER_HOT:
-                cfg = hotBannerCfg;
-                break;
-        }
+    public static Integer getBrandLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.brand");
+    }
 
-        if (cfg != null) {
-            switch (field) {
-                case BANNER_TITLE:
-                    return cfg.getBaseValue();
-                case BANNER_IMAGE:
-                    return cfg.getExtraValue1();
-            }
-        }
+    public static Integer getTopicLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.topic");
+    }
 
-        return null;
+    public static Integer getCatlogListLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.catloglist");
     }
 
+    public static Integer getCatlogMoreLimit() {
+        return ConfigService.getCfg().getSysValueInt("indexlimit.catloggood");
+    }
 
-    public Integer getIndexLimit(final int arg) {
-        switch (arg) {
-            case LIMIT_NEW:
-                return Integer.parseInt(indexLimitCfg.getExtraValue1());
-            case LIMIT_HOT:
-                return Integer.parseInt(indexLimitCfg.getExtraValue2());
-            case LIMIT_BRAND:
-                return Integer.parseInt(indexLimitCfg.getExtraValue3());
-            case LIMIT_TOPIC:
-                return Integer.parseInt(indexLimitCfg.getExtraValue4());
-            case LIMIT_CALLIST:
-                return Integer.parseInt(indexLimitCfg.getExtraValue5());
-            case LIMIT_CALGOOD:
-                return Integer.parseInt(indexLimitCfg.getExtraValue6());
-        }
+    public static String getHotBannerTitle() {
+        return ConfigService.getCfg().getSysValue("banner.hot.title");
+    }
 
-        return -1;
+    public static String getNewBannerTitle() {
+        return ConfigService.getCfg().getSysValue("banner.new.title");
     }
 
+    public static String getHotImageUrl() {
+        return ConfigService.getCfg().getSysValue("banner.hot.imageurl");
+    }
 
-    private void inistConfigs() {
-        for (LitemallSystem cfg : systemConfigs) {
-            if ("index_banner".equals(cfg.getGroup()) && "new".equals(cfg.getKey()))
-                newBannerCfg = cfg;
+    public static String getNewImageUrl() {
+        return ConfigService.getCfg().getSysValue("banner.new.imageurl");
+    }
 
-            if ("index_banner".equals(cfg.getGroup()) && "hot".equals(cfg.getKey()))
-                hotBannerCfg = cfg;
+    public static BigDecimal getFreight() {
+        return new BigDecimal(ConfigService.getCfg().getSysValue("freight.value"));
+    }
 
-            if ("index_limit".equals(cfg.getGroup()))
-                indexLimitCfg = cfg;
-        }
+    public static BigDecimal getFreightLimit() {
+        return new BigDecimal(ConfigService.getCfg().getSysValue("freight.limit"));
     }
 }

+ 5 - 5
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java

@@ -3,9 +3,9 @@ package org.linlinjava.litemall.wx.web;
 import com.mysql.jdbc.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.linlinjava.litemall.core.util.ResponseUtil;
 import org.linlinjava.litemall.db.domain.*;
 import org.linlinjava.litemall.db.service.*;
-import org.linlinjava.litemall.core.util.ResponseUtil;
 import org.linlinjava.litemall.wx.annotation.LoginUser;
 import org.linlinjava.litemall.wx.service.SystemConfig;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -280,8 +280,8 @@ public class WxGoodsController {
     public Object newGoods() {
         Map<String, String> bannerInfo = new HashMap<>();
         bannerInfo.put("url", "");
-        bannerInfo.put("name", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_NEW, SystemConfig.BANNER_TITLE));
-        bannerInfo.put("imgUrl", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_NEW, SystemConfig.BANNER_IMAGE));
+        bannerInfo.put("name", SystemConfig.getNewBannerTitle());
+        bannerInfo.put("imgUrl", SystemConfig.getNewImageUrl());
 
         Map<String, Object> data = new HashMap<>();
         data.put("bannerInfo", bannerInfo);
@@ -309,8 +309,8 @@ public class WxGoodsController {
     public Object hotGoods() {
         Map<String, String> bannerInfo = new HashMap<>();
         bannerInfo.put("url", "");
-        bannerInfo.put("name", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_HOT, SystemConfig.BANNER_TITLE));
-        bannerInfo.put("imgUrl", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_HOT, SystemConfig.BANNER_IMAGE));
+        bannerInfo.put("name", SystemConfig.getHotBannerTitle());
+        bannerInfo.put("imgUrl", SystemConfig.getHotImageUrl());
         Map<String, Object> data = new HashMap<>();
         data.put("bannerInfo", bannerInfo);
         return ResponseUtil.ok(data);

+ 7 - 7
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java

@@ -2,9 +2,9 @@ package org.linlinjava.litemall.wx.web;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.linlinjava.litemall.core.util.ResponseUtil;
 import org.linlinjava.litemall.db.domain.*;
 import org.linlinjava.litemall.db.service.*;
-import org.linlinjava.litemall.core.util.ResponseUtil;
 import org.linlinjava.litemall.wx.service.SystemConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -62,20 +62,20 @@ public class WxHomeController {
         List<LitemallCategory> channel = categoryService.queryChannel();
         data.put("channel", channel);
 
-        List<LitemallGoods> newGoods = goodsService.queryByNew(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_NEW));
+        List<LitemallGoods> newGoods = goodsService.queryByNew(0, SystemConfig.getNewLimit());
         data.put("newGoodsList", newGoods);
 
-        List<LitemallGoods> hotGoods = goodsService.queryByHot(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_HOT));
+        List<LitemallGoods> hotGoods = goodsService.queryByHot(0, SystemConfig.getHotLimit());
         data.put("hotGoodsList", hotGoods);
 
-        List<LitemallBrand> brandList = brandService.query(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_BRAND));
+        List<LitemallBrand> brandList = brandService.query(0, SystemConfig.getBrandLimit());
         data.put("brandList", brandList);
 
-        List<LitemallTopic> topicList = topicService.queryList(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_TOPIC));
+        List<LitemallTopic> topicList = topicService.queryList(0, SystemConfig.getTopicLimit());
         data.put("topicList", topicList);
 
         List<Map> categoryList = new ArrayList<>();
-        List<LitemallCategory> catL1List = categoryService.queryL1WithoutRecommend(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_CALLIST));
+        List<LitemallCategory> catL1List = categoryService.queryL1WithoutRecommend(0, SystemConfig.getCatlogListLimit());
         for (LitemallCategory catL1 : catL1List) {
             List<LitemallCategory> catL2List = categoryService.queryByPid(catL1.getId());
             List<Integer> l2List = new ArrayList<>();
@@ -87,7 +87,7 @@ public class WxHomeController {
             if (l2List.size() == 0) {
                 categoryGoods = new ArrayList<>();
             } else {
-                categoryGoods = goodsService.queryByCategory(l2List, 0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_CALGOOD));
+                categoryGoods = goodsService.queryByCategory(l2List, 0, SystemConfig.getCatlogMoreLimit());
             }
 
             Map catGoods = new HashMap();

+ 3 - 2
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java

@@ -18,6 +18,7 @@ import org.linlinjava.litemall.db.service.*;
 import org.linlinjava.litemall.db.util.OrderHandleOption;
 import org.linlinjava.litemall.db.util.OrderUtil;
 import org.linlinjava.litemall.wx.annotation.LoginUser;
+import org.linlinjava.litemall.wx.service.SystemConfig;
 import org.linlinjava.litemall.wx.util.IpUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.PlatformTransactionManager;
@@ -292,8 +293,8 @@ public class WxOrderController {
 
         // 根据订单商品总价计算运费,满88则免运费,否则8元;
         BigDecimal freightPrice = new BigDecimal(0.00);
-        if (checkedGoodsPrice.compareTo(new BigDecimal(88.00)) < 0) {
-            freightPrice = new BigDecimal(8.00);
+        if (checkedGoodsPrice.compareTo(SystemConfig.getFreightLimit()) < 0) {
+            freightPrice = SystemConfig.getFreight();
         }
 
         // 可以使用的其他钱,例如用户积分