From 5b2c27902205fbcf32bd996aab9ef65e0165264a Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 08 八月 2023 10:12:15 +0800
Subject: [PATCH] 2023-08-08

---
 JavaCode/FrmSys.cs                   |   23 ++-
 JavaCode/BsTemplate/Entity.java      |    2 
 JavaCode/BsTemplate/GeoEntity.java   |    2 
 JavaCode/SysTemplate/Service.java    |    2 
 JavaCode/SysTemplate/Controller.java |   10 
 JavaCode/BsTemplate/GeoMapper.java   |    2 
 JavaCode/BsTemplate/Mapper.java      |    2 
 JavaCode/SysTemplate/pg.sql          |   19 ---
 JavaCode/FrmSys.Designer.cs          |   82 +++++++++----
 JavaCode/FrmMyBatisPlus.Designer.cs  |   83 +++++++++----
 JavaCode/FrmMyBatisPlus.cs           |   80 ++++++++----
 11 files changed, 187 insertions(+), 120 deletions(-)

diff --git a/JavaCode/BsTemplate/Entity.java b/JavaCode/BsTemplate/Entity.java
index 0cea7bd..b1ff3e9 100644
--- a/JavaCode/BsTemplate/Entity.java
+++ b/JavaCode/BsTemplate/Entity.java
@@ -2,7 +2,7 @@
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.lf.server.entity.all.BaseEntity;
+import com.{ns}.server.entity.all.BaseEntity;
 import lombok.*;
 
 import java.math.BigDecimal;
diff --git a/JavaCode/BsTemplate/GeoEntity.java b/JavaCode/BsTemplate/GeoEntity.java
index 6e669f3..257efbc 100644
--- a/JavaCode/BsTemplate/GeoEntity.java
+++ b/JavaCode/BsTemplate/GeoEntity.java
@@ -2,7 +2,7 @@
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.lf.server.entity.all.BaseGeoEntity;
+import com.{ns}.server.entity.all.BaseGeoEntity;
 import lombok.*;
 
 import java.math.BigDecimal;
diff --git a/JavaCode/BsTemplate/GeoMapper.java b/JavaCode/BsTemplate/GeoMapper.java
index 3769593..ee0b5b5 100644
--- a/JavaCode/BsTemplate/GeoMapper.java
+++ b/JavaCode/BsTemplate/GeoMapper.java
@@ -1,7 +1,7 @@
 package {mapperNS};
 
 import {entityNS}.{entityName};
-import com.lf.server.mapper.all.GeomBaseMapper;
+import com.{ns}.server.mapper.all.GeomBaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
diff --git a/JavaCode/BsTemplate/Mapper.java b/JavaCode/BsTemplate/Mapper.java
index ec517b8..0d668e3 100644
--- a/JavaCode/BsTemplate/Mapper.java
+++ b/JavaCode/BsTemplate/Mapper.java
@@ -1,7 +1,7 @@
 package {mapperNS};
 
 import {entityNS}.{entityName};
-import com.lf.server.mapper.all.BasicMapper;
+import com.{ns}.server.mapper.all.BasicMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
diff --git a/JavaCode/FrmMyBatisPlus.Designer.cs b/JavaCode/FrmMyBatisPlus.Designer.cs
index 4228738..bd01aaf 100644
--- a/JavaCode/FrmMyBatisPlus.Designer.cs
+++ b/JavaCode/FrmMyBatisPlus.Designer.cs
@@ -28,7 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.txtNS = new System.Windows.Forms.TextBox();
+            this.txtTabNS = new System.Windows.Forms.TextBox();
             this.txtTabPre = new System.Windows.Forms.TextBox();
             this.btnReadTab = new System.Windows.Forms.Button();
             this.tabList = new System.Windows.Forms.ListBox();
@@ -43,19 +43,21 @@
             this.btnNone = new System.Windows.Forms.Button();
             this.btnGeneEntity = new System.Windows.Forms.Button();
             this.btnGeneMapper = new System.Windows.Forms.Button();
-            this.txtTabNS = new System.Windows.Forms.TextBox();
+            this.txtTabPrefix = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.txtNS = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.dgvTab)).BeginInit();
             this.SuspendLayout();
             // 
-            // txtNS
+            // txtTabNS
             // 
