查询增加字段

This commit is contained in:
liming 蔡
2026-08-14 10:01:37 +08:00
parent cd841a6aba
commit 8e9656a2b5
5 changed files with 36 additions and 23 deletions
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace JY.Inspection namespace JY.DAL
{ {
public class ConstValue public class ConstValue
{ {
+1
View File
@@ -154,6 +154,7 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ConstValue.cs" />
<Compile Include="IDbHelper.cs" /> <Compile Include="IDbHelper.cs" />
<Compile Include="IocConfig.cs" /> <Compile Include="IocConfig.cs" />
<Compile Include="Service\BlankingDataService.cs" /> <Compile Include="Service\BlankingDataService.cs" />
+23 -19
View File
@@ -376,34 +376,38 @@ namespace JY.DAL
} }
break; break;
case 1: case 1:
strSql = @" SELECT [ID] ID string preSql = @" SELECT [ID] ID
,[TD] 序号 ,[TD] 序号
,[WorkShift] 班次 ,[WorkShift] 班次
,[TDGroup] 主道 ,[TDGroup] 主道
,[ArrivalBarCode] 入站条码 ,[ArrivalBarCode] 入站条码
,[DepartureBarCode] 出站条码 ,[DepartureBarCode] 出站条码
,[TMDB] 条码对比 ,[TMDB] 条码对比
,CONVERT(varchar, [OutTime], 120) 出站时间 ,CONVERT(varchar, [OutTime], 120) 出站时间 ";
,[CCD1] '正面(2D/3D)'
,[CCD2] '反面(2D/3D)' StringBuilder sb = new StringBuilder();
,[CCD3] '左侧面(2D/3D)' foreach (var propName in ConstValue.CCD_SDict.Keys)
,[CCD4] '右侧面(2D/3D)' {
,[CCD5] '顶面(2D/3D)' sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
,[CCD6] '底面(2D/3D)' }
,[CCD7] 底WE1
,[CCD8] 底WE2 foreach (var propName in ConstValue.CCD_FDict.Keys)
,[CCD9] 底WE3 {
,[CCD10] 底WE4 sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
,[CCD11] 中ME1 }
,[CCD12] 中ME2
,[CCD13] 中ME3 foreach (var propName in ConstValue.CCD_IDict.Keys)
,[CCD14] 中ME4 {
,[CCD15] '极柱(POS/NEG)' sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
,[CCD16] '防爆阀(PRO)' }
,[Result] 综合结果 string formatSql = sb.ToString();
string nextSql = @",[Result] 综合结果
,[Remark] 备注 ,[Remark] 备注
,[Flag] 状态 ,[Flag] 状态
FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' "; FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' ";
strSql = string.Concat(preSql, formatSql, nextSql);
if (strBarCode != "") if (strBarCode != "")
{ {
strSql += " and DepartureBarCode like '%" + strBarCode + "' "; strSql += " and DepartureBarCode like '%" + strBarCode + "' ";
-1
View File
@@ -194,7 +194,6 @@
<Compile Include="Common\ConnectionClient.cs" /> <Compile Include="Common\ConnectionClient.cs" />
<Compile Include="Common\DGShowMsg.cs" /> <Compile Include="Common\DGShowMsg.cs" />
<Compile Include="Common\DateTimeSynchronization.cs" /> <Compile Include="Common\DateTimeSynchronization.cs" />
<Compile Include="ConstValue.cs" />
<Compile Include="Entity\AlarmStatus.cs" /> <Compile Include="Entity\AlarmStatus.cs" />
<Compile Include="Frm\FormMesGradingSet.cs"> <Compile Include="Frm\FormMesGradingSet.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
+9
View File
@@ -0,0 +1,9 @@
ALTER TABLE S1270.dbo.BlankingData ADD CCDF1 float NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDF2 float NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDF3 float NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI1 int NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI2 int NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI3 int NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI4 int NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI5 int NULL;
ALTER TABLE S1270.dbo.BlankingData ADD CCDI6 int NULL;