|
|
@ -696,7 +696,12 @@ namespace MESClassLibrary.DAL.BasicInfo |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
string sql = @"select top 1 * from " + tableName + " where BarCode=@BarCode and IsBad=0 and IsDel=0 order by [CreateTime] desc "; |
|
|
|
string columnName = "OneBarCode"; |
|
|
|
if (BarCode.Contains(".")) |
|
|
|
{ |
|
|
|
columnName = "BarCode"; |
|
|
|
} |
|
|
|
string sql = @"select top 1 * from " + tableName + $" where {columnName}=@BarCode and IsBad=0 and IsDel=0 order by [CreateTime] desc "; |
|
|
|
|
|
|
|
SqlParameter[] param = new SqlParameter[1]; |
|
|
|
param[0] = new SqlParameter("@BarCode", SqlDbType.VarChar); |
|
|
|