-            this.txtNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtNS.Location = new System.Drawing.Point(12, 13);
-            this.txtNS.Name = "txtNS";
-            this.txtNS.Size = new System.Drawing.Size(104, 26);
-            this.txtNS.TabIndex = 25;
-            this.txtNS.Text = "163875";
+            this.txtTabNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtTabNS.Location = new System.Drawing.Point(12, 13);
+            this.txtTabNS.Name = "txtTabNS";
+            this.txtTabNS.Size = new System.Drawing.Size(104, 26);
+            this.txtTabNS.TabIndex = 25;
+            this.txtTabNS.Text = "163875";
             // 
             // txtTabPre
             // 
@@ -109,7 +111,7 @@
             // txtEntityNS
             // 
             this.txtEntityNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtEntityNS.Location = new System.Drawing.Point(525, 89);
+            this.txtEntityNS.Location = new System.Drawing.Point(524, 89);
             this.txtEntityNS.Name = "txtEntityNS";
             this.txtEntityNS.Size = new System.Drawing.Size(312, 26);
             this.txtEntityNS.TabIndex = 30;
@@ -121,14 +123,14 @@
             this.label3.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Location = new System.Drawing.Point(385, 94);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(136, 16);
+            this.label3.Size = new System.Drawing.Size(135, 16);
             this.label3.TabIndex = 29;
             this.label3.Text = "Entity鍚嶇О绌洪棿锛�";
             // 
             // txtMapperNS
             // 
             this.txtMapperNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtMapperNS.Location = new System.Drawing.Point(525, 53);
+            this.txtMapperNS.Location = new System.Drawing.Point(524, 53);
             this.txtMapperNS.Name = "txtMapperNS";
             this.txtMapperNS.Size = new System.Drawing.Size(312, 26);
             this.txtMapperNS.TabIndex = 32;
@@ -140,14 +142,14 @@
             this.label2.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.Location = new System.Drawing.Point(385, 58);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(136, 16);
+            this.label2.Size = new System.Drawing.Size(135, 16);
             this.label2.TabIndex = 31;
             this.label2.Text = "Mapper鍚嶇О绌洪棿锛�";
             // 
             // btnGeneAll
             // 
             this.btnGeneAll.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnGeneAll.Location = new System.Drawing.Point(525, 208);
+            this.btnGeneAll.Location = new System.Drawing.Point(524, 208);
             this.btnGeneAll.Name = "btnGeneAll";
             this.btnGeneAll.Size = new System.Drawing.Size(312, 25);
             this.btnGeneAll.TabIndex = 33;
@@ -191,7 +193,7 @@
             // btnGeneEntity
             // 
             this.btnGeneEntity.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnGeneEntity.Location = new System.Drawing.Point(525, 169);
+            this.btnGeneEntity.Location = new System.Drawing.Point(524, 169);
             this.btnGeneEntity.Name = "btnGeneEntity";
             this.btnGeneEntity.Size = new System.Drawing.Size(312, 25);
             this.btnGeneEntity.TabIndex = 38;
@@ -202,7 +204,7 @@
             // btnGeneMapper
             // 
             this.btnGeneMapper.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnGeneMapper.Location = new System.Drawing.Point(525, 128);
+            this.btnGeneMapper.Location = new System.Drawing.Point(524, 128);
             this.btnGeneMapper.Name = "btnGeneMapper";
             this.btnGeneMapper.Size = new System.Drawing.Size(312, 25);
             this.btnGeneMapper.TabIndex = 37;
@@ -210,14 +212,15 @@
             this.btnGeneMapper.UseVisualStyleBackColor = true;
             this.btnGeneMapper.Click += new System.EventHandler(this.btnGeneMapper_Click);
             // 
-            // txtTabNS
+            // txtTabPrefix
             // 
-            this.txtTabNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtTabNS.Location = new System.Drawing.Point(525, 15);
-            this.txtTabNS.Name = "txtTabNS";
-            this.txtTabNS.Size = new System.Drawing.Size(312, 26);
-            this.txtTabNS.TabIndex = 40;
-            this.txtTabNS.Text = "bd.";
+            this.txtTabPrefix.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtTabPrefix.Location = new System.Drawing.Point(524, 15);
+            this.txtTabPrefix.Name = "txtTabPrefix";
+            this.txtTabPrefix.Size = new System.Drawing.Size(110, 26);
+            this.txtTabPrefix.TabIndex = 40;
+            this.txtTabPrefix.Text = "bd.";
+            this.txtTabPrefix.TextChanged += new System.EventHandler(this.txtTabPrefix_TextChanged);
             // 
             // label1
             // 
