@ -22,7 +22,7 @@ public class Function
try
try
{
{
string sql = @ "
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
from tb_Cylinder a
left join tb_CylinderAndRaw b
left join tb_CylinderAndRaw b
on a . CylinderID = b . CylinderID and b . Time2 is null
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 . Station = dt1 . Rows [ i ] [ "StationNo" ] . ToString ( ) ;
model . BatchNo = batchNo ;
model . BatchNo = batchNo ;
model . Time1 = dt1 . Rows [ i ] [ "Time1" ] . ToString ( ) ;
model . Time1 = dt1 . Rows [ i ] [ "Time1" ] . ToString ( ) ;
model . Flag = dt1 . Rows [ i ] [ "Flag" ] . ToString ( ) ;
if ( dt2 ! = null & & dt2 . Rows . Count > 0 )
if ( dt2 ! = null & & dt2 . Rows . Count > 0 )
{
{
model . MaterialName = dt2 . Rows [ 0 ] [ "ProductName" ] . ToString ( ) ;
model . MaterialName = dt2 . Rows [ 0 ] [ "ProductName" ] . ToString ( ) ;
@ -71,6 +72,7 @@ public class Function
{
{
model . ProductName = dt_product . Rows [ 0 ] [ "Plan" ] . ToString ( ) ;
model . ProductName = dt_product . Rows [ 0 ] [ "Plan" ] . ToString ( ) ;
}
}
model . PartNo = partNo . Trim ( ) ;
list . Add ( model ) ;
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 ( ) ; ;
}
}
/// <summary>
/// <summary>
/// 根据注塑机查询计划要生产的产品信息
/// 根据注塑机查询计划要生产的产品信息
/// </summary>
/// </summary>
@ -524,40 +553,40 @@ public class Function
SELECT COUNT ( * ) AS c1 ,
SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 8 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 9 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 9 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 0 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 0 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 1 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 1 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 2 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 2 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 3 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 3 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 4 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 4 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 5 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 5 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 6 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 6 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 7 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 7 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 8 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 8 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 9 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 8 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION ALL SELECT COUNT ( * ) AS c1 ,
UNION ALL SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 1 9 AS h
( SELECT COUNT ( * ) FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 0 AS h
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # a WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 1 9 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
ORDER BY h asc ";
ORDER BY h asc ";
@ -579,40 +608,40 @@ public class Function
SELECT COUNT ( * ) AS c1 ,
SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 0 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 1 AS h
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 1 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 2 AS h
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 2 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 3 AS h
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 3 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 0 AS h
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 0 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 1 AS h
FROM # b WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 1 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 2 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 2 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 3 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 3 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 4 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 4 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 5 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 5 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 6 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 6 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 7 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 7 AS h
( SELECT COUNT ( * ) FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 8 AS h
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # b WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
";
";
}
}
@ -631,40 +660,40 @@ public class Function
SELECT COUNT ( * ) AS c1 ,
SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 0 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 1 AS h
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 0 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 1 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 2 AS h
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 1 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 2 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 3 AS h
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 2 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 2 3 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 0 AS h
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 0 0 : 0 0.000 ' ) ) AND DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 2 3 : 5 9 : 5 9.999 ' ) ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 0 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 1 AS h
FROM # c WHERE ( [ createTime ] BETWEEN DATEADD ( DAY , - 1 , CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 0 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 1 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 2 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 1 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 2 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 3 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 2 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 3 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 4 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 3 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 4 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 5 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 4 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 5 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 6 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 5 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 6 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 7 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 6 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
UNION all SELECT COUNT ( * ) AS c1 ,
UNION all SELECT COUNT ( * ) AS c1 ,
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 7 AS h
( SELECT COUNT ( * ) FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 槛 % ' ) c2 , 0 8 AS h
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
FROM # c WHERE ( [ createTime ] BETWEEN CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 0 0 : 0 0.000 ' ) AND CONVERT ( DATETIME , SUBSTRING ( CONVERT ( NVARCHAR ( 5 0 ) , GETDATE ( ) , 1 2 0 ) , 1 , 1 0 ) + ' 0 7 : 5 9 : 5 9.999 ' ) ) AND productInfo LIKE ' % 保 % '
";
";
}
}
@ -737,4 +766,46 @@ public class Function
return false ;
return false ;
}
}
}
}
/// <summary>
/// 计算时间差
/// </summary>
/// <param name="t">时间1</param>
/// <param name="t2">时间2</param>
/// <returns>返回值:时间差(毫秒为单位)</returns>
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 + = 2 4 ;
lReturn = hours * 3 6 0 0
+ minutes * 6 0
+ seconds ;
}
catch ( Exception ex )
{
LogHelper . WriteErrLogBase ( ex . ToString ( ) , MethodBase . GetCurrentMethod ( ) . Name ) ;
return 0 ;
}
return lReturn ;
}
}
}