From 2801e6068f96bf8baf8830f1f7c7c02621c5228d Mon Sep 17 00:00:00 2001 From: OCEAN <1010331798@qq.com> Date: Sun, 16 Feb 2025 18:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=BE=E6=A2=A6=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CNAS_DBSync/frmDatabaseParams.cs | 3 +- CnasSynchronusDAL/DAL/MySQLDAL.cs | 4 +- dll/CNAS_DBSync.exe | Bin 251392 -> 251392 bytes dll/Cache/SyncTime.bin | 2 +- dll/CnasSynchronusDAL.dll | Bin 107008 -> 107008 bytes dll/ErrorLog/20250216.txt | 47 ++++++++++++++++++ dll/ErrorLog/20250216.txt20250216.txt | 36 ++++++++++++++ .../20250216.txt20250216.txt20250216.txt | 17 +++++++ ...16.txt20250216.txt20250216.txt20250216.txt | 11 ++++ dll/ServiceLog/20250216.txt | 44 ++++++++++++++++ dll/ServiceLog/20250216.txt20250216.txt | 11 ++++ 11 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 dll/ErrorLog/20250216.txt20250216.txt20250216.txt20250216.txt create mode 100644 dll/ServiceLog/20250216.txt20250216.txt diff --git a/CNAS_DBSync/frmDatabaseParams.cs b/CNAS_DBSync/frmDatabaseParams.cs index b87f425..ee78f27 100644 --- a/CNAS_DBSync/frmDatabaseParams.cs +++ b/CNAS_DBSync/frmDatabaseParams.cs @@ -259,7 +259,7 @@ namespace CNAS_DBSync syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtRemoteTxtUserId.Text.Trim(); syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtRemoteTxtPwd.Text.Trim(); break; - case DataSourceType.Excel: + case DataSourceType.PostgreSQL: syncInstrumentItem.SyncInstrumentDSInfo.Host = this.txtPostgreSqlHost.Text.Trim(); syncInstrumentItem.SyncInstrumentDSInfo.ServerName = this.txtPostgreSqlServer.Text.Trim(); @@ -281,6 +281,7 @@ namespace CNAS_DBSync syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtDmPwd.Text.Trim(); syncInstrumentItem.SyncInstrumentDSInfo.Port = this.txtDmPort.Text.Trim(); break; + case DataSourceType.Excel: default: syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtInportExcel.Text.Trim(); syncInstrumentItem.SyncInstrumentDSInfo.Host = ""; diff --git a/CnasSynchronusDAL/DAL/MySQLDAL.cs b/CnasSynchronusDAL/DAL/MySQLDAL.cs index 3266cb3..ce51c26 100644 --- a/CnasSynchronusDAL/DAL/MySQLDAL.cs +++ b/CnasSynchronusDAL/DAL/MySQLDAL.cs @@ -366,7 +366,9 @@ namespace CnasSynchronusDAL string strSql = string.Format("SELECT Convert(max(Convert({0},datetime)) using utf8) FROM {1}", strDateColumn, strTableName, strInstrumentColumn, strInstrumentValue); if(!string.IsNullOrWhiteSpace(strInstrumentColumn)&& !string.IsNullOrWhiteSpace(strInstrumentValue)) - strSql+= string.Format(" where {0}='{1}'", strInstrumentColumn,strInstrumentValue); + strSql += string.Format(" where {0} like '{1}%'", strInstrumentColumn, strInstrumentValue); + //strSql+= string.Format(" where {0}='{1}'", strInstrumentColumn,strInstrumentValue); + string strDateTime = GetMaxTimeByTableName(strSql); DateTime dateTime = DateTime.Now; if (DateTime.TryParse(strDateTime, out dateTime)) diff --git a/dll/CNAS_DBSync.exe b/dll/CNAS_DBSync.exe index 8c06214796feebfb99b2762b78f0416d9e12af70..50dae87181b18ececb9f8b3b6488bb7961c7e9d1 100644 GIT binary patch delta 89 zcmV-f0H*(dtPg;!50HoizHoowv5c%<0;>I$wu6Ujer|UjjDn5E`0Mo?}^0MXLeN vuzQ!_G`E0F1IT#>nzw*W1IT#<%4wk3mrTb4G!Qjg>|sU@fl8Fcs>BpG+NHOU#{+Nk#WzKq z(>C339TPM=gO0XJ7KABmB3?CFwOU54KTtM*bXKes|L{lu7)2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