@@ -225,16 +228,38 @@
             this.label1.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.Location = new System.Drawing.Point(433, 20);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(88, 16);
+            this.label1.Size = new System.Drawing.Size(87, 16);
             this.label1.TabIndex = 39;
             this.label1.Text = "琛ㄥ悕鍓嶇紑锛�";
+            // 
+            // txtNS
+            // 
+            this.txtNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtNS.Location = new System.Drawing.Point(725, 15);
+            this.txtNS.Name = "txtNS";
+            this.txtNS.Size = new System.Drawing.Size(111, 26);
+            this.txtNS.TabIndex = 42;
+            this.txtNS.Text = "lf";
+            this.txtNS.TextChanged += new System.EventHandler(this.txtNS_TextChanged);
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(636, 20);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(87, 16);
+            this.label9.TabIndex = 41;
+            this.label9.Text = "鍚嶇О绌洪棿锛�";
             // 
             // FrmMyBatisPlus
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(852, 628);
-            this.Controls.Add(this.txtTabNS);
+            this.Controls.Add(this.txtNS);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.txtTabPrefix);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.btnGeneEntity);
             this.Controls.Add(this.btnGeneMapper);
@@ -247,7 +272,7 @@
             this.Controls.Add(this.txtEntityNS);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.dgvTab);
-            this.Controls.Add(this.txtNS);
+            this.Controls.Add(this.txtTabNS);
             this.Controls.Add(this.txtTabPre);
             this.Controls.Add(this.btnReadTab);
             this.Controls.Add(this.tabList);
@@ -263,7 +288,7 @@
 
         #endregion
 
-        private System.Windows.Forms.TextBox txtNS;
+        private System.Windows.Forms.TextBox txtTabNS;
         private System.Windows.Forms.TextBox txtTabPre;
         private System.Windows.Forms.Button btnReadTab;
         private System.Windows.Forms.ListBox tabList;
@@ -278,7 +303,9 @@
         private System.Windows.Forms.Button btnNone;
         private System.Windows.Forms.Button btnGeneEntity;
         private System.Windows.Forms.Button btnGeneMapper;
-        private System.Windows.Forms.TextBox txtTabNS;
+        private System.Windows.Forms.TextBox txtTabPrefix;
         private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox txtNS;
+        private System.Windows.Forms.Label label9;
     }
 }
\ No newline at end of file
diff --git a/JavaCode/FrmMyBatisPlus.cs b/JavaCode/FrmMyBatisPlus.cs
index 6191c6b..f588e3e 100644
--- a/JavaCode/FrmMyBatisPlus.cs
+++ b/JavaCode/FrmMyBatisPlus.cs
@@ -4,12 +4,10 @@
 using System.ComponentModel;
 using System.Data;
 using System.Diagnostics;
-using System.Drawing;
 using System.IO;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace JavaCode
@@ -44,7 +42,7 @@
                 string tabName = this.txtTabPre.Text.Trim();
                 string tabFilter = string.IsNullOrEmpty(tabName) ? "" : string.Format("and c.relname like '{0}%'", tabName);
 
-                string sql = string.Format("select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in ({0}) {1} and position('pg.dropped' in a.attname) = 0 order by c.relname desc, a.attnum asc", this.txtNS.Text.Trim(), tabFilter);
+                string sql = string.Format("select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in ({0}) {1} and position('pg.dropped' in a.attname) = 0 order by c.relname desc, a.attnum asc", this.txtTabNS.Text.Trim(), tabFilter);
 
                 DataTable dt = _dbHelper.GetDataTable(sql, null);
                 _list = ModelHandler.FillModel<TabInfo>(dt);
@@ -151,30 +149,6 @@
                 MessageBox.Show(ex.Message);
             }
         }
-
-        private void btnGeneAll_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                string mapperPath = Path.Combine(baseDir, "BsGenerate\\Mapper");
-                string entityPath = Path.Combine(baseDir, "BsGenerate\\Entity");
-
-                List<string> names = GetTabList();
-                foreach (string name in names)
-                {
-                    List<TabInfo> tabs = GetTabInfo(name);
-                    GenerateMapper(mapperPath, name, tabs);
-                    GenerateEntity(entityPath, name, tabs);
-                }
-
-                string path = Path.Combine(baseDir, "BsGenerate");
-                OpenFolder(path);
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.Message);
-            }
-        }
         #endregion
 
         #region 鐢熸垚 Mapper
