Weben_CMS专用代码生成器/Code/App.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/DataBaseFactory/Default/MySqlDataBaseServiceHandle.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/App.config
@@ -2,8 +2,9 @@ <configuration> <connectionStrings> <add name="æ¬å°_MySql_CMS" connectionString="Server=localhost;Database=07a6b2f4bbb04e8bb23a9f17a4a769c2_project;Uid=root;Pwd=123abc.com;" /> <add name="ZS_æ¬å°WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" /> <add name="LA22012_æ¦æ±ç§é_ç产åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="ZS_æ¬å°WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" /> <add name="Shao_æ¬å°WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" /> <!-- <add name="LA22012_æ¦æ±ç§é_ç产åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="LA22012_æ¦æ±ç§é_ç产åº_26æµè¯ç¯å¢" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" /> <add name="LA22012_æ¦æ±ç§é_å¤ä»¶åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="LA22012_æ¦æ±ç§é_å¤ä»¶åº_26æµè¯ç¯å¢" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" /> @@ -11,8 +12,8 @@ <add name="LA21030_æ¦æ±ç§é_æ¬å°" connectionString="Data Source=localhost;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="LA18032_AoSinWms_äº" connectionString="Data Source=120.53.244.200;Initial Catalog=LA18032_AoSinWms;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="GSiemens_LES" connectionString="Data Source=localhost;Initial Catalog=GSiemens_LES;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="GSiemens_WIP" connectionString="Data Source=.;Initial Catalog=GSiemens_WIP;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" /> <add name="GSiemens_WIP" connectionString="Data Source=.;Initial Catalog=GSiemens_WIP;Persist Security Info=True;User ID=sa;Password=123abc.com" /> <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" /> --> </connectionStrings> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup> <runtime> Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/DataBaseFactory/Default/MySqlDataBaseServiceHandle.cs
@@ -15,7 +15,7 @@ //string strSql = $"SELECT COLUMN_NAME as ColumnName, COLUMN_TYPE as DataType, IS_NULLABLE as IsNullable, CHARACTER_MAXIMUM_LENGTH as DataLength,COLUMN_COMMENT as Description " + // $"FROM INFORMATION_SCHEMA.COLUMNS " + // $"WHERE TABLE_NAME = '{tableName}'"; string strSql = $"SELECT DISTINCT c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " + string strSql = $"SELECT c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " + $"CASE WHEN kcu.COLUMN_NAME IS NOT NULL THEN 'true' ELSE 'false' END AS IsPrimaryKey " + $"FROM INFORMATION_SCHEMA.COLUMNS c " + $"LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu " + @@ -23,7 +23,7 @@ $"AND c.TABLE_NAME = kcu.TABLE_NAME " + $"AND c.COLUMN_NAME = kcu.COLUMN_NAME " + $"AND kcu.CONSTRAINT_NAME = 'PRIMARY' " + $"WHERE c.TABLE_NAME = '{tableName}'"+ $"WHERE c.TABLE_NAME = '{tableName}'" + $"ORDER BY c.ORDINAL_POSITION"; @@ -32,6 +32,8 @@ { DataSet ds = MySqlHelper.Query(connStr, strSql); columnList = DataTableToList(ds.Tables[0]); //å»éæä½ columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList(); } catch {