Ver Fonte

动态数据库链接

suochencheng há 7 anos atrás
pai
commit
c7b0fb69f0

+ 248 - 222
src/main/java/com/izouma/awesomeadmin/dao/GenCodeMapper.xml

@@ -1,232 +1,258 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?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" >
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.izouma.awesomeadmin.dao.GenCodeMapper" >
-	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenCode" >
-		<id column="id" property="id" jdbcType="INTEGER" />
-		<result column="tableName" property="tableName" jdbcType="VARCHAR" />
-		<result column="className" property="className" jdbcType="VARCHAR" />
-		<result column="remark" property="remark" jdbcType="VARCHAR" />
-		<result column="genTable" property="genTable" jdbcType="BIT" />
-		<result column="genClass" property="genClass" jdbcType="BIT" />
-		<result column="genList" property="genList" jdbcType="BIT" />
-		<result column="genForm" property="genForm" jdbcType="BIT" />
-		<result column="field_id" property="fieldId" jdbcType="VARCHAR" />
-		<collection property="fields" column="field_id" ofType="com.izouma.awesomeadmin.model.TableField" select="selectTableField"/>
-	</resultMap>
-	<select id="selectTableField" parameterType="string" resultType="com.izouma.awesomeadmin.model.TableField">
+<mapper namespace="com.izouma.awesomeadmin.dao.GenCodeMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenCode">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="tableName" property="tableName" jdbcType="VARCHAR"/>
+        <result column="className" property="className" jdbcType="VARCHAR"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="genTable" property="genTable" jdbcType="BIT"/>
+        <result column="genClass" property="genClass" jdbcType="BIT"/>
+        <result column="genList" property="genList" jdbcType="BIT"/>
+        <result column="genForm" property="genForm" jdbcType="BIT"/>
+        <result column="field_id" property="fieldId" jdbcType="VARCHAR"/>
+        <result column="gen_json" property="genJson" jdbcType="VARCHAR"/>
+        <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
+        <collection property="fields" column="field_id" ofType="com.izouma.awesomeadmin.model.TableField"
+                    select="selectTableField"/>
+    </resultMap>
+    <select id="selectTableField" parameterType="string" resultType="com.izouma.awesomeadmin.model.TableField">
         select * from table_field where FIND_IN_SET(id, #{field_id})
         select * from table_field where FIND_IN_SET(id, #{field_id})
     </select>
     </select>
-	<sql id="Base_Column_List" >
-		 id, tableName, className, remark, genTable, genClass, genList, genForm, field_id
+    <sql id="Base_Column_List">
+		 id, tableName, className, remark, genTable, genClass, genList, genForm, field_id, gen_json, del_flag
 	</sql>
 	</sql>
-	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-		select
-		<include refid="Base_Column_List" />
-		from gen_code
-		where id = #{id,jdbcType=INTEGER}
-	</select>
-	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from gen_code
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
 		delete from gen_code
 		delete from gen_code
 		where id = #{id,jdbcType=INTEGER}
 		where id = #{id,jdbcType=INTEGER}
 	</delete>
 	</delete>
-	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenCode" useGeneratedKeys="true" keyProperty="id">
-		insert into gen_code
-		<trim prefix="(" suffix=")" suffixOverrides="," >
-			<if test="id != null" >
-				id,	
-			</if>
-			<if test="tableName != null" >
-				tableName,	
-			</if>
-			<if test="className != null" >
-				className,	
-			</if>
-			<if test="remark != null" >
-				remark,	
-			</if>
-			<if test="genTable != null" >
-				genTable,	
-			</if>
-			<if test="genClass != null" >
-				genClass,	
-			</if>
-			<if test="genList != null" >
-				genList,	
-			</if>
-			<if test="genForm != null" >
-				genForm,	
-			</if>
-			<if test="fieldId != null" >
-				field_id,	
-			</if>
-		</trim>
-		<trim prefix="values (" suffix=")" suffixOverrides="," >
-			<if test="id != null" >
-				#{id,jdbcType=INTEGER},	
-			</if>
-			<if test="tableName != null" >
-				#{tableName,jdbcType=VARCHAR},	
-			</if>
-			<if test="className != null" >
-				#{className,jdbcType=VARCHAR},	
-			</if>
-			<if test="remark != null" >
-				#{remark,jdbcType=VARCHAR},	
-			</if>
-			<if test="genTable != null" >
-				#{genTable,jdbcType=BIT},	
-			</if>
-			<if test="genClass != null" >
-				#{genClass,jdbcType=BIT},	
-			</if>
-			<if test="genList != null" >
-				#{genList,jdbcType=BIT},	
-			</if>
-			<if test="genForm != null" >
-				#{genForm,jdbcType=BIT},	
-			</if>
-			<if test="fieldId != null" >
-				#{fieldId,jdbcType=VARCHAR},	
-			</if>
-		</trim>
-	</insert>
-	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenCode" >
-		update gen_code
-		<set >
-			<if test="tableName != null" >
-				tableName = #{tableName,jdbcType=VARCHAR},	
-			</if>
-			<if test="className != null" >
-				className = #{className,jdbcType=VARCHAR},	
-			</if>
-			<if test="remark != null" >
-				remark = #{remark,jdbcType=VARCHAR},	
-			</if>
-			<if test="genTable != null" >
-				genTable = #{genTable,jdbcType=BIT},	
-			</if>
-			<if test="genClass != null" >
-				genClass = #{genClass,jdbcType=BIT},	
-			</if>
-			<if test="genList != null" >
-				genList = #{genList,jdbcType=BIT},	
-			</if>
-			<if test="genForm != null" >
-				genForm = #{genForm,jdbcType=BIT},	
-			</if>
-			<if test="fieldId != null" >
-				field_id = #{fieldId,jdbcType=VARCHAR},	
-			</if>
-		</set>
-		where id = #{id,jdbcType=INTEGER}
-	</update>
-	<select id="queryGenCodeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
-		select <include refid="Base_Column_List"/> from gen_code
-		<where>
-			and del_flag = 'N'
-			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
-				and id = #{record.id}	
-			</if>
-			<if test="record.tableName != null and !&quot;&quot;.equals(record.tableName)">
-				and tableName = #{record.tableName}	
-			</if>
-			<if test="record.className != null and !&quot;&quot;.equals(record.className)">
-				and className = #{record.className}	
-			</if>
-			<if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
-				and remark = #{record.remark}	
-			</if>
-			<if test="record.genTable != null and !&quot;&quot;.equals(record.genTable)">
-				and genTable = #{record.genTable}	
-			</if>
-			<if test="record.genClass != null and !&quot;&quot;.equals(record.genClass)">
-				and genClass = #{record.genClass}	
-			</if>
-			<if test="record.genList != null and !&quot;&quot;.equals(record.genList)">
-				and genList = #{record.genList}	
-			</if>
-			<if test="record.genForm != null and !&quot;&quot;.equals(record.genForm)">
-				and genForm = #{record.genForm}	
-			</if>
-			<if test="record.fieldId != null and !&quot;&quot;.equals(record.fieldId)">
-				and field_id = #{record.fieldId}	
-			</if>
-		</where>
-		order by id desc
-	</select>
-	<select id="queryAllGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
-		select <include refid="Base_Column_List"/> from gen_code
-		<where>
-			and del_flag = 'N'
-			<if test="id != null and !&quot;&quot;.equals(id)">
-				and id = #{id}	
-			</if>
-			<if test="tableName != null and !&quot;&quot;.equals(tableName)">
-				and tableName = #{tableName}	
-			</if>
-			<if test="className != null and !&quot;&quot;.equals(className)">
-				and className = #{className}	
-			</if>
-			<if test="remark != null and !&quot;&quot;.equals(remark)">
-				and remark = #{remark}	
-			</if>
-			<if test="genTable != null and !&quot;&quot;.equals(genTable)">
-				and genTable = #{genTable}	
-			</if>
-			<if test="genClass != null and !&quot;&quot;.equals(genClass)">
-				and genClass = #{genClass}	
-			</if>
-			<if test="genList != null and !&quot;&quot;.equals(genList)">
-				and genList = #{genList}	
-			</if>
-			<if test="genForm != null and !&quot;&quot;.equals(genForm)">
-				and genForm = #{genForm}	
-			</if>
-			<if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
-				and field_id = #{fieldId}	
-			</if>
-		</where>
-		order by id desc
-	</select>
-	<select id="queryGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
-		select <include refid="Base_Column_List"/> from gen_code
-		<where>
-			and del_flag = 'N'
-			<if test="id != null and !&quot;&quot;.equals(id)">
-				and id = #{id}	
-			</if>
-			<if test="tableName != null and !&quot;&quot;.equals(tableName)">
-				and tableName = #{tableName}	
-			</if>
-			<if test="className != null and !&quot;&quot;.equals(className)">
-				and className = #{className}	
-			</if>
-			<if test="remark != null and !&quot;&quot;.equals(remark)">
-				and remark = #{remark}	
-			</if>
-			<if test="genTable != null and !&quot;&quot;.equals(genTable)">
-				and genTable = #{genTable}	
-			</if>
-			<if test="genClass != null and !&quot;&quot;.equals(genClass)">
-				and genClass = #{genClass}	
-			</if>
-			<if test="genList != null and !&quot;&quot;.equals(genList)">
-				and genList = #{genList}	
-			</if>
-			<if test="genForm != null and !&quot;&quot;.equals(genForm)">
-				and genForm = #{genForm}	
-			</if>
-			<if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
-				and field_id = #{fieldId}	
-			</if>
-		</where>
-		LIMIT 1
-	</select>
-	<update id="delete">
-		UPDATE gen_code SET del_flag = 'Y'
-		<where>
-			AND id = #{id}
-		</where>
-	</update>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenCode" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into gen_code
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="tableName != null">
+                tableName,
+            </if>
+            <if test="className != null">
+                className,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="genTable != null">
+                genTable,
+            </if>
+            <if test="genClass != null">
+                genClass,
+            </if>
+            <if test="genList != null">
+                genList,
+            </if>
+            <if test="genForm != null">
+                genForm,
+            </if>
+            <if test="fieldId != null">
+                field_id,
+            </if>
+            <if test="genJson != null">
+                gen_json,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="tableName != null">
+                #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="className != null">
+                #{className,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="genTable != null">
+                #{genTable,jdbcType=BIT},
+            </if>
+            <if test="genClass != null">
+                #{genClass,jdbcType=BIT},
+            </if>
+            <if test="genList != null">
+                #{genList,jdbcType=BIT},
+            </if>
+            <if test="genForm != null">
+                #{genForm,jdbcType=BIT},
+            </if>
+            <if test="fieldId != null">
+                #{fieldId,jdbcType=VARCHAR},
+            </if>
+            <if test="genJson != null">
+                #{genJson,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenCode">
+        update gen_code
+        <set>
+            <if test="tableName != null">
+                tableName = #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="className != null">
+                className = #{className,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="genTable != null">
+                genTable = #{genTable,jdbcType=BIT},
+            </if>
+            <if test="genClass != null">
+                genClass = #{genClass,jdbcType=BIT},
+            </if>
+            <if test="genList != null">
+                genList = #{genList,jdbcType=BIT},
+            </if>
+            <if test="genForm != null">
+                genForm = #{genForm,jdbcType=BIT},
+            </if>
+            <if test="fieldId != null">
+                field_id = #{fieldId,jdbcType=VARCHAR},
+            </if>
+            <if test="genJson != null">
+                gen_json = #{genJson,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryGenCodeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.tableName != null and !&quot;&quot;.equals(record.tableName)">
+                and tableName = #{record.tableName}
+            </if>
+            <if test="record.className != null and !&quot;&quot;.equals(record.className)">
+                and className = #{record.className}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.genTable != null and !&quot;&quot;.equals(record.genTable)">
+                and genTable = #{record.genTable}
+            </if>
+            <if test="record.genClass != null and !&quot;&quot;.equals(record.genClass)">
+                and genClass = #{record.genClass}
+            </if>
+            <if test="record.genList != null and !&quot;&quot;.equals(record.genList)">
+                and genList = #{record.genList}
+            </if>
+            <if test="record.genForm != null and !&quot;&quot;.equals(record.genForm)">
+                and genForm = #{record.genForm}
+            </if>
+            <if test="record.fieldId != null and !&quot;&quot;.equals(record.fieldId)">
+                and field_id = #{record.fieldId}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR tableName LIKE concat('%',#{record.searchKey},'%')
+                    OR className LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and tableName = #{tableName}
+            </if>
+            <if test="className != null and !&quot;&quot;.equals(className)">
+                and className = #{className}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="genTable != null and !&quot;&quot;.equals(genTable)">
+                and genTable = #{genTable}
+            </if>
+            <if test="genClass != null and !&quot;&quot;.equals(genClass)">
+                and genClass = #{genClass}
+            </if>
+            <if test="genList != null and !&quot;&quot;.equals(genList)">
+                and genList = #{genList}
+            </if>
+            <if test="genForm != null and !&quot;&quot;.equals(genForm)">
+                and genForm = #{genForm}
+            </if>
+            <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
+                and field_id = #{fieldId}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and tableName = #{tableName}
+            </if>
+            <if test="className != null and !&quot;&quot;.equals(className)">
+                and className = #{className}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="genTable != null and !&quot;&quot;.equals(genTable)">
+                and genTable = #{genTable}
+            </if>
+            <if test="genClass != null and !&quot;&quot;.equals(genClass)">
+                and genClass = #{genClass}
+            </if>
+            <if test="genList != null and !&quot;&quot;.equals(genList)">
+                and genList = #{genList}
+            </if>
+            <if test="genForm != null and !&quot;&quot;.equals(genForm)">
+                and genForm = #{genForm}
+            </if>
+            <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
+                and field_id = #{fieldId}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE gen_code SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
 </mapper>
 </mapper>
 
 

+ 47 - 1
src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.xml

@@ -6,6 +6,8 @@
                                         <result column="del_flag" property="delFlag" jdbcType="CHAR" />
                                         <result column="del_flag" property="delFlag" jdbcType="CHAR" />
                                 <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
                                 <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
                                 <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
                                 <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
+                                <result column="name_ccc" property="nameCcc" jdbcType="VARCHAR" />
+                                <result column="name_ddd" property="nameDdd" jdbcType="VARCHAR" />
             </resultMap>
             </resultMap>
     <sql id="Base_Column_List" >
     <sql id="Base_Column_List" >
         <trim  suffixOverrides="," >
         <trim  suffixOverrides="," >
@@ -17,6 +19,10 @@
 
 
             name_bbb,
             name_bbb,
 
 
+            name_ccc,
+
+            name_ddd,
+
             </trim>
             </trim>
     </sql>
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -43,6 +49,12 @@
             </if>
             </if>
                 <if test="nameBbb!= null" >
                 <if test="nameBbb!= null" >
                 name_bbb,
                 name_bbb,
+            </if>
+                <if test="nameCcc!= null" >
+                name_ccc,
+            </if>
+                <if test="nameDdd!= null" >
+                name_ddd,
             </if>
             </if>
             </trim>
             </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -57,6 +69,12 @@
             </if>
             </if>
                     <if test="nameBbb != null" >
                     <if test="nameBbb != null" >
                 #{nameBbb,jdbcType=VARCHAR},
                 #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameCcc != null" >
+                #{nameCcc,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameDdd != null" >
+                #{nameDdd,jdbcType=VARCHAR},
             </if>
             </if>
                 </trim>
                 </trim>
     </insert>
     </insert>
@@ -74,6 +92,12 @@
             </if>
             </if>
                      <if test="nameBbb != null" >
                      <if test="nameBbb != null" >
                name_bbb= #{nameBbb,jdbcType=VARCHAR},
                name_bbb= #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameCcc != null" >
+               name_ccc= #{nameCcc,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameDdd != null" >
+               name_ddd= #{nameDdd,jdbcType=VARCHAR},
             </if>
             </if>
                  </set>
                  </set>
         where id = #{id,jdbcType=INTEGER}
         where id = #{id,jdbcType=INTEGER}
@@ -93,11 +117,19 @@
             </if>
             </if>
                      <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
                      <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
                 and  name_bbb = #{record.nameBbb}
                 and  name_bbb = #{record.nameBbb}
+            </if>
+                     <if test="record.nameCcc != null and !&quot;&quot;.equals(record.nameCcc)">
+                and  name_ccc = #{record.nameCcc}
+            </if>
+                     <if test="record.nameDdd != null and !&quot;&quot;.equals(record.nameDdd)">
+                and  name_ddd = #{record.nameDdd}
             </if>
             </if>
                   <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
                   <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
              <trim prefix="and (" suffix=")" prefixOverrides="OR" >
              <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                                                                                                                                                                 OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
                                                                                                                                                                 OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
                                                                                                     OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
                                                                                                     OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_ccc LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_ddd LIKE concat('%',#{record.searchKey},'%')
                                                              </trim>
                                                              </trim>
          </if>
          </if>
 
 
@@ -154,11 +186,19 @@
             </if>
             </if>
                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
                 and  name_bbb = #{nameBbb}
                 and  name_bbb = #{nameBbb}
+            </if>
+                    <if test="nameCcc != null and !&quot;&quot;.equals(nameCcc)">
+                and  name_ccc = #{nameCcc}
+            </if>
+                    <if test="nameDdd != null and !&quot;&quot;.equals(nameDdd)">
+                and  name_ddd = #{nameDdd}
             </if>
             </if>
                     <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                     <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                                                                                                                                                                                                                                                 OR  name_aaa LIKE concat('%',#{searchKey},'%')
                                                                                                                                                                                                                                                 OR  name_aaa LIKE concat('%',#{searchKey},'%')
                                                                                                                                                         OR  name_bbb LIKE concat('%',#{searchKey},'%')
                                                                                                                                                         OR  name_bbb LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_ccc LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_ddd LIKE concat('%',#{searchKey},'%')
                                                                                         </trim>
                                                                                         </trim>
             </if>
             </if>
 <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
 <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
@@ -213,6 +253,12 @@
             </if>
             </if>
                      <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
                      <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
                 and name_bbb = #{nameBbb}
                 and name_bbb = #{nameBbb}
+            </if>
+                     <if test="nameCcc != null and !&quot;&quot;.equals(nameCcc)">
+                and name_ccc = #{nameCcc}
+            </if>
+                     <if test="nameDdd != null and !&quot;&quot;.equals(nameDdd)">
+                and name_ddd = #{nameDdd}
             </if>
             </if>
          
          
         </where>
         </where>
@@ -228,7 +274,7 @@
         select <include refid="Base_Column_List"/> from test_bbb
         select <include refid="Base_Column_List"/> from test_bbb
         <where>
         <where>
             and del_flag = 'N'
             and del_flag = 'N'
-                                                                                                                                    </where>
+                                                                                                                                                                                            </where>
         order by id desc
         order by id desc
     </select>
     </select>
 </mapper>
 </mapper>

+ 46 - 0
src/main/java/com/izouma/awesomeadmin/model/GenCode.java

@@ -79,6 +79,20 @@ public class GenCode {
 
 
     private Boolean readTable;
     private Boolean readTable;
 
 
+    /**
+     * 数据库CODE,使用什么数据源S
+     */
+    private String dataSourceCode;
+
+    /**
+     * 生成代码的JSON Str
+     */
+    private String genJson;
+
+    private String searchKey;
+
+    private String delFlag;
+
     public List<TableField> getFields() {
     public List<TableField> getFields() {
         return fields;
         return fields;
     }
     }
@@ -198,5 +212,37 @@ public class GenCode {
     public void setReadTable(Boolean readTable) {
     public void setReadTable(Boolean readTable) {
         this.readTable = readTable;
         this.readTable = readTable;
     }
     }
+
+    public String getDataSourceCode() {
+        return dataSourceCode;
+    }
+
+    public void setDataSourceCode(String dataSourceCode) {
+        this.dataSourceCode = dataSourceCode;
+    }
+
+    public String getGenJson() {
+        return genJson;
+    }
+
+    public void setGenJson(String genJson) {
+        this.genJson = genJson;
+    }
+
+    public String getSearchKey() {
+        return searchKey;
+    }
+
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
 }
 }
 
 

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

@@ -12,6 +12,8 @@ public class TestBbb{
     private String delFlag;
     private String delFlag;
     private String nameAaa;
     private String nameAaa;
     private String nameBbb;
     private String nameBbb;
+    private String nameCcc;
+    private String nameDdd;
 
 
 private String searchKey;
 private String searchKey;
 
 
@@ -48,6 +50,20 @@ private String advancedQuery;
     public void setNameBbb(String nameBbb){
     public void setNameBbb(String nameBbb){
         this.nameBbb = nameBbb;
         this.nameBbb = nameBbb;
     }
     }
+    public String getNameCcc(){
+        return this.nameCcc;
+    }
+
+    public void setNameCcc(String nameCcc){
+        this.nameCcc = nameCcc;
+    }
+    public String getNameDdd(){
+        return this.nameDdd;
+    }
+
+    public void setNameDdd(String nameDdd){
+        this.nameDdd = nameDdd;
+    }
 
 
 public String getSearchKey() {
 public String getSearchKey() {
     return searchKey;
     return searchKey;

+ 51 - 37
src/main/java/com/izouma/awesomeadmin/web/GenCodeController.java

@@ -85,40 +85,9 @@ public class GenCodeController extends BaseController {
     public Result save(@RequestBody GenCode record) {
     public Result save(@RequestBody GenCode record) {
         try {
         try {
 
 
-            String tableName = record.getTableName();
+            genCode(record);
 
 
-            if (PinYinUtil.isContainChinese(tableName)) {
-                tableName = PinYinUtil.getStringPinYin(tableName);
-            }
-
-            record.setClassName(CaseUtils.toCamelCase(tableName, true, '_'));
-
-            if (record.getReadTable()) {
-                ReadTableGenerator.ReadTable(record);
-            }
-
-
-            GeneratorTool.getImports(record);
-
-            ControllerGenerator.GenController(record);
-            if (record.getGenTable() && !record.getReadTable()) {
-                TableGenerator.GenTable(record);
-            }
-
-            if (record.getGenClass()) {
-                ModelGenerator.GenModel(record);
-                ControllerGenerator.GenController(record);
-                ServiceGenerator.GenService(record);
-                ServiceImplGenerator.GemServicelImpl(record);
-                MapperGenerator.GenMapper(record);
-                MapperXmlGenerator.GenXml(record);
-            }
-            if (record.getGenList()) {
-                ListViewGenerator.GenListView(record);
-            }
-            if (record.getGenForm()) {
-                EditViewGenerator.GenEditView(record);
-            }
+            genCodeService.createGenCode(record);
             return new Result(true, record.getId());
             return new Result(true, record.getId());
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
@@ -126,20 +95,65 @@ public class GenCodeController extends BaseController {
         return new Result(false, "保存异常");
         return new Result(false, "保存异常");
     }
     }
 
 
+
     /**
     /**
      * <p>更新信息。</p>
      * <p>更新信息。</p>
      */
      */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @ResponseBody
     @ResponseBody
-    public Result updateGenCode(GenCode record) {
+    public Result updateGenCode(@RequestBody GenCode record) {
+        try {
 
 
-        boolean num = genCodeService.updateGenCode(record);
-        if (num) {
-            return new Result(true, "保存成功");
+            genCode(record);
+
+            boolean num = genCodeService.updateGenCode(record);
+            if (num) {
+                return new Result(true, "保存成功");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
         }
+
         return new Result(false, "保存异常");
         return new Result(false, "保存异常");
     }
     }
 
 
+    private void genCode(@RequestBody GenCode record) throws Exception {
+        String tableName = record.getTableName();
+
+        if (PinYinUtil.isContainChinese(tableName)) {
+            tableName = PinYinUtil.getStringPinYin(tableName);
+        }
+
+        record.setClassName(CaseUtils.toCamelCase(tableName, true, '_'));
+
+        if (record.getReadTable()) {
+            ReadTableGenerator.ReadTable(record);
+        }
+
+
+        GeneratorTool.getImports(record);
+
+        ControllerGenerator.GenController(record);
+        if (record.getGenTable() && !record.getReadTable()) {
+            TableGenerator.GenTable(record);
+        }
+
+        if (record.getGenClass()) {
+            ModelGenerator.GenModel(record);
+            ControllerGenerator.GenController(record);
+            ServiceGenerator.GenService(record);
+            ServiceImplGenerator.GemServicelImpl(record);
+            MapperGenerator.GenMapper(record);
+            MapperXmlGenerator.GenXml(record);
+        }
+        if (record.getGenList()) {
+            ListViewGenerator.GenListView(record);
+        }
+        if (record.getGenForm()) {
+            EditViewGenerator.GenEditView(record);
+        }
+    }
+
     /**
     /**
      * <p>删除。</p>
      * <p>删除。</p>
      */
      */

+ 8 - 6
src/main/java/com/izouma/awesomeadmin/web/TestBbbController.java

@@ -130,12 +130,12 @@ public class TestBbbController extends BaseController{
 
 
 
 
         String sheetName = "test_bbb";
         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];
+        String titleName = "测试表BBB数据表";
+        String fileName = "测试表BBB表";
+        int columnNumber = 6;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "名称1" ,   "名称2" ,   "名称3" ,   "名称4"  };
+        String[][] dataList = new String[testBbbs.size()][6];
 
 
         for (int i = 0; i < testBbbs.size(); i++) {
         for (int i = 0; i < testBbbs.size(); i++) {
 
 
@@ -143,6 +143,8 @@ public class TestBbbController extends BaseController{
                         dataList[i][1] = String.valueOf(testBbbs.get(i).getDelFlag());
                         dataList[i][1] = String.valueOf(testBbbs.get(i).getDelFlag());
                         dataList[i][2] = String.valueOf(testBbbs.get(i).getNameAaa());
                         dataList[i][2] = String.valueOf(testBbbs.get(i).getNameAaa());
                         dataList[i][3] = String.valueOf(testBbbs.get(i).getNameBbb());
                         dataList[i][3] = String.valueOf(testBbbs.get(i).getNameBbb());
+                        dataList[i][4] = String.valueOf(testBbbs.get(i).getNameCcc());
+                        dataList[i][5] = String.valueOf(testBbbs.get(i).getNameDdd());
                     }
                     }
 
 
 
 

+ 3 - 3
src/main/java/com/izouma/codegenerator/MapperGenerator.java

@@ -34,9 +34,9 @@ public class MapperGenerator {
 
 
             String templateName = "MapperTemplate.vm";
             String templateName = "MapperTemplate.vm";
 
 
-            if ("SqlServer".equals(model.getDataBaseType())) {
-                templateName = "MapperSqlServerTemplate.vm";
-            }
+//            if ("SqlServer".equals(model.getDataBaseType())) {
+//                templateName = "MapperSqlServerTemplate.vm";
+//            }
 
 
             Template t = Velocity.getTemplate(templateName);
             Template t = Velocity.getTemplate(templateName);
 
 

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

@@ -17,10 +17,11 @@
                         value="item2">
                         value="item2">
                 </el-option>
                 </el-option>
             </el-select>-->
             </el-select>-->
+              <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+              </el-button>
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             </el-button>
             </el-button>
-            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
-            </el-button>
+
             <el-button @click="${esc.d}router.push('/${display.uncapitalize($model.className)}')" type="primary" size="small" icon="el-icon-edit"
             <el-button @click="${esc.d}router.push('/${display.uncapitalize($model.className)}')" type="primary" size="small" icon="el-icon-edit"
                        class="filter-item">添加
                        class="filter-item">添加
             </el-button>
             </el-button>

+ 3 - 0
src/main/resources/templates/MapperTemplate.vm

@@ -12,6 +12,9 @@ import com.izouma.awesomeadmin.model.${model.className};
 /**
 /**
 *  Dao接口
 *  Dao接口
 */
 */
+#if(${model.dataSourceCode}!='dataSource'&&${model.dataSourceCode})
+@DataSource("${model.dataSourceCode}")
+#end
 @Repository("com.zoumaframe.dao.${model.className}Mapper")
 @Repository("com.zoumaframe.dao.${model.className}Mapper")
 public interface ${model.className}Mapper{
 public interface ${model.className}Mapper{
 
 

+ 9 - 10
src/main/resources/templates/MapperXmlSqlServerTemplate.vm

@@ -67,7 +67,7 @@
         <include refid="Base_Column_List"/>
         <include refid="Base_Column_List"/>
         from ${model.tableName}
         from ${model.tableName}
         <where>
         <where>
-            and FlagColumn = 0
+            and 1 = 1
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 <if test="record.$field.modelName != null and !&quot;&quot;.equals(record.$field.modelName)">
                 <if test="record.$field.modelName != null and !&quot;&quot;.equals(record.$field.modelName)">
                     and  ${field.name} = #{record.$field.modelName}
                     and  ${field.name} = #{record.$field.modelName}
@@ -126,7 +126,7 @@
         <include refid="Base_Column_List"/>
         <include refid="Base_Column_List"/>
         from ${model.tableName}
         from ${model.tableName}
         <where>
         <where>
-            and FlagColumn = 0
+            and 1 = 1
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 <if test="$field.modelName != null and !&quot;&quot;.equals($field.modelName)">
                 <if test="$field.modelName != null and !&quot;&quot;.equals($field.modelName)">
                     and  ${field.name} = #{$field.modelName}
                     and  ${field.name} = #{$field.modelName}
@@ -185,7 +185,7 @@
         <include refid="Base_Column_List"/>
         <include refid="Base_Column_List"/>
         from ${model.tableName}
         from ${model.tableName}
         <where>
         <where>
-            and FlagColumn = 0
+            and 1 = 1
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 <if test="$field.modelName != null and !&quot;&quot;.equals($field.modelName)">
                 <if test="$field.modelName != null and !&quot;&quot;.equals($field.modelName)">
                     and ${field.name} = #{$field.modelName}
                     and ${field.name} = #{$field.modelName}
@@ -194,18 +194,17 @@
 
 
         </where>
         </where>
     </select>
     </select>
-    <update id="delete">
-        UPDATE ${model.tableName} SET FlagColumn = 1
-        <where>
-            AND id = #{id}
-        </where>
-    </update>
+    <delete id="delete" parameterType="java.lang.Integer">
+        delete from ${model.tableName}
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.${model.className}">
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.${model.className}">
         select
         select
         <include refid="Base_Column_List"/>
         <include refid="Base_Column_List"/>
         from ${model.tableName}
         from ${model.tableName}
         <where>
         <where>
-            and FlagColumn = 0
+            and 1 = 1
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 #if(${field.searchable})
                 #if(${field.searchable})
                     #if(${field.searchMethod}=="=")
                     #if(${field.searchMethod}=="=")

+ 78 - 5
src/main/vue/src/pages/GenCode.vue

@@ -13,14 +13,22 @@
                 </el-switch>
                 </el-switch>
 
 
             </el-form-item>
             </el-form-item>
-            <el-form-item prop="dataBaseType" label="数据库">
-                <el-select placeholder="数据库类型" size="small" v-model="formData.dataBaseType" class="filter-item">
+            <el-form-item prop="dataBaseType" label="库类型">
+                <el-select placeholder="库类型" size="small" v-model="formData.dataBaseType" @change="cityDataBaseType" class="filter-item">
                     <el-option label="Mysql" value="Mysql">
                     <el-option label="Mysql" value="Mysql">
                     </el-option>
                     </el-option>
                     <el-option label="SqlServer" value="SqlServer">
                     <el-option label="SqlServer" value="SqlServer">
                     </el-option>
                     </el-option>
                 </el-select>
                 </el-select>
             </el-form-item>
             </el-form-item>
+            <el-form-item prop="datasourceInfo" label="数据库">
+
+                <el-select placeholder="数据库" size="small" v-model="formData.dataSourceCode" class="filter-item">
+                    <el-option v-for="item in datasourceInfoList" :label="item.databaseName" :value="item.code" :key="item.code"></el-option>
+                </el-select>
+
+            </el-form-item>
+
             <el-form-item prop="genCode" label="生成">
             <el-form-item prop="genCode" label="生成">
                 <el-checkbox v-model="formData.genTable" label="表"></el-checkbox>
                 <el-checkbox v-model="formData.genTable" label="表"></el-checkbox>
                 <el-checkbox v-model="formData.genClass" label="类"></el-checkbox>
                 <el-checkbox v-model="formData.genClass" label="类"></el-checkbox>
@@ -183,6 +191,22 @@ import axios from 'axios'
 
 
 export default {
 export default {
     created() {
     created() {
+
+        if (this.$route.query.id) {
+            this.$http.get({
+                url: '/genCode/getOne',
+                data: {
+                    id: this.$route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
+                    this.formData = JSON.parse(res.data.genJson);
+                    this.fields = this.formData.fields;
+                    this.formData.id = res.data.id;
+                }
+            })
+        }
+
         this.$http.get({
         this.$http.get({
             url: '/genCode/getSrcPath'
             url: '/genCode/getSrcPath'
         }).then(res => {
         }).then(res => {
@@ -192,6 +216,32 @@ export default {
                 this.formData.viewPathRelative = res.data.viewPath;
                 this.formData.viewPathRelative = res.data.viewPath;
             }
             }
         })
         })
+
+        this.$http.get({
+            url: '/dataSourceInfo/all'
+        }).then(res => {
+            if (res.success) {
+                res.data;
+
+                this.MysqlDataSourceInfos.push(this.baseDataSource);
+
+                if (res.data.length > 0) {
+
+
+                    res.data.forEach(item => {
+                        if ('Mysql' == item.databaseType) {
+                            this.MysqlDataSourceInfos.push(item);
+                        } else if ('SqlServer' == item.databaseType) {
+                            this.SqlServerDataSourceInfos.push(item);
+                        }
+
+                    })
+
+                }
+                this.datasourceInfoList = this.MysqlDataSourceInfos;
+
+            }
+        })
     },
     },
     data() {
     data() {
         return {
         return {
@@ -235,7 +285,9 @@ export default {
                     }
                     }
                 ],
                 ],
                 remark: [{ required: true, message: '请填写描述', trigger: 'blur' }],
                 remark: [{ required: true, message: '请填写描述', trigger: 'blur' }],
-                rootPath: [{ required: true, message: '请填写生成目录', trigger: 'blur' }]
+                rootPath: [{ required: true, message: '请填写生成目录', trigger: 'blur' }],
+                dataBaseType: [{ required: true, message: '请选择数据库类型', trigger: 'blur' }],
+                dataSourceCode: [{ required: true, message: '请填选择数据库', trigger: 'blur' }],
             },
             },
             formData: {
             formData: {
                 tableName: '',
                 tableName: '',
@@ -249,6 +301,7 @@ export default {
                 viewPathRelative: '',
                 viewPathRelative: '',
                 dataBaseType: 'Mysql',
                 dataBaseType: 'Mysql',
                 readTable: false,
                 readTable: false,
+                dataSourceCode: 'dataSource'
             },
             },
             fields: [{
             fields: [{
                 name: 'id',
                 name: 'id',
@@ -274,7 +327,16 @@ export default {
                 defaultValue: 'N',
                 defaultValue: 'N',
                 length: 1
                 length: 1
             },
             },
-            ]
+            ],
+            MysqlDataSourceInfos: [],
+            SqlServerDataSourceInfos: [],
+            baseDataSource: {
+                databaseType: 'Mysql',
+                code: 'dataSource',
+                databaseName: '基础数据库'
+
+            },
+            datasourceInfoList: [],
         }
         }
     },
     },
     computed: {
     computed: {
@@ -299,12 +361,14 @@ export default {
             this.formData.fields = this.fields;
             this.formData.fields = this.fields;
             this.formData.javaPath = this.formData.rootPath + this.formData.javaPathRelative;
             this.formData.javaPath = this.formData.rootPath + this.formData.javaPathRelative;
             this.formData.viewPath = this.formData.rootPath + this.formData.viewPathRelative;
             this.formData.viewPath = this.formData.rootPath + this.formData.viewPathRelative;
+            this.formData.genJson = JSON.stringify(this.formData);
             var alertMsg = "生成代码可能会删除已有同名表、数据或文件,确认要生成么?";
             var alertMsg = "生成代码可能会删除已有同名表、数据或文件,确认要生成么?";
 
 
             this.$alert(alertMsg, '警告', { type: 'error' }).then(() => {
             this.$alert(alertMsg, '警告', { type: 'error' }).then(() => {
-                return axios.post('/genCode/save', this.formData)
+                return axios.post(this.formData.id ? '/genCode/update' : '/genCode/save', this.formData)
             }).then(() => {
             }).then(() => {
                 this.$msgbox({ title: '提示', type: 'success', message: '代码生成成功' });
                 this.$msgbox({ title: '提示', type: 'success', message: '代码生成成功' });
+                this.$router.go(-1);
             }).catch(() => {
             }).catch(() => {
                 if (res === 'cancel') {
                 if (res === 'cancel') {
                     this.$msgbox({ title: '提示', type: 'error', message: '生成取消' });
                     this.$msgbox({ title: '提示', type: 'error', message: '生成取消' });
@@ -342,6 +406,15 @@ export default {
             this.formData.readTable = !this.formData.readTable;
             this.formData.readTable = !this.formData.readTable;
             this.formData.genTable = !this.formData.readTable;
             this.formData.genTable = !this.formData.readTable;
         },
         },
+        cityDataBaseType() {
+            if ('Mysql' == this.formData.dataBaseType) {
+                this.datasourceInfoList = this.MysqlDataSourceInfos;
+                this.formData.dataSourceCode = 'dataSource';
+            } else if ('SqlServer' == this.formData.dataBaseType) {
+                this.datasourceInfoList = this.SqlServerDataSourceInfos;
+                this.formData.dataSourceCode = '';
+            }
+        },
     }
     }
 }
 }
 </script>
 </script>

+ 11 - 1
src/main/vue/src/pages/TestBbb.vue

@@ -7,6 +7,12 @@
             </el-form-item>
             </el-form-item>
                                                                                                                                                                                                                                                                                                         <el-form-item prop="nameBbb" label="名称2">
                                                                                                                                                                                                                                                                                                         <el-form-item prop="nameBbb" label="名称2">
                 <el-input v-model="formData.nameBbb"></el-input>
                 <el-input v-model="formData.nameBbb"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="nameCcc" label="名称3">
+                <el-input v-model="formData.nameCcc"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="nameDdd" label="名称4">
+                <el-input v-model="formData.nameDdd"></el-input>
             </el-form-item>
             </el-form-item>
                                                                                                                                                                                                                                                                     <el-form-item>
                                                                                                                                                                                                                                                                     <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
@@ -47,7 +53,11 @@
                     [
                     [
                         {required: true, message: '请输入 名称2', trigger: 'blur'},
                         {required: true, message: '请输入 名称2', trigger: 'blur'},
                                             ],
                                             ],
-                                    },
+                                                                nameCcc:
+                    [
+                        {required: true, message: '请输入 名称3', trigger: 'blur'},
+                                            ],
+                                                                },
         }
         }
         },
         },
         methods: {
         methods: {

+ 55 - 4
src/main/vue/src/pages/TestBbbs.vue

@@ -13,10 +13,11 @@
                         value="item2">
                         value="item2">
                 </el-option>
                 </el-option>
             </el-select>-->
             </el-select>-->
+              <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+              </el-button>
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             </el-button>
             </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"
             <el-button @click="$router.push('/testBbb')" type="primary" size="small" icon="el-icon-edit"
                        class="filter-item">添加
                        class="filter-item">添加
             </el-button>
             </el-button>
@@ -59,13 +60,28 @@
                     prop="nameBbb"
                     prop="nameBbb"
                     label="名称2"
                     label="名称2"
                     min-width="100">
                     min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('nameCcc')"
+                    prop="nameCcc"
+                    label="名称3"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('nameDdd')"
+                    prop="nameDdd"
+                    label="名称4"
+                    min-width="100">
             </el-table-column>
             </el-table-column>
                                         <el-table-column
                                         <el-table-column
                     label="操作"
                     label="操作"
                     align="center"
                     align="center"
-                    fixed="right">
+                    fixed="right"
+                    min-width="150"
+            >
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
                     <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>
                 </template>
             </el-table-column>
             </el-table-column>
         </el-table>
         </el-table>
@@ -164,6 +180,16 @@
                         label: '名称2',
                         label: '名称2',
                         value: 'nameBbb',
                         value: 'nameBbb',
                         show: true
                         show: true
+                    },
+                                                    {
+                        label: '名称3',
+                        value: 'nameCcc',
+                        show: true
+                    },
+                                                    {
+                        label: '名称4',
+                        value: 'nameDdd',
+                        show: true
                     },
                     },
                                     ],
                                     ],
                 multipleMode: false,
                 multipleMode: false,
@@ -178,6 +204,14 @@
                                                                                                 {
                                                                                                 {
                                 label: '名称2',
                                 label: '名称2',
                                 value: 'name_bbb'
                                 value: 'name_bbb'
+                            },
+                                                                                                {
+                                label: '名称3',
+                                value: 'name_ccc'
+                            },
+                                                                                                {
+                                label: '名称4',
+                                value: 'name_ddd'
                             },
                             },
                                                             ],
                                                             ],
                 advancedQuerySearchKey: '',
                 advancedQuerySearchKey: '',
@@ -285,7 +319,24 @@
             searchData() {
             searchData() {
                 this.currentPage = 1;
                 this.currentPage = 1;
                 this.getData();
                 this.getData();
-            }
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testBbb/del',
+                    data: { id: row.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
 
 
         }
         }
     }
     }

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

@@ -55,6 +55,11 @@ const router = new Router({
                     name: 'api',
                     name: 'api',
                     component: () => import('../pages/Api')
                     component: () => import('../pages/Api')
                 },
                 },
+                {
+                    path: '/genCodes',
+                    name: 'genCodes',
+                    component: () => import('../pages/GenCodes')
+                },
                 {
                 {
                     path: '/genCode',
                     path: '/genCode',
                     name: 'genCode',
                     name: 'genCode',
@@ -200,6 +205,16 @@ const router = new Router({
                     name: 'dataSourceInfo',
                     name: 'dataSourceInfo',
                     component: () => import('../pages/DataSourceInfo')
                     component: () => import('../pages/DataSourceInfo')
                 },
                 },
+                {
+                    path: '/testSqlserverAaas',
+                    name: 'testSqlserverAaas',
+                    component: () => import('../pages/TestSqlserverAaas')
+                },
+                {
+                    path: '/TestSqlserverAaa',
+                    name: 'TestSqlserverAaa',
+                    component: () => import('../pages/TestSqlserverAaa')
+                },
             ]
             ]
         },
         },
         {
         {