@@ -182,7 +156,7 @@
         {
             if (!Directory.Exists(path)) Directory.CreateDirectory(path);
 
-            string tabName = this.txtTabNS.Text.Trim() + name;
+            string tabName = this.txtTabPrefix.Text.Trim() + name;
             //string shortName = NameConvert(name, true);
             string shortName = GetEntityName(name, true);
 
@@ -192,6 +166,7 @@
             string entityNS = this.txtEntityNS.Text.Trim();
             string entityName = shortName + "Entity";
 
+            string ns = this.txtNS.Text.Trim();
             string bak = string.IsNullOrWhiteSpace(tabs[0].desc) ? shortName : tabs[0].desc.Replace("琛�", "");
 
             //if (this.HasGeom(tabs)) return;
@@ -202,6 +177,7 @@
                 .Replace("{mapperName}", mapperName)
                 .Replace("{entityNS}", entityNS)
                 .Replace("{entityName}", entityName)
+                .Replace("{ns}", ns)
                 .Replace("{bak}", bak);
 
             string fileName = shortName + "Mapper.java";
@@ -214,13 +190,14 @@
         {
             if (!Directory.Exists(path)) Directory.CreateDirectory(path);
 
-            string tabName = this.txtTabNS.Text.Trim() + name;
+            string tabName = this.txtTabPrefix.Text.Trim() + name;
             //string shortName = NameConvert(name, true);
             string shortName = GetEntityName(name, true);
 
             string entityNS = this.txtEntityNS.Text.Trim();
             string entityName = shortName + "Entity";
 
+            string ns = this.txtNS.Text.Trim();
             string bak = string.IsNullOrWhiteSpace(tabs[0].desc) ? shortName : tabs[0].desc.Replace("琛�", "");
             long uid = (long)Math.Floor((new Random()).NextDouble() * 1000000000000000000D);
 
@@ -232,6 +209,7 @@
                 .Replace("{entityName}", entityName)
                 .Replace("{bak}", bak)
                 .Replace("{tabName}", tabName)
+                .Replace("{ns}", ns)
                 .Replace("{uid}", uid.ToString());
 
             StringBuilder sb = new StringBuilder();
@@ -277,6 +255,50 @@
         }
         #endregion
 
+        #region 鐢熸垚鎵�鏈�
+        private void btnGeneAll_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                string mapperPath = Path.Combine(baseDir, "BsGenerate\\Mapper");
+                string entityPath = Path.Combine(baseDir, "BsGenerate\\Entity");
+
+                List<string> names = GetTabList();
+                foreach (string name in names)
+                {
+                    List<TabInfo> tabs = GetTabInfo(name);
+                    GenerateMapper(mapperPath, name, tabs);
+                    GenerateEntity(entityPath, name, tabs);
+                }
+
+                string path = Path.Combine(baseDir, "BsGenerate");
+                OpenFolder(path);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        private void txtTabPrefix_TextChanged(object sender, EventArgs e)
+        {
+            txtChanged(sender, e);
+        }
+
+        private void txtNS_TextChanged(object sender, EventArgs e)
+        {
+            txtChanged(sender, e);
+        }
+
+        private void txtChanged(object sender, EventArgs e)
+        {
+            string pre = txtTabPrefix.Text.Replace(".", "").Trim();
+            string ns = txtNS.Text.Trim();
+            txtMapperNS.Text = "com.lf.server.mapper.bd".Replace("lf", ns).Replace("bd", pre);
+            txtEntityNS.Text = "com.lf.server.entity.bd".Replace("lf", ns).Replace("bd", pre);
+        }
+        #endregion
+
         #region 鍏叡鏂规硶
         private List<string> GetTabList()
         {
diff --git a/JavaCode/FrmSys.Designer.cs b/JavaCode/FrmSys.Designer.cs
index 1f245e1..51332c5 100644
--- a/JavaCode/FrmSys.Designer.cs
+++ b/JavaCode/FrmSys.Designer.cs
@@ -44,7 +44,7 @@
             this.button5 = new System.Windows.Forms.Button();
             this.button6 = new System.Windows.Forms.Button();
             this.button1 = new System.Windows.Forms.Button();
-            this.txtNS = new System.Windows.Forms.TextBox();
+            this.txtTabNS = new System.Windows.Forms.TextBox();
             this.button2 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
             this.txtServiceNS = new System.Windows.Forms.TextBox();
@@ -54,7 +54,9 @@
             this.txtApiTag = new System.Windows.Forms.TextBox();
             this.label8 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.txtTabNS = new System.Windows.Forms.TextBox();
+            this.txtTabPrefix = new System.Windows.Forms.TextBox();
+            this.txtNS = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.dgvTab)).BeginInit();
             this.SuspendLayout();
             // 
