From fd8067df394b19bc62ced82b3c34c63a977f72c0 Mon Sep 17 00:00:00 2001
From: "ruoxing.wang" <88384874@qq.com>
Date: Fri, 6 Dec 2024 17:31:07 +0800
Subject: [PATCH] 1
---
AddMaterial/App_Code/Function.cs | 149 +++++++---
AddMaterial/App_Code/Model.cs | 5 +
AddMaterial/Default.html | 47 +--
FiveScreen/FrmCenter.Designer.cs | 25 +-
FiveScreen/FrmInjection1.Designer.cs | 16 +-
FiveScreen/FrmPainting1.Designer.cs | 54 ++--
FiveScreen/FrmPainting2.Designer.cs | 50 ++--
FiveScreen/FrmPainting3.Designer.cs | 54 ++--
FiveScreen/Program.cs | 2 +-
.../bin/Debug/Report/111 - 副本2.grf | Bin 3270 -> 0 bytes
MESClassLibrary/BLL/Mistake247/BoxBLL.cs | 35 +++
MESClassLibrary/BLL/Mistake247/RecordBLL.cs | 41 +++
MESClassLibrary/DAL/Mistake247/BoxDAL.cs | 53 ++++
MESClassLibrary/DAL/Mistake247/RecordDAL.cs | 89 ++++++
MESClassLibrary/DAL/SqlHelper.cs | 5 +-
MESClassLibrary/MESClassLibrary.csproj | 1 +
.../PunchAndWeld/FrmDoorSill_214_3.cs | 1 +
PurchingMistakeNew/Form1.cs | 75 +++--
PurchingMistakeNew/Form3.cs | 182 +++++++++---
PurchingMistakeNew/PurchingMistakeNew.csproj | 31 ++
PurchingMistakeNew/Report/11.grf | 125 ++++++++
PurchingMistakeNew/Report/22.grf | Bin 0 -> 728 bytes
.../Report/X247 右侧前门板.grf | 223 +++++++++++++++
.../Report/X247 右侧前门板装箱单.grf | 221 +++++++++++++++
.../Report/X247 右侧后门板.grf | 222 +++++++++++++++
.../Report/X247 右侧后门板装箱单.grf | 225 +++++++++++++++
.../Report/X247 左侧前门板.grf | 225 +++++++++++++++
.../Report/X247 左侧前门板装箱单.grf | 241 ++++++++++++++++
.../Report/X247 左侧后门板.grf | 225 +++++++++++++++
.../Report/X247 左侧后门板装箱单.grf | 241 ++++++++++++++++
.../Report/X247后部中间扰流板.grf | 268 ++++++++++++++++++
.../Report/X247后部扰流板装箱单.grf | 184 ++++++++++++
PurchingMistakeNew/ReportHelper.cs | 13 +
33 files changed, 3113 insertions(+), 215 deletions(-)
delete mode 100644 InjectionPC/bin/Debug/Report/111 - 副本2.grf
create mode 100644 PurchingMistakeNew/Report/11.grf
create mode 100644 PurchingMistakeNew/Report/22.grf
create mode 100644 PurchingMistakeNew/Report/X247 右侧前门板.grf
create mode 100644 PurchingMistakeNew/Report/X247 右侧前门板装箱单.grf
create mode 100644 PurchingMistakeNew/Report/X247 右侧后门板.grf
create mode 100644 PurchingMistakeNew/Report/X247 右侧后门板装箱单.grf
create mode 100644 PurchingMistakeNew/Report/X247 左侧前门板.grf
create mode 100644 PurchingMistakeNew/Report/X247 左侧前门板装箱单.grf
create mode 100644 PurchingMistakeNew/Report/X247 左侧后门板.grf
create mode 100644 PurchingMistakeNew/Report/X247 左侧后门板装箱单.grf
create mode 100644 PurchingMistakeNew/Report/X247后部中间扰流板.grf
create mode 100644 PurchingMistakeNew/Report/X247后部扰流板装箱单.grf
diff --git a/AddMaterial/App_Code/Function.cs b/AddMaterial/App_Code/Function.cs
index 24953c4..bba0ab1 100644
--- a/AddMaterial/App_Code/Function.cs
+++ b/AddMaterial/App_Code/Function.cs
@@ -22,7 +22,7 @@ public class Function
try
{
string sql = @"
- select a.CylinderNo, d.StationNo, b.BarCode, b.Time1
+ select a.CylinderNo, d.StationNo, b.BarCode, b.Time1,b.Flag
from tb_Cylinder a
left join tb_CylinderAndRaw b
on a.CylinderID = b.CylinderID and b.Time2 is null
@@ -60,6 +60,7 @@ public class Function
model.Station = dt1.Rows[i]["StationNo"].ToString();
model.BatchNo = batchNo;
model.Time1 = dt1.Rows[i]["Time1"].ToString();
+ model.Flag = dt1.Rows[i]["Flag"].ToString();
if (dt2 != null && dt2.Rows.Count > 0)
{
model.MaterialName = dt2.Rows[0]["ProductName"].ToString();
@@ -71,6 +72,7 @@ public class Function
{
model.ProductName = dt_product.Rows[0]["Plan"].ToString();
}
+ model.PartNo = partNo.Trim();
list.Add(model);
}
@@ -86,6 +88,33 @@ public class Function
}
}
+ public static string GetLastMaterialCode(string drumBarCode)
+ {
+ try
+ {
+ string sql = @"select top 2 * from tb_CylinderAndRaw where DrumBarCode='" + drumBarCode + "' order by time1 desc";
+
+ DataTable res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null);
+ if (res.Rows.Count == 2)
+ {
+ string stockNo = "";
+ string batchNo = "";
+ string partNo = "";
+ GetCode(res.Rows[1]["BarCode"].ToString(), out stockNo, out batchNo, out partNo);
+ return partNo;
+ }
+ else
+ {
+ return DateTime.Now.ToString();
+ }
+ }
+ catch
+ {
+ return DateTime.Now.ToString(); ;
+ }
+
+ }
+
///
/// 根据注塑机查询计划要生产的产品信息
///
@@ -524,40 +553,40 @@ public class Function
SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%槛%') c2,08 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%槛%') c2,09 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%槛%') c2,09 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%槛%') c2,10 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%槛%') c2,10 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%槛%') c2,11 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%槛%' ) c2,11 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%槛%' ) c2,12 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%槛%' ) c2,12 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%槛%' ) c2,13 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%槛%' ) c2,13 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%槛%' ) c2,14 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%槛%') c2,14 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%槛%') c2,15 AS h
FROM #a WHERE ([createTime]BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%槛%') c2,15 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%槛%') c2,16 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%槛%') c2,16 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%槛%') c2,17 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%槛%') c2,17 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%槛%') c2,18 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%槛%' ) c2,18 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%槛%' ) c2,19 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%保%'
UNION ALL SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%槛%') c2,19 AS h
+ (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%槛%') c2,20 AS h
FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%保%'
ORDER BY h asc ";
@@ -579,40 +608,40 @@ public class Function
SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%槛%') c2,20 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%槛%') c2,21 AS h
FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%槛%') c2,21 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%槛%') c2,22 AS h
FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%槛%') c2,22 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%槛%') c2,23 AS h
FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%槛%' ) c2,23 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%槛%' ) c2,00 AS h
FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%槛%') c2,00 AS h
- FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%保%'
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%槛%') c2,01 AS h
+ FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,01 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,02 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,02 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,03 AS h
FROM #b WHERE ([createTime]BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,03 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,04 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,04 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,05 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%槛%') c2,05 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%槛%') c2,06 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,06 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,07 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,07 AS h
+ (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,08 AS h
FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%保%'
";
}
@@ -631,40 +660,40 @@ public class Function
SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%槛%') c2,20 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%槛%') c2,21 AS h
FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%槛%') c2,21 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%槛%') c2,22 AS h
FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%槛%') c2,22 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%槛%') c2,23 AS h
FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%槛%') c2,23 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%槛%') c2,00 AS h
FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%槛%') c2,00 AS h
- FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%保%'
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%槛%') c2,01 AS h
+ FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%槛%') c2,01 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%槛%') c2,02 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%槛%') c2,02 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%槛%') c2,03 AS h
FROM #c WHERE ([createTime]BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%槛%' ) c2,03 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%槛%' ) c2,04 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%槛%') c2,04 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%槛%') c2,05 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%槛%') c2,05 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%槛%') c2,06 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%槛%') c2,06 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%槛%') c2,07 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%保%'
UNION all SELECT COUNT(*) AS c1 ,
- (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%槛%') c2,07 AS h
+ (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%槛%') c2,08 AS h
FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%保%'
";
}
@@ -737,4 +766,46 @@ public class Function
return false;
}
}
+
+ ///
+ /// 计算时间差
+ ///
+ /// 时间1
+ /// 时间2
+ /// 返回值:时间差(毫秒为单位)
+ public static long TimeDiff(DateTime t, DateTime t2)
+ {
+ long lReturn = -1;
+ System.TimeSpan NowValue = new TimeSpan(t.Ticks);
+ System.TimeSpan TimeValue = new TimeSpan(t2.Ticks);
+ System.TimeSpan DateDiff = TimeSpan.Zero;
+ try
+ {
+ //计算时间差
+ //DateDiff = TimeValue.Subtract(NowValue).Duration();
+ DateDiff = TimeValue.Subtract(NowValue);
+ int hours = DateDiff.Hours;
+ int minutes = DateDiff.Minutes;
+ int seconds = DateDiff.Seconds;
+ int milliseconds = DateDiff.Milliseconds;
+
+ string TimeDiff = hours.ToString() + ":"
+ + minutes.ToString() + ":"
+ + seconds.ToString() + "."
+ + milliseconds.ToString();
+ //是否比现在的时间小,如果小就设置成第二天再启动,否则当天启动
+ if (hours <= 0 && minutes <= 0 && seconds <= 0 && milliseconds <= 0)
+ hours += 24;
+
+ lReturn = hours * 3600
+ + minutes * 60
+ + seconds;
+ }
+ catch (Exception ex)
+ {
+ LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name);
+ return 0;
+ }
+ return lReturn;
+ }
}
\ No newline at end of file
diff --git a/AddMaterial/App_Code/Model.cs b/AddMaterial/App_Code/Model.cs
index 6056418..22b88e2 100644
--- a/AddMaterial/App_Code/Model.cs
+++ b/AddMaterial/App_Code/Model.cs
@@ -32,6 +32,11 @@ public class Model
/// 加料时间
///
public string Time1 { get; set; }
+ ///
+ /// 首次加料还是续料
+ ///
+ public string Flag { get; set; }
+ public string PartNo { get; set; }
}
public class PlanModel
diff --git a/AddMaterial/Default.html b/AddMaterial/Default.html
index 1bf6402..ad31016 100644
--- a/AddMaterial/Default.html
+++ b/AddMaterial/Default.html
@@ -1,27 +1,27 @@