1
0
suochencheng 7 лет назад
Родитель
Сommit
2fd83157de
37 измененных файлов с 3933 добавлено и 226 удалено
  1. 4 2
      awesome-admin.iml
  2. 26 0
      src/main/java/com/izouma/awesomeadmin/container/Lifecycle.java
  3. 70 0
      src/main/java/com/izouma/awesomeadmin/container/StartupListener.java
  4. 36 0
      src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.java
  5. 327 0
      src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.xml
  6. 0 2
      src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.xml
  7. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.java
  8. 237 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.xml
  9. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.java
  10. 235 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.xml
  11. 70 2
      src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSource.java
  12. 101 0
      src/main/java/com/izouma/awesomeadmin/model/DataSourceInfo.java
  13. 69 0
      src/main/java/com/izouma/awesomeadmin/model/TestBbb.java
  14. 69 0
      src/main/java/com/izouma/awesomeadmin/model/TestBbbCopy.java
  15. 27 0
      src/main/java/com/izouma/awesomeadmin/service/DataSourceInfoService.java
  16. 27 0
      src/main/java/com/izouma/awesomeadmin/service/TestBbbCopyService.java
  17. 27 0
      src/main/java/com/izouma/awesomeadmin/service/TestBbbService.java
  18. 137 0
      src/main/java/com/izouma/awesomeadmin/service/impl/DataSourceInfoServiceImpl.java
  19. 137 0
      src/main/java/com/izouma/awesomeadmin/service/impl/TestBbbCopyServiceImpl.java
  20. 137 0
      src/main/java/com/izouma/awesomeadmin/service/impl/TestBbbServiceImpl.java
  21. 64 0
      src/main/java/com/izouma/awesomeadmin/util/Const.java
  22. 22 0
      src/main/java/com/izouma/awesomeadmin/util/JDBC.java
  23. 159 0
      src/main/java/com/izouma/awesomeadmin/web/DataSourceInfoController.java
  24. 155 0
      src/main/java/com/izouma/awesomeadmin/web/TestBbbController.java
  25. 155 0
      src/main/java/com/izouma/awesomeadmin/web/TestBbbCopyController.java
  26. 4 41
      src/main/resources/spring/appDataSource.xml
  27. 22 2
      src/main/resources/templates/ListTemplate.vm
  28. 133 0
      src/main/vue/src/pages/DataSourceInfo.vue
  29. 327 0
      src/main/vue/src/pages/DataSourceInfos.vue
  30. 19 1
      src/main/vue/src/pages/TestAaa.vue
  31. 227 176
      src/main/vue/src/pages/TestAaas.vue
  32. 98 0
      src/main/vue/src/pages/TestBbb.vue
  33. 93 0
      src/main/vue/src/pages/TestBbbCopy.vue
  34. 325 0
      src/main/vue/src/pages/TestBbbCopys.vue
  35. 295 0
      src/main/vue/src/pages/TestBbbs.vue
  36. 30 0
      src/main/vue/src/router/index.js
  37. 3 0
      src/main/webapp/WEB-INF/web.xml

+ 4 - 2
awesome-admin.iml

@@ -30,6 +30,8 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.9" level="project" />
+    <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.5.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.5.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.5.RELEASE" level="project" />
@@ -54,7 +56,7 @@
     <orderEntry type="module-library">
       <library name="Maven: com.alibaba:jconsole:1.8.0">
         <CLASSES>
-          <root url="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/lib/jconsole.jar!/" />
+          <root url="jar://C:/Program Files/Java/jdk1.8.0_141/lib/jconsole.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
@@ -63,7 +65,7 @@
     <orderEntry type="module-library">
       <library name="Maven: com.alibaba:tools:1.8.0">
         <CLASSES>
-          <root url="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/lib/tools.jar!/" />
+          <root url="jar://C:/Program Files/Java/jdk1.8.0_141/lib/tools.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />

+ 26 - 0
src/main/java/com/izouma/awesomeadmin/container/Lifecycle.java

@@ -0,0 +1,26 @@
+package com.izouma.awesomeadmin.container;
+
+/**
+ * 启动项,可在容器启动时加载
+ * @author Administrator
+ *
+ */
+public interface Lifecycle {
+	/**
+	 * 启动初始化
+	 * @return
+	 */
+	boolean init();
+	
+	/**
+	 * 启动项信息
+	 * @return
+	 */
+	String getItemInfo();
+	
+	/**
+	 * 关闭
+	 * @return
+	 */
+	boolean close();	
+}

+ 70 - 0
src/main/java/com/izouma/awesomeadmin/container/StartupListener.java

@@ -0,0 +1,70 @@
+package com.izouma.awesomeadmin.container;
+
+import com.izouma.awesomeadmin.util.Const;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * 启动监听方法
+ *
+ * @author OnceMad
+ */
+public class StartupListener implements ServletContextListener {
+
+    private static List<Lifecycle> startups = new LinkedList<Lifecycle>();
+
+    static {
+        //startups.add(new PhotoCheckWorker());
+    }
+
+
+    @Override
+    public void contextInitialized(ServletContextEvent sce) {
+
+        System.out.println("==================context Initialized=====================");
+
+        for (Lifecycle lifecycle : startups) {
+            System.out.print(lifecycle.getItemInfo() + " is start ");
+            if (lifecycle.init()) {
+                System.out.println(" successfully.");
+            } else {
+                System.out.println(" fail.");
+            }
+        }
+
+        initConst();
+
+
+        System.out.println("============context Initialized successfully===============");
+    }
+
+
+    @Override
+    public void contextDestroyed(ServletContextEvent sce) {
+
+        System.out.println("==================context Destroyed=====================");
+
+        for (Lifecycle lifecycle : startups) {
+            System.out.print(lifecycle.getItemInfo() + " is close ");
+            if (lifecycle.close()) {
+                System.out.println(" successfully.");
+            } else {
+                System.out.println(" fail.");
+            }
+        }
+
+    }
+
+
+    private void initConst() {
+
+        Const con = new Const();
+        con.initData();
+        System.out.println("============init const successfully===============");
+    }
+
+
+}

+ 36 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.java

@@ -0,0 +1,36 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Dao接口
+ */
+@Component
+@Repository("com.zoumaframe.dao.DataSourceInfoMapper")
+public interface DataSourceInfoMapper {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(DataSourceInfo record);
+
+    DataSourceInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(DataSourceInfo record);
+
+    List<DataSourceInfo> queryAllDataSourceInfo(DataSourceInfo record);
+
+    List<DataSourceInfo> queryDataSourceInfoByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    DataSourceInfo queryDataSourceInfo(DataSourceInfo record);
+
+    List<DataSourceInfo> query(DataSourceInfo record);
+}
+

+ 327 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.xml