@@ -104,7 +106,7 @@
             this.label2.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.Location = new System.Drawing.Point(389, 56);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(136, 16);
+            this.label2.Size = new System.Drawing.Size(135, 16);
             this.label2.TabIndex = 8;
             this.label2.Text = "Mapper鍚嶇О绌洪棿锛�";
             // 
@@ -123,7 +125,7 @@
             this.label3.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Location = new System.Drawing.Point(389, 93);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(136, 16);
+            this.label3.Size = new System.Drawing.Size(135, 16);
             this.label3.TabIndex = 10;
             this.label3.Text = "Entity鍚嶇О绌洪棿锛�";
             // 
@@ -162,7 +164,7 @@
             this.label4.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label4.Location = new System.Drawing.Point(387, 241);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(136, 16);
+            this.label4.Size = new System.Drawing.Size(135, 16);
             this.label4.TabIndex = 14;
             this.label4.Text = "鎻掑叆鏃舵帓闄ゅ瓧娈碉細";
             // 
@@ -190,7 +192,7 @@
             this.label5.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label5.Location = new System.Drawing.Point(387, 276);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(136, 16);
+            this.label5.Size = new System.Drawing.Size(135, 16);
             this.label5.TabIndex = 16;
             this.label5.Text = "鏇存柊鏃舵帓闄ゅ瓧娈碉細";
             // 
@@ -227,14 +229,14 @@
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.entityJava_Click);
             // 
-            // txtNS
+            // txtTabNS
             // 
-            this.txtNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtNS.Location = new System.Drawing.Point(12, 10);
-            this.txtNS.Name = "txtNS";
-            this.txtNS.Size = new System.Drawing.Size(100, 26);
-            this.txtNS.TabIndex = 21;
-            this.txtNS.Text = "20582";
+            this.txtTabNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtTabNS.Location = new System.Drawing.Point(12, 10);
+            this.txtTabNS.Name = "txtTabNS";
+            this.txtTabNS.Size = new System.Drawing.Size(100, 26);
+            this.txtTabNS.TabIndex = 21;
+            this.txtTabNS.Text = "20582";
             // 
             // button2
             // 
@@ -273,7 +275,7 @@
             this.label6.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label6.Location = new System.Drawing.Point(381, 131);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(144, 16);
+            this.label6.Size = new System.Drawing.Size(143, 16);
             this.label6.TabIndex = 24;
             this.label6.Text = "Service鍚嶇О绌洪棿锛�";
             // 
@@ -292,7 +294,7 @@
             this.label7.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label7.Location = new System.Drawing.Point(365, 169);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(160, 16);
+            this.label7.Size = new System.Drawing.Size(159, 16);
             this.label7.TabIndex = 26;
             this.label7.Text = "Controller鍚嶇О绌洪棿:";
             // 
@@ -311,7 +313,7 @@
             this.label8.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label8.Location = new System.Drawing.Point(445, 206);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(80, 16);
+            this.label8.Size = new System.Drawing.Size(79, 16);
             this.label8.TabIndex = 28;
             this.label8.Text = "Api鏍囪瘑锛�";
             // 
@@ -321,24 +323,46 @@
             this.label1.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.Location = new System.Drawing.Point(437, 18);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(88, 16);
+            this.label1.Size = new System.Drawing.Size(87, 16);
             this.label1.TabIndex = 6;
             this.label1.Text = "琛ㄥ悕鍓嶇紑锛�";
             // 
-            // txtTabNS
+            // txtTabPrefix
             // 
