查询增加字段
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JY.DAL
|
||||
{
|
||||
public class ConstValue
|
||||
{
|
||||
/// <summary>
|
||||
/// CCD的OK/NG数量
|
||||
/// </summary>
|
||||
//public const int CCD_SCount = 16;
|
||||
public const string CCD_OK = "OK";
|
||||
public const string CCD_NG = "NG";
|
||||
|
||||
public static readonly Dictionary<string, string> CCD_SDict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "CCD1", "正面侧面_3D" },
|
||||
{ "CCD2", "正面侧面_2D" },
|
||||
{ "CCD3", "正面底面棱_3D" },
|
||||
{ "CCD4", "后面右侧面_2D" },
|
||||
{ "CCD5", "后面底面棱_3D" },
|
||||
{ "CCD6", "极柱面_3D" },
|
||||
{ "CCD7", "极柱面_2D" },
|
||||
{ "CCD8", "底面_3D" },
|
||||
{ "CCD9", "底面_2D" },
|
||||
{ "CCD10", "左中间棱_3D" },
|
||||
{ "CCD11", "右中间棱_3D" },
|
||||
{ "CCD12", "防爆阀_2D" },
|
||||
{ "CCD13", "左右极柱_2D" },
|
||||
{ "CCD14", "L胶检测结果" },
|
||||
{ "CCD15", "二维码等级判定结果" }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// CCD的浮点数数量
|
||||
/// </summary>
|
||||
//public const int CCD_FCount = 3;
|
||||
|
||||
public static readonly Dictionary<string, string> CCD_FDict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "CCDF1", "大面平面度" },
|
||||
{ "CCDF2", "侧面平面度" },
|
||||
{ "CCDF3", "底面平面度" }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// CCD的整数数量
|
||||
/// </summary>
|
||||
//public const int CCD_ICount = 6;
|
||||
|
||||
public static readonly Dictionary<string, string> CCD_IDict = new Dictionary<string, string>()
|
||||
{
|
||||
{ "CCDI1", "通道" },
|
||||
{ "CCDI2", "下面凹坑数量" },
|
||||
{ "CCDI3", "前面凹坑数量" },
|
||||
{ "CCDI4", "后面凹坑数量" },
|
||||
{ "CCDI5", "左面凹坑数量" },
|
||||
{ "CCDI6", "右面凹坑数量" }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -154,6 +154,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConstValue.cs" />
|
||||
<Compile Include="IDbHelper.cs" />
|
||||
<Compile Include="IocConfig.cs" />
|
||||
<Compile Include="Service\BlankingDataService.cs" />
|
||||
|
||||
+25
-21
@@ -376,34 +376,38 @@ namespace JY.DAL
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
strSql = @" SELECT [ID] ID
|
||||
string preSql = @" SELECT [ID] ID
|
||||
,[TD] 序号
|
||||
,[WorkShift] 班次
|
||||
,[TDGroup] 主道
|
||||
,[ArrivalBarCode] 入站条码
|
||||
,[DepartureBarCode] 出站条码
|
||||
,[TMDB] 条码对比
|
||||
,CONVERT(varchar, [OutTime], 120) 出站时间
|
||||
,[CCD1] '正面(2D/3D)'
|
||||
,[CCD2] '反面(2D/3D)'
|
||||
,[CCD3] '左侧面(2D/3D)'
|
||||
,[CCD4] '右侧面(2D/3D)'
|
||||
,[CCD5] '顶面(2D/3D)'
|
||||
,[CCD6] '底面(2D/3D)'
|
||||
,[CCD7] 底WE1
|
||||
,[CCD8] 底WE2
|
||||
,[CCD9] 底WE3
|
||||
,[CCD10] 底WE4
|
||||
,[CCD11] 中ME1
|
||||
,[CCD12] 中ME2
|
||||
,[CCD13] 中ME3
|
||||
,[CCD14] 中ME4
|
||||
,[CCD15] '极柱(POS/NEG)'
|
||||
,[CCD16] '防爆阀(PRO)'
|
||||
,[Result] 综合结果
|
||||
,[Remark] 备注
|
||||
,[Flag] 状态
|
||||
,CONVERT(varchar, [OutTime], 120) 出站时间 ";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var propName in ConstValue.CCD_SDict.Keys)
|
||||
{
|
||||
sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
|
||||
}
|
||||
|
||||
foreach (var propName in ConstValue.CCD_FDict.Keys)
|
||||
{
|
||||
sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
|
||||
}
|
||||
|
||||
foreach (var propName in ConstValue.CCD_IDict.Keys)
|
||||
{
|
||||
sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
|
||||
}
|
||||
string formatSql = sb.ToString();
|
||||
|
||||
string nextSql = @",[Result] 综合结果
|
||||
,[Remark] 备注
|
||||
,[Flag] 状态
|
||||
FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' ";
|
||||
strSql = string.Concat(preSql, formatSql, nextSql);
|
||||
|
||||
if (strBarCode != "")
|
||||
{
|
||||
strSql += " and DepartureBarCode like '%" + strBarCode + "' ";
|
||||
|
||||
Reference in New Issue
Block a user