@@ -0,0 +1,327 @@
+<?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.izouma.awesomeadmin.dao.DataSourceInfoMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.DataSourceInfo" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="code" property="code" jdbcType="VARCHAR" />
+                                <result column="database_type" property="databaseType" jdbcType="VARCHAR" />
+                                <result column="url" property="url" jdbcType="VARCHAR" />
+                                <result column="username" property="username" jdbcType="VARCHAR" />
+                                <result column="password" property="password" jdbcType="VARCHAR" />
+                                <result column="database_name" property="databaseName" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            code,
+
+            database_type,
+
+            url,
+
+            username,
+
+            password,
+
+            database_name,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from data_source_info
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from data_source_info
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.DataSourceInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into data_source_info
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="code!= null" >
+                code,
+            </if>
+                <if test="databaseType!= null" >
+                database_type,
+            </if>
+                <if test="url!= null" >
+                url,
+            </if>
+                <if test="username!= null" >
+                username,
+            </if>
+                <if test="password!= null" >
+                password,
+            </if>
+                <if test="databaseName!= null" >
+                database_name,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="code != null" >
+                #{code,jdbcType=VARCHAR},
+            </if>
+                    <if test="databaseType != null" >
+                #{databaseType,jdbcType=VARCHAR},
+            </if>
+                    <if test="url != null" >
+                #{url,jdbcType=VARCHAR},
+            </if>
+                    <if test="username != null" >
+                #{username,jdbcType=VARCHAR},
+            </if>
+                    <if test="password != null" >
+                #{password,jdbcType=VARCHAR},
+            </if>
+                    <if test="databaseName != null" >
+                #{databaseName,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.DataSourceInfo" >
+        update data_source_info
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="code != null" >
+               code= #{code,jdbcType=VARCHAR},
+            </if>
+                     <if test="databaseType != null" >
+               database_type= #{databaseType,jdbcType=VARCHAR},
+            </if>
+                     <if test="url != null" >
+               url= #{url,jdbcType=VARCHAR},
+            </if>
+                     <if test="username != null" >
+               username= #{username,jdbcType=VARCHAR},
+            </if>
+                     <if test="password != null" >
+               password= #{password,jdbcType=VARCHAR},
+            </if>
+                     <if test="databaseName != null" >
+               database_name= #{databaseName,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryDataSourceInfoByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.code != null and !&quot;&quot;.equals(record.code)">
+                and  code = #{record.code}
+            </if>
+                     <if test="record.databaseType != null and !&quot;&quot;.equals(record.databaseType)">
+                and  database_type = #{record.databaseType}
+            </if>
+                     <if test="record.url != null and !&quot;&quot;.equals(record.url)">
+                and  url = #{record.url}
+            </if>
+                     <if test="record.username != null and !&quot;&quot;.equals(record.username)">
+                and  username = #{record.username}
+            </if>
+                     <if test="record.password != null and !&quot;&quot;.equals(record.password)">
+                and  password = #{record.password}
+            </if>
+                     <if test="record.databaseName != null and !&quot;&quot;.equals(record.databaseName)">
+                and  database_name = #{record.databaseName}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  code LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  database_type LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  url LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  username LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  password LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  database_name LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllDataSourceInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="code != null and !&quot;&quot;.equals(code)">
+                and  code = #{code}
+            </if>
+                    <if test="databaseType != null and !&quot;&quot;.equals(databaseType)">
+                and  database_type = #{databaseType}
+            </if>
+                    <if test="url != null and !&quot;&quot;.equals(url)">
+                and  url = #{url}
+            </if>
+                    <if test="username != null and !&quot;&quot;.equals(username)">
+                and  username = #{username}
+            </if>
+                    <if test="password != null and !&quot;&quot;.equals(password)">
+                and  password = #{password}
+            </if>
+                    <if test="databaseName != null and !&quot;&quot;.equals(databaseName)">
+                and  database_name = #{databaseName}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  code LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  database_type LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  url LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  username LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  password LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  database_name LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryDataSourceInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="code != null and !&quot;&quot;.equals(code)">
+                and code = #{code}
+            </if>
+                     <if test="databaseType != null and !&quot;&quot;.equals(databaseType)">
+                and database_type = #{databaseType}
+            </if>
+                     <if test="url != null and !&quot;&quot;.equals(url)">
+                and url = #{url}
+            </if>
+                     <if test="username != null and !&quot;&quot;.equals(username)">
+                and username = #{username}
+            </if>
+                     <if test="password != null and !&quot;&quot;.equals(password)">
+                and password = #{password}
+            </if>
+                     <if test="databaseName != null and !&quot;&quot;.equals(databaseName)">
+                and database_name = #{databaseName}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE data_source_info SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from data_source_info
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 0 - 2
src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.xml