-            this.txtTabNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtTabNS.Location = new System.Drawing.Point(529, 13);
-            this.txtTabNS.Name = "txtTabNS";
-            this.txtTabNS.Size = new System.Drawing.Size(339, 26);
-            this.txtTabNS.TabIndex = 7;
-            this.txtTabNS.Text = "lf.";
+            this.txtTabPrefix.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtTabPrefix.Location = new System.Drawing.Point(529, 13);
+            this.txtTabPrefix.Name = "txtTabPrefix";
+            this.txtTabPrefix.Size = new System.Drawing.Size(111, 26);
+            this.txtTabPrefix.TabIndex = 7;
+            this.txtTabPrefix.Text = "lf.";
+            // 
+            // txtNS
+            // 
+            this.txtNS.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtNS.Location = new System.Drawing.Point(757, 15);
+            this.txtNS.Name = "txtNS";
+            this.txtNS.Size = new System.Drawing.Size(111, 26);
+            this.txtNS.TabIndex = 31;
+            this.txtNS.Text = "lf";
+            this.txtNS.TextChanged += new System.EventHandler(this.txtNS_TextChanged);
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("瀹嬩綋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(665, 20);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(87, 16);
+            this.label9.TabIndex = 30;
+            this.label9.Text = "鍚嶇О绌洪棿锛�";
             // 
             // FrmSys
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1095, 630);
+            this.Controls.Add(this.txtNS);
+            this.Controls.Add(this.label9);
             this.Controls.Add(this.txtApiTag);
             this.Controls.Add(this.label8);
             this.Controls.Add(this.txtControllerNS);
@@ -347,7 +371,7 @@
             this.Controls.Add(this.label6);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
-            this.Controls.Add(this.txtNS);
+            this.Controls.Add(this.txtTabNS);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.button6);
             this.Controls.Add(this.button5);
@@ -361,7 +385,7 @@
             this.Controls.Add(this.label3);
             this.Controls.Add(this.txtMapperNS);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.txtTabNS);
+            this.Controls.Add(this.txtTabPrefix);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.txtTabPre);
             this.Controls.Add(this.btnReadTab);
@@ -394,7 +418,7 @@
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.Button button6;
         private System.Windows.Forms.Button button1;
-        private System.Windows.Forms.TextBox txtNS;
+        private System.Windows.Forms.TextBox txtTabNS;
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.TextBox txtServiceNS;
@@ -404,7 +428,9 @@
         private System.Windows.Forms.TextBox txtApiTag;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox txtTabNS;
+        private System.Windows.Forms.TextBox txtTabPrefix;
+        private System.Windows.Forms.TextBox txtNS;
+        private System.Windows.Forms.Label label9;
     }
 }
 
diff --git a/JavaCode/FrmSys.cs b/JavaCode/FrmSys.cs
index fbc01f1..1229e5b 100644
--- a/JavaCode/FrmSys.cs
+++ b/JavaCode/FrmSys.cs
@@ -4,12 +4,10 @@
 using System.ComponentModel;
 using System.Data;
 using System.Diagnostics;
-using System.Drawing;
 using System.IO;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace JavaCode
