37 lines
1.4 KiB
PHP
37 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace API;
|
|
|
|
trait tundishSample
|
|
{
|
|
public function getDataHeats($params)
|
|
{
|
|
$query = "SELECT distinct
|
|
[HEAT_NAME]
|
|
,convert(varchar, [OPEN_TIME], 104) +' '+convert(varchar, [OPEN_TIME], 108) as OPEN_TIME
|
|
,convert(varchar, [CLOSE_TIME], 104) +' '+convert(varchar, [CLOSE_TIME], 108) as CLOSE_TIME
|
|
FROM [Level3_KKC].[dbo].[HEAT_CCM1_L3]
|
|
-- left join [Pasport_CCM].[dbo].[OPC_T_Tundish_sample_VALUES] ts
|
|
-- on [OPEN_TIME]<=ts.datetime and CLOSE_TIME>=ts.datetime
|
|
where CAST([CLOSE_TIME] as DATE) between'".$params['dateStart']."' and '".$params['dateEnd']."'
|
|
order by [OPEN_TIME] desc, [CLOSE_TIME] desc";
|
|
select($query);
|
|
}
|
|
public function getDataValues($params)
|
|
{
|
|
|
|
$query = "SELECT distinct
|
|
[HEAT_NAME]
|
|
,[button_all]
|
|
,[opc_T_sample_value]
|
|
,[count]
|
|
,convert(varchar, [datetime], 104) +' '+convert(varchar, [datetime], 108) as [datetime]
|
|
FROM [Level3_KKC].[dbo].[HEAT_CCM1_L3] ccm
|
|
inner join [Pasport_CCM].[dbo].[OPC_T_Tundish_sample_VALUES] ts
|
|
on [OPEN_TIME]<=ts.datetime and CLOSE_TIME>=ts.datetime
|
|
where CAST([CLOSE_TIME] as DATE) between'".$params['dateStart']."' and '".$params['dateEnd']."'
|
|
order by [datetime] desc";
|
|
select($query);
|
|
}
|
|
}
|