@@ -133,7 +133,6 @@
                     OR test_name LIKE concat('%',#{record.searchKey},'%')
                     OR remark LIKE concat('%',#{record.searchKey},'%')
                     OR image_url LIKE concat('%',#{record.searchKey},'%')
-                    OR test_time LIKE concat('%',#{record.searchKey},'%')
                 </trim>
             </if>
 
@@ -205,7 +204,6 @@
                     OR test_name LIKE concat('%',#{searchKey},'%')
                     OR remark LIKE concat('%',#{searchKey},'%')
                     OR image_url LIKE concat('%',#{searchKey},'%')
-                    OR test_time LIKE concat('%',#{searchKey},'%')
                 </trim>
             </if>
             <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestBbbCopy;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestBbbCopyMapper")
+public interface TestBbbCopyMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestBbbCopy record);
+
+    TestBbbCopy selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestBbbCopy record);
+
+    List<TestBbbCopy> queryAllTestBbbCopy(TestBbbCopy record);
+
+    List<TestBbbCopy> queryTestBbbCopyByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestBbbCopy queryTestBbbCopy(TestBbbCopy record);
+
+    List<TestBbbCopy> query(TestBbbCopy record);
+}
+

+ 237 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.xml

@@ -0,0 +1,237 @@
+<?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.izouma.awesomeadmin.dao.TestBbbCopyMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestBbbCopy" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
+                                <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            name_aaa,
+
+            name_bbb,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_bbb_copy
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_bbb_copy
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" useGeneratedKeys="true" keyProperty="id">
+        insert into test_bbb_copy
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="nameAaa!= null" >
+                name_aaa,
+            </if>
+                <if test="nameBbb!= null" >
+                name_bbb,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="nameAaa != null" >
+                #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameBbb != null" >
+                #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" >
+        update test_bbb_copy
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="nameAaa != null" >
+               name_aaa= #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameBbb != null" >
+               name_bbb= #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestBbbCopyByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
+                and  name_aaa = #{record.nameAaa}
+            </if>
+                     <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
+                and  name_bbb = #{record.nameBbb}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                               OR  del_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and  name_aaa = #{nameAaa}
+            </if>
+                    <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and  name_bbb = #{nameBbb}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                OR  del_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_aaa LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_bbb LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and name_aaa = #{nameAaa}
+            </if>
+                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and name_bbb = #{nameBbb}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_bbb_copy SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestBbb;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestBbbMapper")
+public interface TestBbbMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestBbb record);
+
+    TestBbb selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestBbb record);
+
+    List<TestBbb> queryAllTestBbb(TestBbb record);
+
+    List<TestBbb> queryTestBbbByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestBbb queryTestBbb(TestBbb record);
+
+    List<TestBbb> query(TestBbb record);
+}
+

+ 235 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.xml

@@ -0,0 +1,235 @@
+<?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.izouma.awesomeadmin.dao.TestBbbMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestBbb" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
+                                <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            name_aaa,
+
+            name_bbb,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_bbb
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_bbb
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestBbb" useGeneratedKeys="true" keyProperty="id">
+        insert into test_bbb
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="nameAaa!= null" >
+                name_aaa,
+            </if>
+                <if test="nameBbb!= null" >
+                name_bbb,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="nameAaa != null" >
+                #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameBbb != null" >
+                #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestBbb" >
+        update test_bbb
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="nameAaa != null" >
+               name_aaa= #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameBbb != null" >
+               name_bbb= #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestBbbByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
+                and  name_aaa = #{record.nameAaa}
+            </if>
+                     <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
+                and  name_bbb = #{record.nameBbb}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestBbb" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and  name_aaa = #{nameAaa}
+            </if>
+                    <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and  name_bbb = #{nameBbb}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  name_aaa LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_bbb LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestBbb" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and name_aaa = #{nameAaa}
+            </if>
+                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and name_bbb = #{nameBbb}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_bbb SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 70 - 2
src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSource.java

@@ -1,13 +1,81 @@
 package com.izouma.awesomeadmin.datasource;
 
+import com.izouma.awesomeadmin.dao.DataSourceInfoMapper;
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import com.izouma.awesomeadmin.util.Const;
+import org.apache.commons.dbcp.BasicDataSource;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
 
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
+
 public class DynamicDataSource extends AbstractRoutingDataSource {
+    private static final Map targetDataSource = new HashMap<>();
+    protected DataSource masterDataSource;
+
+
+    @Override
+    protected DataSource determineTargetDataSource() {
+        // 根据数据库选择方案,拿到要访问的数据库
+        String dataSourceName = determineCurrentLookupKey();
+        if (dataSourceName.equals("dataSourceSqlserver")) {
+            DataSource datasource = (DataSource) targetDataSource.get(DynamicDataSourceHolder.getDataSource());
+            if (datasource == null) {
+                datasource = createDataSource(DynamicDataSourceHolder.getDataSource());
+                targetDataSource.put(DynamicDataSourceHolder.getDataSource(), datasource);
+            }
+            return datasource;
+        } else {
+            return masterDataSource;
+        }
+
+    }
 
     @Override
-    protected Object determineCurrentLookupKey() {
-        // 从自定义的位置获取数据源标识
+    protected String determineCurrentLookupKey() {
         return DynamicDataSourceHolder.getDataSource();
     }
 
+    public DataSource getMasterDataSource() {
+        return masterDataSource;
+    }
+
+    public void setMasterDataSource(DataSource masterDataSource) {
+        this.masterDataSource = masterDataSource;
+    }
+
+    //创建数据源
+    private BasicDataSource createDataSource(String datasource) {
+
+        // 查询所需信息
+        DataSourceInfo dataSourceInfo = Const.DataSourceInfoMap.get(datasource);
+
+        if (dataSourceInfo != null) {
+
+            if ("Mysql".equals(dataSourceInfo.getDatabaseType())) {
+                return createDataSource("com.mysql.jdbc.Driver", "jdbc:mysql://" + dataSourceInfo.getUrl() + "/" + dataSourceInfo.getDatabaseName(), dataSourceInfo.getUsername(), dataSourceInfo.getPassword());
+            } else if ("SqlServer".equals(dataSourceInfo.getDatabaseType())) {
+
+                return createDataSource("com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://" + dataSourceInfo.getUrl() + ";DatabaseName=" + dataSourceInfo.getDatabaseName(), dataSourceInfo.getUsername(), dataSourceInfo.getPassword());
+            }
+
+        }
+        return null;
+    }
+
+    //创建数据源
+    private BasicDataSource createDataSource(String driverClassName, String url,
+                                             String username, String password) {
+        BasicDataSource dataSource = new BasicDataSource();
+        dataSource.setDriverClassName(driverClassName);
+        dataSource.setUrl(url);
+        dataSource.setUsername(username);
+        dataSource.setPassword(password);
+        dataSource.setTestWhileIdle(true);
+
+        return dataSource;
+    }
+
 }

+ 101 - 0
src/main/java/com/izouma/awesomeadmin/model/DataSourceInfo.java

@@ -0,0 +1,101 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class DataSourceInfo{
+    private Integer id;
+    private String delFlag;
+    private String code;
+    private String databaseType;
+    private String url;
+    private String username;
+    private String password;
+    private String databaseName;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getCode(){
+        return this.code;
+    }
+
+    public void setCode(String code){
+        this.code = code;
+    }
+    public String getDatabaseType(){
+        return this.databaseType;
+    }
+
+    public void setDatabaseType(String databaseType){
+        this.databaseType = databaseType;
+    }
+    public String getUrl(){
+        return this.url;
+    }
+
+    public void setUrl(String url){
+        this.url = url;
+    }
+    public String getUsername(){
+        return this.username;
+    }
+
+    public void setUsername(String username){
+        this.username = username;
+    }
+    public String getPassword(){
+        return this.password;
+    }
+
+    public void setPassword(String password){
+        this.password = password;
+    }
+    public String getDatabaseName(){
+        return this.databaseName;
+    }
+
+    public void setDatabaseName(String databaseName){
+        this.databaseName = databaseName;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

+ 69 - 0
src/main/java/com/izouma/awesomeadmin/model/TestBbb.java

@@ -0,0 +1,69 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TestBbb{
+    private Integer id;
+    private String delFlag;
+    private String nameAaa;
+    private String nameBbb;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getNameAaa(){
+        return this.nameAaa;
+    }
+
+    public void setNameAaa(String nameAaa){
+        this.nameAaa = nameAaa;
+    }
+    public String getNameBbb(){
+        return this.nameBbb;
+    }
+
+    public void setNameBbb(String nameBbb){
+        this.nameBbb = nameBbb;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

+ 69 - 0
src/main/java/com/izouma/awesomeadmin/model/TestBbbCopy.java

@@ -0,0 +1,69 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TestBbbCopy{
+    private String id;
+    private String delFlag;
+    private String nameAaa;
+    private String nameBbb;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public String getId(){
+        return this.id;
+    }
+
+    public void setId(String id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getNameAaa(){
+        return this.nameAaa;
+    }
+
+    public void setNameAaa(String nameAaa){
+        this.nameAaa = nameAaa;
+    }
+    public String getNameBbb(){
+        return this.nameBbb;
+    }
+
+    public void setNameBbb(String nameBbb){
+        this.nameBbb = nameBbb;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/DataSourceInfoService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+
+
+/**
+*  service接口类
+*/
+public interface DataSourceInfoService{
+
+    List<DataSourceInfo> getDataSourceInfoList(DataSourceInfo record);
+
+    List<DataSourceInfo> getDataSourceInfoByPage(Page page, DataSourceInfo record);
+
+    DataSourceInfo getDataSourceInfoById(String id);
+
+    DataSourceInfo getDataSourceInfo(DataSourceInfo record);
+
+    boolean createDataSourceInfo(DataSourceInfo record);
+
+    boolean deleteDataSourceInfo(String id);
+
+    boolean updateDataSourceInfo(DataSourceInfo record);
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/TestBbbCopyService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestBbbCopy;
+
+
+/**
+*  service接口类
+*/
+public interface TestBbbCopyService{
+
+    List<TestBbbCopy> getTestBbbCopyList(TestBbbCopy record);
+
+    List<TestBbbCopy> getTestBbbCopyByPage(Page page, TestBbbCopy record);
+
+    TestBbbCopy getTestBbbCopyById(String id);
+
+    TestBbbCopy getTestBbbCopy(TestBbbCopy record);
+
+    boolean createTestBbbCopy(TestBbbCopy record);
+
+    boolean deleteTestBbbCopy(String id);
+
+    boolean updateTestBbbCopy(TestBbbCopy record);
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/TestBbbService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestBbb;
+
+
+/**
+*  service接口类
+*/
+public interface TestBbbService{
+
+    List<TestBbb> getTestBbbList(TestBbb record);
+
+    List<TestBbb> getTestBbbByPage(Page page, TestBbb record);
+
+    TestBbb getTestBbbById(String id);
+
+    TestBbb getTestBbb(TestBbb record);
+
+    boolean createTestBbb(TestBbb record);
+
+    boolean deleteTestBbb(String id);
+
+    boolean updateTestBbb(TestBbb record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/DataSourceInfoServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import com.izouma.awesomeadmin.service.DataSourceInfoService;
+import com.izouma.awesomeadmin.dao.DataSourceInfoMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class DataSourceInfoServiceImpl implements DataSourceInfoService{
+
+    private static Logger logger = Logger.getLogger(DataSourceInfoServiceImpl.class);
+
+    @Autowired
+    private DataSourceInfoMapper dataSourceInfoMapper;
+
+    @Override
+    public List<DataSourceInfo> getDataSourceInfoList(DataSourceInfo record) {
+
+        logger.info("getDataSourceInfoList");
+        try {
+
+        return dataSourceInfoMapper.queryAllDataSourceInfo(record);
+        } catch (Exception e) {
+        logger.error("getDataSourceInfoList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<DataSourceInfo> getDataSourceInfoByPage(Page page, DataSourceInfo record) {
+
+        logger.info("getDataSourceInfoByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return dataSourceInfoMapper.queryDataSourceInfoByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getDataSourceInfoByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public DataSourceInfo getDataSourceInfoById(String id) {
+
+        logger.info("getDataSourceInfoyId");
+        try {
+
+            return dataSourceInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getDataSourceInfoById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public DataSourceInfo getDataSourceInfo(DataSourceInfo record) {
+
+        logger.info("getDataSourceInfo");
+        try {
+
+            return dataSourceInfoMapper.queryDataSourceInfo(record);
+        } catch (Exception e) {
+        logger.error("getDataSourceInfo", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createDataSourceInfo(DataSourceInfo record) {
+
+        logger.info("createDataSourceInfo");
+        try {
+
+            int updates = dataSourceInfoMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createDataSourceInfo", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteDataSourceInfo(String id) {
+
+        logger.info("deleteDataSourceInfo");
+        try {
+
+             int updates = dataSourceInfoMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteDataSourceInfo", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateDataSourceInfo(DataSourceInfo record) {
+
+        logger.info("updateDataSourceInfo");
+        try {
+
+            int updates = dataSourceInfoMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateDataSourceInfo", e);
+        }
+
+        return false;
+    }
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/TestBbbCopyServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestBbbCopy;
+import com.izouma.awesomeadmin.service.TestBbbCopyService;
+import com.izouma.awesomeadmin.dao.TestBbbCopyMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestBbbCopyServiceImpl implements TestBbbCopyService{
+
+    private static Logger logger = Logger.getLogger(TestBbbCopyServiceImpl.class);
+
+    @Autowired
+    private TestBbbCopyMapper testBbbCopyMapper;
+
+    @Override
+    public List<TestBbbCopy> getTestBbbCopyList(TestBbbCopy record) {
+
+        logger.info("getTestBbbCopyList");
+        try {
+
+        return testBbbCopyMapper.queryAllTestBbbCopy(record);
+        } catch (Exception e) {
+        logger.error("getTestBbbCopyList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<TestBbbCopy> getTestBbbCopyByPage(Page page, TestBbbCopy record) {
+
+        logger.info("getTestBbbCopyByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testBbbCopyMapper.queryTestBbbCopyByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestBbbCopyByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestBbbCopy getTestBbbCopyById(String id) {
+
+        logger.info("getTestBbbCopyyId");
+        try {
+
+            return testBbbCopyMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestBbbCopyById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestBbbCopy getTestBbbCopy(TestBbbCopy record) {
+
+        logger.info("getTestBbbCopy");
+        try {
+
+            return testBbbCopyMapper.queryTestBbbCopy(record);
+        } catch (Exception e) {
+        logger.error("getTestBbbCopy", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestBbbCopy(TestBbbCopy record) {
+
+        logger.info("createTestBbbCopy");
+        try {
+
+            int updates = testBbbCopyMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestBbbCopy", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestBbbCopy(String id) {
+
+        logger.info("deleteTestBbbCopy");
+        try {
+
+             int updates = testBbbCopyMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestBbbCopy", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestBbbCopy(TestBbbCopy record) {
+
+        logger.info("updateTestBbbCopy");
+        try {
+
+            int updates = testBbbCopyMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestBbbCopy", e);
+        }
+
+        return false;
+    }
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/TestBbbServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestBbb;
+import com.izouma.awesomeadmin.service.TestBbbService;
+import com.izouma.awesomeadmin.dao.TestBbbMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestBbbServiceImpl implements TestBbbService{
+
+    private static Logger logger = Logger.getLogger(TestBbbServiceImpl.class);
+
+    @Autowired
+    private TestBbbMapper testBbbMapper;
+
+    @Override
+    public List<TestBbb> getTestBbbList(TestBbb record) {
+
+        logger.info("getTestBbbList");
+        try {
+
+        return testBbbMapper.queryAllTestBbb(record);
+        } catch (Exception e) {
+        logger.error("getTestBbbList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<TestBbb> getTestBbbByPage(Page page, TestBbb record) {
+
+        logger.info("getTestBbbByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testBbbMapper.queryTestBbbByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestBbbByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestBbb getTestBbbById(String id) {
+
+        logger.info("getTestBbbyId");
+        try {
+
+            return testBbbMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestBbbById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestBbb getTestBbb(TestBbb record) {
+
+        logger.info("getTestBbb");
+        try {
+
+            return testBbbMapper.queryTestBbb(record);
+        } catch (Exception e) {
+        logger.error("getTestBbb", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestBbb(TestBbb record) {
+
+        logger.info("createTestBbb");
+        try {
+
+            int updates = testBbbMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestBbb", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestBbb(String id) {
+
+        logger.info("deleteTestBbb");
+        try {
+
+             int updates = testBbbMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestBbb", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestBbb(TestBbb record) {
+
+        logger.info("updateTestBbb");
+        try {
+
+            int updates = testBbbMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestBbb", e);
+        }
+
+        return false;
+    }
+}
+

+ 64 - 0
src/main/java/com/izouma/awesomeadmin/util/Const.java

@@ -0,0 +1,64 @@
+package com.izouma.awesomeadmin.util;
+
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Const {
+
+    public static Map<String, DataSourceInfo> DataSourceInfoMap = new HashMap<>();
+
+
+    // 加载必要常量
+    public void initData() {
+        loadDataSourceInfo();
+    }
+
+
+    private void loadDataSourceInfo() {
+
+        String DRIVER = "com.mysql.jdbc.Driver";
+
+        PropertiesFileLoader propertiesFileLoader = PropertiesFileLoader.getInstance();
+        propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.url");
+
+        String url = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.url");
+        String user = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.username");
+        String password = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.password");
+
+
+        String sql = "SELECT * FROM data_source_info WHERE del_flag = 'N'";
+        Connection conn = JDBC.connectDB(DRIVER, url, user, password);
+        try {
+            Statement stmt = conn.createStatement();
+            ResultSet rs = stmt.executeQuery(sql);
+            while (rs.next()) {
+                DataSourceInfo dataSourceInfo = new DataSourceInfo();
+                dataSourceInfo.setId(rs.getInt(1));
+                dataSourceInfo.setCode(rs.getString(3));
+                dataSourceInfo.setDatabaseType(rs.getString(4));
+                dataSourceInfo.setUrl(rs.getString(5));
+                dataSourceInfo.setUsername(rs.getString(6));
+                dataSourceInfo.setPassword(rs.getString(7));
+                dataSourceInfo.setDatabaseName(rs.getString(8));
+
+                DataSourceInfoMap.put(rs.getString(3), dataSourceInfo);
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                conn.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+}

+ 22 - 0
src/main/java/com/izouma/awesomeadmin/util/JDBC.java

@@ -0,0 +1,22 @@
+package com.izouma.awesomeadmin.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+public abstract class JDBC {
+
+    public static synchronized Connection connectDB(String DRIVER, String URL, String USER, String PASSWORD) {
+        try {
+            Class.forName(DRIVER);
+            Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
+            System.out.println("JDBCUtils connect DB successful!");
+            return conn;
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("JDBCUtils connect DB error!");
+            return null;
+        }
+    }
+}
+
+

+ 159 - 0
src/main/java/com/izouma/awesomeadmin/web/DataSourceInfoController.java

@@ -0,0 +1,159 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import com.izouma.awesomeadmin.service.DataSourceInfoService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/dataSourceInfo")
+public class DataSourceInfoController extends BaseController{
+
+    @Autowired
+    private DataSourceInfoService dataSourceInfoService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(DataSourceInfo record) {
+        List<DataSourceInfo> pp = dataSourceInfoService.getDataSourceInfoList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getDataSourceInfo", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getDataSourceInfo(@RequestParam(required = false, value = "id") String id) {
+        DataSourceInfo data = dataSourceInfoService.getDataSourceInfoById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(DataSourceInfo record) {
+        DataSourceInfo data = dataSourceInfoService.getDataSourceInfo(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, DataSourceInfo record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<DataSourceInfo> pp =dataSourceInfoService.getDataSourceInfoByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(DataSourceInfo record) {
+        boolean num = dataSourceInfoService.createDataSourceInfo(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateDataSourceInfo(DataSourceInfo record) {
+        boolean num = dataSourceInfoService.updateDataSourceInfo(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteDataSourceInfo(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = dataSourceInfoService.deleteDataSourceInfo(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, DataSourceInfo record) throws Exception {
+
+    List<DataSourceInfo> dataSourceInfos = dataSourceInfoService.getDataSourceInfoList(record);
+
+
+        String sheetName = "data_source_info";
+        String titleName = "数据库配置数据表";
+        String fileName = "数据库配置表";
+        int columnNumber = 8;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "code" ,   "数据库类型" ,   "链接" ,   "用户名" ,   "密码" ,   "名称"  };
+        String[][] dataList = new String[dataSourceInfos.size()][8];
+
+        for (int i = 0; i < dataSourceInfos.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(dataSourceInfos.get(i).getId());
+                        dataList[i][1] = String.valueOf(dataSourceInfos.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(dataSourceInfos.get(i).getCode());
+                        dataList[i][3] = String.valueOf(dataSourceInfos.get(i).getDatabaseType());
+                        dataList[i][4] = String.valueOf(dataSourceInfos.get(i).getUrl());
+                        dataList[i][5] = String.valueOf(dataSourceInfos.get(i).getUsername());
+                        dataList[i][6] = String.valueOf(dataSourceInfos.get(i).getPassword());
+                        dataList[i][7] = String.valueOf(dataSourceInfos.get(i).getDatabaseName());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 155 - 0
src/main/java/com/izouma/awesomeadmin/web/TestBbbController.java

@@ -0,0 +1,155 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.TestBbb;
+import com.izouma.awesomeadmin.service.TestBbbService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/testBbb")
+public class TestBbbController extends BaseController{
+
+    @Autowired
+    private TestBbbService testBbbService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(TestBbb record) {
+        List<TestBbb> pp = testBbbService.getTestBbbList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getTestBbb", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getTestBbb(@RequestParam(required = false, value = "id") String id) {
+        TestBbb data = testBbbService.getTestBbbById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(TestBbb record) {
+        TestBbb data = testBbbService.getTestBbb(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, TestBbb record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<TestBbb> pp =testBbbService.getTestBbbByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(TestBbb record) {
+        boolean num = testBbbService.createTestBbb(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateTestBbb(TestBbb record) {
+        boolean num = testBbbService.updateTestBbb(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteTestBbb(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = testBbbService.deleteTestBbb(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, TestBbb record) throws Exception {
+
+    List<TestBbb> testBbbs = testBbbService.getTestBbbList(record);
+
+
+        String sheetName = "test_bbb";
+        String titleName = "test_bbb数据表";
+        String fileName = "test_bbb表";
+        int columnNumber = 4;
+        int[] columnWidth = { 20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "名称1" ,   "名称2"  };
+        String[][] dataList = new String[testBbbs.size()][4];
+
+        for (int i = 0; i < testBbbs.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(testBbbs.get(i).getId());
+                        dataList[i][1] = String.valueOf(testBbbs.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(testBbbs.get(i).getNameAaa());
+                        dataList[i][3] = String.valueOf(testBbbs.get(i).getNameBbb());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 155 - 0
src/main/java/com/izouma/awesomeadmin/web/TestBbbCopyController.java

@@ -0,0 +1,155 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.TestBbbCopy;
+import com.izouma.awesomeadmin.service.TestBbbCopyService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/testBbbCopy")
+public class TestBbbCopyController extends BaseController{
+
+    @Autowired
+    private TestBbbCopyService testBbbCopyService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(TestBbbCopy record) {
+        List<TestBbbCopy> pp = testBbbCopyService.getTestBbbCopyList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getTestBbbCopy", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getTestBbbCopy(@RequestParam(required = false, value = "id") String id) {
+        TestBbbCopy data = testBbbCopyService.getTestBbbCopyById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(TestBbbCopy record) {
+        TestBbbCopy data = testBbbCopyService.getTestBbbCopy(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, TestBbbCopy record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<TestBbbCopy> pp =testBbbCopyService.getTestBbbCopyByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(TestBbbCopy record) {
+        boolean num = testBbbCopyService.createTestBbbCopy(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateTestBbbCopy(TestBbbCopy record) {
+        boolean num = testBbbCopyService.updateTestBbbCopy(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteTestBbbCopy(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = testBbbCopyService.deleteTestBbbCopy(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, TestBbbCopy record) throws Exception {
+
+    List<TestBbbCopy> testBbbCopys = testBbbCopyService.getTestBbbCopyList(record);
+
+
+        String sheetName = "test_bbb_copy";
+        String titleName = "test_bbb_copy数据表";
+        String fileName = "test_bbb_copy表";
+        int columnNumber = 4;
+        int[] columnWidth = { 20,  20,  20,  20 };
+        String[] columnName = {  "id" ,   "删除标识" ,   "名称1" ,   "名称2"  };
+        String[][] dataList = new String[testBbbCopys.size()][4];
+
+        for (int i = 0; i < testBbbCopys.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(testBbbCopys.get(i).getId());
+                        dataList[i][1] = String.valueOf(testBbbCopys.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(testBbbCopys.get(i).getNameAaa());
+                        dataList[i][3] = String.valueOf(testBbbCopys.get(i).getNameBbb());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 4 - 41
src/main/resources/spring/appDataSource.xml

@@ -44,55 +44,16 @@
     </bean>
 
 
-    <!-- 配置从数据源 -->
-    <bean id="dataSourceSlaver" class="com.mchange.v2.c3p0.ComboPooledDataSource">
-        <property name="driverClass" value="${jdbc.driverClassName}"/>
-        <property name="jdbcUrl" value="${jdbc.slaver.url}"/>
-        <property name="user" value="${jdbc.slaver.username}"/>
-        <property name="password" value="${jdbc.slaver.password}"/>
-
-        <!-- c3p0链接池的私有属性 -->
-        <property name="maxPoolSize" value="10"/>
-        <property name="minPoolSize" value="5"/>
-        <!-- 关闭连接hou不自动commit -->
-        <property name="autoCommitOnClose" value="false"/>
-        <!-- 获取连接超时时间 -->
-        <property name="checkoutTimeout" value="10000"/>
-        <!-- 当获取链接失败重试次数 -->
-        <property name="acquireRetryAttempts" value="2"/>
-    </bean>
-
-
-    <!-- 配置从数据源 -->
-    <bean id="dataSourceSqlserver" class="com.mchange.v2.c3p0.ComboPooledDataSource">
-        <property name="driverClass" value="${sqlserver.driver}"/>
-        <property name="jdbcUrl" value="${sqlserver.url}"/>
-        <property name="user" value="${sqlserver.user}"/>
-        <property name="password" value="${sqlserver.password}"/>
-
-        <!-- c3p0链接池的私有属性 -->
-        <property name="maxPoolSize" value="10"/>
-        <property name="minPoolSize" value="5"/>
-        <!-- 关闭连接hou不自动commit -->
-        <property name="autoCommitOnClose" value="false"/>
-        <!-- 获取连接超时时间 -->
-        <property name="checkoutTimeout" value="10000"/>
-        <!-- 当获取链接失败重试次数 -->
-        <property name="acquireRetryAttempts" value="2"/>
-    </bean>
-
-
     <bean id="dynamicDataSource" class="com.izouma.awesomeadmin.datasource.DynamicDataSource">
         <property name="targetDataSources">
             <map key-type="java.lang.String">
                 <!-- 指定lookupKey和与之对应的数据源 -->
                 <entry key="dataSource" value-ref="dataSource"></entry>
-                <entry key="dataSourceSlaver" value-ref="dataSourceSlaver"></entry>
-                <entry key="dataSourceSqlserver" value-ref="dataSourceSqlserver"></entry>
             </map>
         </property>
         <!-- 这里可以指定默认的数据源 -->
         <property name="defaultTargetDataSource" ref="dataSource"/>
+        <property name="masterDataSource"  ref="dataSource"></property>
     </bean>
 
 
@@ -105,10 +66,10 @@
             <!--</aop:aspect>-->
         <!--</aop:config>-->
 
-
     <!--开启aop注解模式-->
     <aop:aspectj-autoproxy/>
 
+
     <!--3: 配置 SqlSessionFactory 对象-->
     <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
         <!-- 注入数据库连接池 -->
@@ -131,4 +92,6 @@
 
     </bean>
 
+
+
 </beans>

+ 22 - 2
src/main/resources/templates/ListTemplate.vm

@@ -65,9 +65,12 @@
             <el-table-column
                     label="操作"
                     align="center"
-                    fixed="right">
+                    fixed="right"
+                    min-width="150"
+            >
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -286,7 +289,24 @@
             searchData() {
                 this.currentPage = 1;
                 this.getData();
-            }
+            },
+            deleteRow(row) {
+                this.${esc.d}alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.${esc.d}http.post({
+                    url: '/${display.uncapitalize($model.className)}/del',
+                    data: { id: row.id }
+                    })
+                }).then(() => {
+                    this.${esc.d}message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.${esc.d}message.info('删除取消');
+                    } else {
+                        this.${esc.d}message.error('删除失败');
+                    }
+                })
+            },
 
         }
     }

+ 133 - 0
src/main/vue/src/pages/DataSourceInfo.vue

@@ -0,0 +1,133 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small" style="max-width: 500px;">
+            <el-form-item prop="databaseType" label="类型">
+                <el-select placeholder="数据库" size="small" v-model="formData.databaseType" class="filter-item">
+                    <el-option label="Mysql" value="Mysql">
+                    </el-option>
+                    <el-option label="SqlServer" value="SqlServer">
+                    </el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item prop="code" label="code">
+                <el-input v-model="formData.code"></el-input>
+            </el-form-item>
+            <el-form-item prop="databaseName" label="名称">
+                <el-input v-model="formData.databaseName"></el-input>
+            </el-form-item>
+            <el-form-item prop="url" label="链接">
+                <el-input v-model="formData.url"></el-input>
+            </el-form-item>
+            <el-form-item prop="username" label="用户名">
+                <el-input v-model="formData.username"></el-input>
+            </el-form-item>
+            <el-form-item prop="password" label="密码">
+                <el-input v-model="formData.password"></el-input>
+            </el-form-item>
+
+            <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+import formValidator from '../formValidator'
+
+export default {
+    created() {
+        if (this.$route.query.id) {
+            this.$http.get({
+                url: '/dataSourceInfo/getOne',
+                data: {
+                    id: this.$route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
+                    this.formData = res.data;
+                }
+            })
+        }
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {
+                databaseType: 'Mysql'
+            },
+            rules: {
+                code:
+                    [
+                        { required: true, message: '请输入 code', trigger: 'blur' },
+                    ],
+                databaseType:
+                    [
+                        { required: true, message: '请输入 数据库类型', trigger: 'blur' },
+                    ],
+                url:
+                    [
+                        { required: true, message: '请输入 链接', trigger: 'blur' },
+                    ],
+                username:
+                    [
+                        { required: true, message: '请输入 用户名', trigger: 'blur' },
+                    ],
+                password:
+                    [
+                        { required: true, message: '请输入 密码', trigger: 'blur' },
+                    ],
+                databaseName:
+                    [
+                        { required: true, message: '请输入 名称', trigger: 'blur' },
+                    ],
+            },
+        }
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
+        },
+        submit() {
+            var data = JSON.parse(JSON.stringify(this.formData));
+            this.$http.post({
+                url: this.formData.id ? '/dataSourceInfo/update' : '/dataSourceInfo/save',
+                data: data
+            }).then(res => {
+                if (res.success) {
+                    this.$message.success('成功');
+                    this.$router.go(-1);
+                } else {
+                    this.$message.warning('失败')
+                }
+            });
+        },
+        onDelete() {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/dataSourceInfo/del',
+                    data: { id: this.formData.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.$router.go(-1);
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 327 - 0
src/main/vue/src/pages/DataSourceInfos.vue

@@ -0,0 +1,327 @@
+<template>
+    <div>
+        <div class="filters-container">
+
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+            <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+                <el-option
+                        label="女"
+                        value="item1">
+                </el-option>
+                <el-option
+                        label="男"
+                        value="item2">
+                </el-option>
+            </el-select>-->
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="$router.push('/dataSourceInfo')" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                    筛选数据
+                    <i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+            </el-table-column>
+            <el-table-column type="index" min-width="50" align="center">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('databaseType')" prop="databaseType" label="类型" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('code')" prop="code" label="code" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('databaseName')" prop="databaseName" label="名称" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('url')" prop="url" label="链接" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('username')" prop="username" label="用户名" min-width="100">
+            </el-table-column>
+            <el-table-column v-if="isColumnShow('password')" prop="password" label="密码" min-width="100">
+            </el-table-column>
+
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex'
+
+export default {
+    created() {
+        this.getData();
+    },
+    data() {
+        return {
+            totalNumber: 0,
+            totalPage: 10,
+            currentPage: 1,
+            pageSize: 20,
+            tableData: [],
+            filter1: '',
+            filter2: '',
+            tableColumns: [
+                {
+                    label: 'code',
+                    value: 'code',
+                    show: true
+                },
+                {
+                    label: '数据库类型',
+                    value: 'databaseType',
+                    show: true
+                },
+                {
+                    label: '链接',
+                    value: 'url',
+                    show: true
+                },
+                {
+                    label: '用户名',
+                    value: 'username',
+                    show: true
+                },
+                {
+                    label: '密码',
+                    value: 'password',
+                    show: true
+                },
+                {
+                    label: '名称',
+                    value: 'databaseName',
+                    show: true
+                },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: 'code',
+                    value: 'code'
+                },
+                {
+                    label: '数据库类型',
+                    value: 'database_type'
+                },
+                {
+                    label: '链接',
+                    value: 'url'
+                },
+                {
+                    label: '用户名',
+                    value: 'username'
+                },
+                {
+                    label: '密码',
+                    value: 'password'
+                },
+                {
+                    label: '名称',
+                    value: 'database_name'
+                },
+            ],
+            advancedQuerySearchKey: '',
+        }
+    },
+    computed: {
+        ...mapState(['tableHeight']),
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        pageSizeChange(size) {
+            this.currentPage = 1;
+            this.pageSize = size;
+            this.getData();
+        },
+        currentPageChange(page) {
+            this.currentPage = page;
+            this.getData();
+        },
+        getData() {
+            this.$http.get({
+                url: '/dataSourceInfo/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+            }).then(res => {
+                if (res.success) {
+                    this.totalNumber = res.data.page.totalNumber;
+                    this.tableData = res.data.pp;
+                }
+            })
+        },
+        isColumnShow(column) {
+            var row = this.tableColumns.find(i => i.value === column);
+            return row ? row.show : false;
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/dataSourceInfo',
+                query: {
+                    id: row.id
+                }
+            })
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        addField() {
+            this.advancedQueryFields.push({
+                link: 'AND',
+                name: '',
+                searchMethod: '=',
+                value: '',
+            });
+        },
+        removeField(i) {
+            if (this.advancedQueryFields.length > 0) {
+                this.advancedQueryFields.splice(i, 1);
+            }
+        },
+        advancedQuery() {
+
+            this.advancedQuerySearchKey = '';
+
+            if (this.advancedQueryFields.length > 0) {
+
+                var templist = [];
+
+                this.advancedQueryFields.forEach(item => {
+                    if (item.link && item.name && item.searchMethod && item.value) {
+                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                        templist.push(tempItem);
+                    }
+                })
+
+                if (templist.length > 0) {
+
+                    this.advancedQuerySearchKey = templist.join('_;');
+                }
+            }
+
+            this.getData();
+            this.showAdvancedQueryDialog = false;
+        },
+        exportExcel() {
+            window.location.href = this.$baseUrl + "/dataSourceInfo/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+        },
+        searchData() {
+            this.currentPage = 1;
+            this.getData();
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/dataSourceInfo/del',
+                    data: { id: row.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
+
+    }
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 19 - 1
src/main/vue/src/pages/TestAaa.vue

@@ -19,6 +19,7 @@
             </el-form-item>
                                                                                                                                                                                                                                                                     <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
             </el-form-item>
         </el-form>
@@ -73,7 +74,24 @@
                         this.$message.warning('失败')
                     }
                 });
-            }
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testAaa/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
         }
     }
 </script>

+ 227 - 176
src/main/vue/src/pages/TestAaas.vue

@@ -1,9 +1,9 @@
 <template>
     <div>
         <div class="filters-container">
-
+          
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
-            <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+              <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
                 <el-option
                         label="女"
                         value="item1">
@@ -15,16 +15,16 @@
             </el-select>-->
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             </el-button>
-            <el-button @click="getData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
             </el-button>
-            <el-button @click="$router.push('/testAaa')" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
+            <el-button @click="$router.push('/testAaa')" type="primary" size="small" icon="el-icon-edit"
+                       class="filter-item">添加
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
-                    筛选数据
-                    <i class="el-icon-arrow-down el-icon--right"></i>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
                 </span>
                 <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
                     <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
@@ -32,24 +32,62 @@
                 </el-dropdown-menu>
             </el-dropdown>
         </div>
-        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
-            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
             </el-table-column>
-            <el-table-column type="index" min-width="50" align="center">
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('id')" prop="id" label="id" min-width="100">
+                                        <el-table-column
+                    v-if="isColumnShow('id')"
+                    prop="id"
+                    label="id"
+                    min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('delFlag')" prop="delFlag" label="删除标识" min-width="100">
+                                                        <el-table-column
+                    v-if="isColumnShow('delFlag')"
+                    prop="delFlag"
+                    label="删除标识"
+                    min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('testName')" prop="testName" label="名字" min-width="100">
+                                                        <el-table-column
+                    v-if="isColumnShow('testName')"
+                    prop="testName"
+                    label="名字"
+                    min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('remark')" prop="remark" label="备注" min-width="100">
+                                                        <el-table-column
+                    v-if="isColumnShow('remark')"
+                    prop="remark"
+                    label="备注"
+                    min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('imageUrl')" prop="imageUrl" label="image_url" min-width="100">
+                                                        <el-table-column
+                    v-if="isColumnShow('imageUrl')"
+                    prop="imageUrl"
+                    label="image_url"
+                    min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('testTime')" prop="testTime" label="test_time" min-width="100">
+                                                        <el-table-column
+                    v-if="isColumnShow('testTime')"
+                    prop="testTime"
+                    label="test_time"
+                    min-width="100">
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right">
+                                        <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right">
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
                 </template>
@@ -64,7 +102,15 @@
                     <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div>
-            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
             </el-pagination>
         </div>
         <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
@@ -117,104 +163,104 @@
     </div>
 </template>
 <script>
-import { mapState } from 'vuex'
+    import {mapState} from 'vuex'
 
-export default {
-    created() {
-        this.getData();
-    },
-    data() {
-        return {
-            totalNumber: 0,
-            totalPage: 10,
-            currentPage: 1,
-            pageSize: 20,
-            tableData: [],
-            filter1: '',
-            filter2: '',
-            tableColumns: [
-                {
-                    label: 'id',
-                    value: 'id',
-                    show: true
-                },
-                {
-                    label: '删除标识',
-                    value: 'delFlag',
-                    show: true
-                },
-                {
-                    label: '名字',
-                    value: 'testName',
-                    show: true
-                },
-                {
-                    label: '备注',
-                    value: 'remark',
-                    show: true
-                },
-                {
-                    label: 'image_url',
-                    value: 'imageUrl',
-                    show: true
-                },
-                {
-                    label: 'test_time',
-                    value: 'testTime',
-                    show: true
-                },
-            ],
-            multipleMode: false,
-            showAdvancedQueryDialog: false,
-            advancedQueryFields: [],
-            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-            advancedQueryColumns: [
-                {
-                    label: 'id',
-                    value: 'id'
-                },
-                {
-                    label: '删除标识',
-                    value: 'del_flag'
-                },
-                {
-                    label: '名字',
-                    value: 'test_name'
-                },
-                {
-                    label: '备注',
-                    value: 'remark'
-                },
-                {
-                    label: 'image_url',
-                    value: 'image_url'
-                },
-                {
-                    label: 'test_time',
-                    value: 'test_time'
-                },
-            ],
-            advancedQuerySearchKey: '',
-        }
-    },
-    computed: {
-        ...mapState(['tableHeight']),
-        selection() {
-            return this.$refs.table.selection.map(i => i.id);
-        }
-    },
-    methods: {
-        pageSizeChange(size) {
-            this.currentPage = 1;
-            this.pageSize = size;
+    export default {
+        created() {
             this.getData();
         },
-        currentPageChange(page) {
-            this.currentPage = page;
-            this.getData();
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                        {
+                        label: 'id',
+                        value: 'id',
+                        show: true
+                    },
+                                                    {
+                        label: '删除标识',
+                        value: 'delFlag',
+                        show: true
+                    },
+                                                    {
+                        label: '名字',
+                        value: 'testName',
+                        show: true
+                    },
+                                                    {
+                        label: '备注',
+                        value: 'remark',
+                        show: true
+                    },
+                                                    {
+                        label: 'image_url',
+                        value: 'imageUrl',
+                        show: true
+                    },
+                                                    {
+                        label: 'test_time',
+                        value: 'testTime',
+                        show: true
+                    },
+                                    ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                        {
+                                label: 'id',
+                                value: 'id'
+                            },
+                                                                                                {
+                                label: '删除标识',
+                                value: 'del_flag'
+                            },
+                                                                                                {
+                                label: '名字',
+                                value: 'test_name'
+                            },
+                                                                                                {
+                                label: '备注',
+                                value: 'remark'
+                            },
+                                                                                                {
+                                label: 'image_url',
+                                value: 'image_url'
+                            },
+                                                                                                {
+                                label: 'test_time',
+                                value: 'test_time'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
         },
-        getData() {
-            this.$http.get({
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
                 url: '/testAaa/page',
                 data: {
                     currentPage: this.currentPage,
@@ -222,83 +268,88 @@ export default {
                     searchKey: this.filter1,
                     advancedQuery: this.advancedQuerySearchKey,
                 }
-            }).then(res => {
-                if (res.success) {
-                    this.totalNumber = res.data.page.totalNumber;
-                    this.tableData = res.data.pp;
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
                 }
-            })
-        },
-        isColumnShow(column) {
-            var row = this.tableColumns.find(i => i.value === column);
-            return row ? row.show : false;
-        },
-        toggleMultipleMode(multipleMode) {
-            this.multipleMode = multipleMode;
-            if (!multipleMode) {
-                this.$refs.table.clearSelection();
-            }
-        },
-        editRow(row) {
-            this.$router.push({
-                path: '/testAaa',
-                query: {
-                    id: row.id
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testAaa',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
                 }
-            })
-        },
-        operation1() {
-            this.$notify({
-                title: '提示',
-                message: this.selection
-            });
-        },
-        operation2() {
-            this.$message('操作2');
-        },
-        addField() {
-            this.advancedQueryFields.push({
-                link: 'AND',
-                name: '',
-                searchMethod: '=',
-                value: '',
-            });
-        },
-        removeField(i) {
-            if (this.advancedQueryFields.length > 0) {
-                this.advancedQueryFields.splice(i, 1);
-            }
-        },
-        advancedQuery() {
+            },
+            advancedQuery() {
 
-            this.advancedQuerySearchKey = '';
+                this.advancedQuerySearchKey = '';
 
-            if (this.advancedQueryFields.length > 0) {
+                if (this.advancedQueryFields.length > 0) {
 
-                var templist = [];
+                    var templist = [];
 
-                this.advancedQueryFields.forEach(item => {
-                    if (item.link && item.name && item.searchMethod && item.value) {
-                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
-                        templist.push(tempItem);
-                    }
-                })
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
 
-                if (templist.length > 0) {
+                    if (templist.length > 0) {
 
-                    this.advancedQuerySearchKey = templist.join('_;');
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
                 }
-            }
 
-            this.getData();
-            this.showAdvancedQueryDialog = false;
-        },
-        exportExcel() {
-            window.location.href = this.$baseUrl + "/testAaa/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
-        },
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testAaa/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            }
 
+        }
     }
-}
 </script>
 <style lang="less" scoped>
+
 </style>

+ 98 - 0
src/main/vue/src/pages/TestBbb.vue

@@ -0,0 +1,98 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                                                    <el-form-item prop="nameAaa" label="名称1">
+                <el-input v-model="formData.nameAaa"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="nameBbb" label="名称2">
+                <el-input v-model="formData.nameBbb"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                    <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/testBbb/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+                        this.formData = res.data;
+                    }
+                })
+            }
+        },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                        nameAaa:
+                    [
+                        {required: true, message: '请输入 名称1', trigger: 'blur'},
+                                            ],
+                                                                nameBbb:
+                    [
+                        {required: true, message: '请输入 名称2', trigger: 'blur'},
+                                            ],
+                                    },
+        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/testBbb/update' : '/testBbb/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testBbb/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 93 - 0
src/main/vue/src/pages/TestBbbCopy.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                        <el-form-item prop="delFlag" label="删除标识">
+                <el-input v-model="formData.delFlag"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="nameAaa" label="名称1">
+                <el-input v-model="formData.nameAaa"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="nameBbb" label="名称2">
+                <el-input v-model="formData.nameBbb"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                    <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/testBbbCopy/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+                        this.formData = res.data;
+                    }
+                })
+            }
+        },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                    },
+        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/testBbbCopy/update' : '/testBbbCopy/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testBbbCopy/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 325 - 0
src/main/vue/src/pages/TestBbbCopys.vue

@@ -0,0 +1,325 @@
+<template>
+    <div>
+        <div class="filters-container">
+          
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+              <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+                <el-option
+                        label="女"
+                        value="item1">
+                </el-option>
+                <el-option
+                        label="男"
+                        value="item2">
+                </el-option>
+            </el-select>-->
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="$router.push('/testBbbCopy')" type="primary" size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                                        <el-table-column
+                    v-if="isColumnShow('id')"
+                    prop="id"
+                    label="id"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('delFlag')"
+                    prop="delFlag"
+                    label="删除标识"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('nameAaa')"
+                    prop="nameAaa"
+                    label="名称1"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('nameBbb')"
+                    prop="nameBbb"
+                    label="名称2"
+                    min-width="100">
+            </el-table-column>
+                                        <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right">
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                        {
+                        label: 'id',
+                        value: 'id',
+                        show: true
+                    },
+                                                    {
+                        label: '删除标识',
+                        value: 'delFlag',
+                        show: true
+                    },
+                                                    {
+                        label: '名称1',
+                        value: 'nameAaa',
+                        show: true
+                    },
+                                                    {
+                        label: '名称2',
+                        value: 'nameBbb',
+                        show: true
+                    },
+                                    ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                        {
+                                label: 'id',
+                                value: 'id'
+                            },
+                                                                                                {
+                                label: '删除标识',
+                                value: 'del_flag'
+                            },
+                                                                                                {
+                                label: '名称1',
+                                value: 'name_aaa'
+                            },
+                                                                                                {
+                                label: '名称2',
+                                value: 'name_bbb'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
+                url: '/testBbbCopy/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testBbbCopy',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testBbbCopy/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            }
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 295 - 0
src/main/vue/src/pages/TestBbbs.vue

@@ -0,0 +1,295 @@
+<template>
+    <div>
+        <div class="filters-container">
+          
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+              <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+                <el-option
+                        label="女"
+                        value="item1">
+                </el-option>
+                <el-option
+                        label="男"
+                        value="item2">
+                </el-option>
+            </el-select>-->
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="$router.push('/testBbb')" type="primary" size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                                                                                                <el-table-column
+                    v-if="isColumnShow('nameAaa')"
+                    prop="nameAaa"
+                    label="名称1"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('nameBbb')"
+                    prop="nameBbb"
+                    label="名称2"
+                    min-width="100">
+            </el-table-column>
+                                        <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right">
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                                {
+                        label: '名称1',
+                        value: 'nameAaa',
+                        show: true
+                    },
+                                                    {
+                        label: '名称2',
+                        value: 'nameBbb',
+                        show: true
+                    },
+                                    ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                                                                {
+                                label: '名称1',
+                                value: 'name_aaa'
+                            },
+                                                                                                {
+                                label: '名称2',
+                                value: 'name_bbb'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
+                url: '/testBbb/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testBbb',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testBbb/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            }
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 30 - 0
src/main/vue/src/router/index.js

@@ -170,6 +170,36 @@ const router = new Router({
                     name: 'queryConfig',
                     component: () => import('../pages/QueryConfig')
                 },
+                {
+                    path: '/testBbbs',
+                    name: 'testBbbs',
+                    component: () => import('../pages/TestBbbs')
+                },
+                {
+                    path: '/testBbb',
+                    name: 'testBbb',
+                    component: () => import('../pages/TestBbb')
+                },
+                {
+                    path: '/testBbbCopys',
+                    name: 'testBbbCopys',
+                    component: () => import('../pages/TestBbbCopys')
+                },
+                {
+                    path: '/testBbbCopy',
+                    name: 'testBbbCopy',
+                    component: () => import('../pages/TestBbbCopy')
+                },
+                {
+                    path: '/dataSourceInfos',
+                    name: 'dataSourceInfos',
+                    component: () => import('../pages/DataSourceInfos')
+                },
+                {
+                    path: '/dataSourceInfo',
+                    name: 'dataSourceInfo',
+                    component: () => import('../pages/DataSourceInfo')
+                },
             ]
         },
         {

+ 3 - 0
src/main/webapp/WEB-INF/web.xml

@@ -42,6 +42,9 @@
     <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
+    <listener>
+        <listener-class>com.izouma.awesomeadmin.container.StartupListener</listener-class>
+    </listener>
     <filter>
         <filter-name>CharacterEncodingFilter</filter-name>
         <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>