@@ -38,7 +36,7 @@
         private void btnReadTab_Click(object sender, EventArgs e)
         {
             string txtTab = this.txtTabPre.Text.Trim();
-            string sql = "select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and c.relname like '" + txtTab + "%' and attname not like '%pg.dropped%' and obj_description(c.oid) is not null and relnamespace=" + this.txtNS.Text.Trim() + " order by c.relname desc, a.attnum asc";
+            string sql = "select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and c.relname like '" + txtTab + "%' and attname not like '%pg.dropped%' and obj_description(c.oid) is not null and relnamespace=" + this.txtTabNS.Text.Trim() + " order by c.relname desc, a.attnum asc";
 
             DataTable dt = _dbHelper.GetDataTable(sql, null);
 
@@ -96,7 +94,7 @@
 
         private void GenerateMapperXml(string name, List<TabInfo> tabs)
         {
-            string tabName = this.txtTabNS.Text.Trim() + name;
+            string tabName = this.txtTabPrefix.Text.Trim() + name;
             name = name.Replace(this.txtTabPre.Text, "");
 
             string shortName = NameConvert(name, true);
@@ -360,7 +358,7 @@
             int idx = this.dgvTab.CurrentRow.Index;
             TabInfo selectTabInfo = tabs[idx];
 
-            string colType  = GetJavaType(selectTabInfo);
+            string colType = GetJavaType(selectTabInfo);
             string colName = NameConvert(selectTabInfo.col, false);
             string queryCol = colType + " " + colName;
             string colBak = selectTabInfo.bak;
@@ -540,6 +538,7 @@
             string entityName = shortName + "Entity";
             string serviceName = shortName + "Service";
             string bak = tabs[0].desc.Replace("琛�", "");
+            string ns = this.txtNS.Text.Trim();
 
             int idx = this.dgvTab.CurrentRow.Index;
             TabInfo selectTabInfo = tabs[idx];
@@ -564,7 +563,8 @@
                 .Replace("{bak}", bak)
                 .Replace("{queryCol}", queryCol)
                 .Replace("{colName}", colName)
-                .Replace("{where}", where); 
+                .Replace("{ns}", ns)
+                .Replace("{where}", where);
 
             string path = Path.Combine(baseDir, "SysGenerate");
             if (!Directory.Exists(path))
@@ -613,6 +613,7 @@
             string controllerName = shortName + "Controller";
             string bak = tabs[0].desc.Replace("琛�", "");
             string apiName = NameConvert(name, false);
+            string ns = this.txtNS.Text.Trim();
 
             int idx = this.dgvTab.CurrentRow.Index;
             TabInfo selectTabInfo = tabs[idx];
@@ -639,6 +640,7 @@
                 .Replace("{colType}", colType)
                 .Replace("{apiTag}", apiTag)
                 .Replace("{apiName}", apiName)
+                .Replace("{ns}", ns)
                 .Replace("{bak}", bak);
 
             string path = Path.Combine(baseDir, "SysGenerate");
@@ -653,6 +655,15 @@
         #endregion
 
         #region 鐢熸垚鎵�鏈夋枃浠�
+        private void txtNS_TextChanged(object sender, EventArgs e)
+        {
+            string ns = txtNS.Text.Trim();
+            txtMapperNS.Text = "com.lf.server.mapper.sys".Replace("lf", ns);
+            txtEntityNS.Text = "com.lf.server.entity.sys".Replace("lf", ns);
+            txtServiceNS.Text = "com.lf.server.service.sys".Replace("lf", ns);
+            txtControllerNS.Text = "com.lf.server.controller.sys".Replace("lf", ns);
+        }
+
         private void generateAll_Click(object sender, EventArgs e)
         {
             try
diff --git a/JavaCode/SysTemplate/Controller.java b/JavaCode/SysTemplate/Controller.java
index e4acb0e..c58d2bf 100644
--- a/JavaCode/SysTemplate/Controller.java
+++ b/JavaCode/SysTemplate/Controller.java
@@ -1,12 +1,12 @@
 package {controllerNS};
 
-import com.lf.server.annotation.SysLog;
-import com.lf.server.controller.all.BaseController;
-import com.lf.server.entity.all.ResponseMsg;
+import com.{ns}.server.annotation.SysLog;
+import com.{ns}.server.controller.all.BaseController;
+import com.{ns}.server.entity.all.ResponseMsg;
 import {entityNS}.{entityName};
-import com.lf.server.entity.sys.UserEntity;
+import com.{ns}.server.entity.sys.UserEntity;
 import {serviceNS}.{serviceName};
-import com.lf.server.service.sys.TokenService;
+import com.{ns}.server.service.sys.TokenService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
diff --git a/JavaCode/SysTemplate/Service.java b/JavaCode/SysTemplate/Service.java
index 6e9185a..908963a 100644
--- a/JavaCode/SysTemplate/Service.java
+++ b/JavaCode/SysTemplate/Service.java
@@ -1,7 +1,7 @@
 package {serviceNS};
 
 import {entityNS}.{entityName};
-import com.lf.server.helper.StringHelper;
+import com.{ns}.server.helper.StringHelper;
 import {mapperNS}.{mapperName};
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
diff --git a/JavaCode/SysTemplate/pg.sql b/JavaCode/SysTemplate/pg.sql
index f9880ed..12e075f 100644
--- a/JavaCode/SysTemplate/pg.sql
+++ b/JavaCode/SysTemplate/pg.sql
@@ -1,22 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-select * from stationseries;
-select * from sitepoint order by gid;
-update sitepoint set sitename='杞崡棣栫珯' where gid=55;
 ------------------------------------------------------------------------------ SQL璇彞
 select * from data_dir;
 select * from meta_data;

--
Gitblit v1.9.3