SHARE
TWEET

Untitled

a guest Oct 24th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Запросы к ВЛ80Р
  2.  
  3. 1_______________TED1CollectorShortcutInTraction (Переброс по коллектору ТЭД1 в тяге)
  4. workmodeRecupPull = 0 И uivoltage = "не 0" И i1 > 50 И (dpc1 - vf) < 5 И i1 озрастает более чем на 150 за 1 секунду
  5.  
  6. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i1},{dpc1},{vf},
  7.     CASE
  8.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  9.         CAST({i1} AS FLOAT)>50.0 AND (CAST({dpc1} AS FLOAT)-CAST({vf} AS FLOAT))<5.0   THEN 1
  10.         ELSE 0
  11.     END
  12.         {rule_field}
  13. FROM (
  14. SELECT *,
  15.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  16. FROM (
  17. SELECT *,
  18.     CASE
  19.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i1} AS FLOAT)>50.0 AND
  20.         (CAST({dpc1} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i1} AS FLOAT)-lagi1)>150.0 THEN 1.0
  21.         ELSE 0.0
  22.     END
  23.         params_perform
  24. FROM (
  25. SELECT *,
  26.     LAG(CAST({i1} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi1
  27. FROM  {table})))
  28.  
  29.  
  30. 2_______________TED2CollectorShortcutInTraction (Переброс по коллектору ТЭД2 в тяге)
  31. workmodeRecupPull = 0 И uivoltage = "не 0" И i2 > 50 И (dpc2 - vf) < 5 И i2 озрастает более чем на 150 за 1 секунду
  32.  
  33. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i2},{dpc2},{vf},
  34.     CASE
  35.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  36.         CAST({i2} AS FLOAT)>50.0 AND (CAST({dpc2} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  37.         ELSE 0
  38.     END
  39.         {rule_field}
  40. FROM (
  41. SELECT *,
  42.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  43. FROM (
  44. SELECT *,
  45.     CASE
  46.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i2} AS FLOAT)>50.0 AND
  47.         (CAST({dpc2} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i2} AS FLOAT)-lagi2)>150.0 THEN 1.0
  48.         ELSE 0.0
  49.     END
  50.         params_perform
  51. FROM (
  52. SELECT *,
  53.     LAG(CAST({i2} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi2
  54. FROM  {table})))
  55.  
  56.  
  57. 3_______________TED3CollectorShortcutInTraction (Переброс по коллектору ТЭД3 в тяге)
  58. workmodeRecupPull = 0 И uivoltage = "не 0" И i3 > 50 И (dpc3 - vf) < 5 И i3 озрастает более чем на 150 за 1 секунду
  59.  
  60. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i3},{dpc3},{vf},
  61.     CASE
  62.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  63.         CAST({i3} AS FLOAT)>50.0 AND (CAST({dpc3} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  64.         ELSE 0
  65.     END
  66.         {rule_field}
  67. FROM (
  68. SELECT *,
  69.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  70. FROM (
  71. SELECT *,
  72.     CASE
  73.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i3} AS FLOAT)>50.0 AND
  74.         (CAST({dpc3} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i3} AS FLOAT)-lagi3)>150.0 THEN 1.0
  75.         ELSE 0.0
  76.     END
  77.         params_perform
  78. FROM (
  79. SELECT *,
  80.     LAG(CAST({i3} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi3
  81. FROM  {table})))
  82.  
  83.  
  84. 4_______________TED4CollectorShortcutInTraction (Переброс по коллектору ТЭД4 в тяге)
  85. workmodeRecupPull = 0 И uivoltage = "не 0" И i4 > 50 И (dpc4 - vf) < 5 И i4 озрастает более чем на 150 за 1 секунду
  86.  
  87. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i4},{dpc4},{vf},
  88.     CASE
  89.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  90.         CAST({i4} AS FLOAT)>50.0 AND (CAST({dpc4} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  91.         ELSE 0
  92.     END
  93.         {rule_field}
  94. FROM (
  95. SELECT *,
  96.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  97. FROM (
  98. SELECT *,
  99.     CASE
  100.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i4} AS FLOAT)>50.0 AND
  101.         (CAST({dpc4} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i4} AS FLOAT)-lagi4)>150.0 THEN 1.0
  102.         ELSE 0.0
  103.     END
  104.         params_perform
  105. FROM (
  106. SELECT *,
  107.     LAG(CAST({i4} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi4
  108. FROM  {table})))
  109.  
  110.  
  111. 5_______________TED5CollectorShortcutInTraction (Переброс по коллектору ТЭД5 в тяге)
  112. workmodeRecupPull = 0 И uivoltage = "не 0" И i5 > 50 И (dpc5 - vf) < 5 И i5 озрастает более чем на 150 за 1 секунду
  113.  
  114. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i5},{dpc5},{vf},
  115.     CASE
  116.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  117.         CAST({i5} AS FLOAT)>50.0 AND (CAST({dpc5} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  118.         ELSE 0
  119.     END
  120.         {rule_field}
  121. FROM (
  122. SELECT *,
  123.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  124. FROM (
  125. SELECT *,
  126.     CASE
  127.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i5} AS FLOAT)>50.0 AND
  128.         (CAST({dpc5} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i5} AS FLOAT)-lagi5)>150.0 THEN 1.0
  129.         ELSE 0.0
  130.     END
  131.         params_perform
  132. FROM (
  133. SELECT *,
  134.     LAG(CAST({i5} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi5
  135. FROM  {table})))
  136.  
  137.  
  138. 6_______________TED6CollectorShortcutInTraction (Переброс по коллектору ТЭД6 в тяге)
  139. workmodeRecupPull = 0 И uivoltage = "не 0" И i6 > 50 И (dpc6 - vf) < 5 И i6 озрастает более чем на 150 за 1 секунду
  140.  
  141. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i6},{dpc6},{vf},
  142.     CASE
  143.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  144.         CAST({i6} AS FLOAT)>50.0 AND (CAST({dpc6} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  145.         ELSE 0
  146.     END
  147.         {rule_field}
  148. FROM (
  149. SELECT *,
  150.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  151. FROM (
  152. SELECT *,
  153.     CASE
  154.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i6} AS FLOAT)>50.0 AND
  155.         (CAST({dpc6} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i6} AS FLOAT)-lagi6)>150.0 THEN 1.0
  156.         ELSE 0.0
  157.     END
  158.         params_perform
  159. FROM (
  160. SELECT *,
  161.     LAG(CAST({i6} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi6
  162. FROM  {table})))
  163.  
  164.  
  165. 7_______________TED7CollectorShortcutInTraction (Переброс по коллектору ТЭД7 в тяге)
  166. workmodeRecupPull = 0 И uivoltage = "не 0" И i7 > 50 И (dpc7 - vf) < 5 И i7 озрастает более чем на 150 за 1 секунду
  167.  
  168. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i7},{dpc7},{vf},
  169.     CASE
  170.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  171.         CAST({i7} AS FLOAT)>50.0 AND (CAST({dpc7} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  172.         ELSE 0
  173.     END
  174.         {rule_field}
  175. FROM (
  176. SELECT *,
  177.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  178. FROM (
  179. SELECT *,
  180.     CASE
  181.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i7} AS FLOAT)>50.0 AND
  182.         (CAST({dpc7} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i7} AS FLOAT)-lagi7)>150.0 THEN 1.0
  183.         ELSE 0.0
  184.     END
  185.         params_perform
  186. FROM (
  187. SELECT *,
  188.     LAG(CAST({i7} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi7
  189. FROM  {table})))
  190.  
  191.  
  192. 8_______________TED8CollectorShortcutInTraction (Переброс по коллектору ТЭД8 в тяге)
  193. workmodeRecupPull = 0 И uivoltage = "не 0" И i8 > 50 И (dpc8 - vf) < 5 И i8 озрастает более чем на 150 за 1 секунду
  194.  
  195. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i8},{dpc8},{vf},
  196.     CASE
  197.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  198.         CAST({i8} AS FLOAT)>50.0 AND (CAST({dpc8} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  199.         ELSE 0
  200.     END
  201.         {rule_field}
  202. FROM (
  203. SELECT *,
  204.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  205. FROM (
  206. SELECT *,
  207.     CASE
  208.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i8} AS FLOAT)>50.0 AND
  209.         (CAST({dpc8} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i8} AS FLOAT)-lagi8)>150.0 THEN 1.0
  210.         ELSE 0.0
  211.     END
  212.         params_perform
  213. FROM (
  214. SELECT *,
  215.     LAG(CAST({i8} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi8
  216. FROM  {table})))
  217.  
  218.  
  219. 9_______________TED9CollectorShortcutInTraction (Переброс по коллектору ТЭД9 в тяге)
  220. workmodeRecupPull = 0 И uivoltage = "не 0" И i9 > 50 И (dpc9 - vf) < 5 И i9 озрастает более чем на 150 за 1 секунду
  221.  
  222. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i9},{dpc9},{vf},
  223.     CASE
  224.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  225.         CAST({i9} AS FLOAT)>50.0 AND (CAST({dpc9} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  226.         ELSE 0
  227.     END
  228.         {rule_field}
  229. FROM (
  230. SELECT *,
  231.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  232. FROM (
  233. SELECT *,
  234.     CASE
  235.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i9} AS FLOAT)>50.0 AND
  236.         (CAST({dpc9} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i9} AS FLOAT)-lagi9)>150.0 THEN 1.0
  237.         ELSE 0.0
  238.     END
  239.         params_perform
  240. FROM (
  241. SELECT *,
  242.     LAG(CAST({i9} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi9
  243. FROM  {table})))
  244.  
  245.  
  246. 10_______________TED10CollectorShortcutInTraction (Переброс по коллектору ТЭД10 в тяге)
  247. workmodeRecupPull = 0 И uivoltage = "не 0" И i10 > 50 И (dpc10 - vf) < 5 И i10 озрастает более чем на 150 за 1 секунду
  248.  
  249. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i10},{dpc10},{vf},
  250.     CASE
  251.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  252.         CAST({i10} AS FLOAT)>50.0 AND (CAST({dpc10} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  253.         ELSE 0
  254.     END
  255.         {rule_field}
  256. FROM (
  257. SELECT *,
  258.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  259. FROM (
  260. SELECT *,
  261.     CASE
  262.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i10} AS FLOAT)>50.0 AND
  263.         (CAST({dpc10} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i10} AS FLOAT)-lagi10)>150.0 THEN 1.0
  264.         ELSE 0.0
  265.     END
  266.         params_perform
  267. FROM (
  268. SELECT *,
  269.     LAG(CAST({i10} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi10
  270. FROM  {table})))
  271.  
  272.  
  273. 11_______________TED11CollectorShortcutInTraction (Переброс по коллектору ТЭД11 в тяге)
  274. workmodeRecupPull = 0 И uivoltage = "не 0" И i11 > 50 И (dpc11 - vf) < 5 И i11 озрастает более чем на 150 за 1 секунду
  275.  
  276. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i11},{dpc11},{vf},
  277.     CASE
  278.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  279.         CAST({i11} AS FLOAT)>50.0 AND (CAST({dpc11} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  280.         ELSE 0
  281.     END
  282.         {rule_field}
  283. FROM (
  284. SELECT *,
  285.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  286. FROM (
  287. SELECT *,
  288.     CASE
  289.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i11} AS FLOAT)>50.0 AND
  290.         (CAST({dpc11} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i11} AS FLOAT)-lagi11)>150.0 THEN 1.0
  291.         ELSE 0.0
  292.     END
  293.         params_perform
  294. FROM (
  295. SELECT *,
  296.     LAG(CAST({i11} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi11
  297. FROM  {table})))
  298.  
  299.  
  300. 12_______________TED12CollectorShortcutInTraction (Переброс по коллектору ТЭД12 в тяге)
  301. workmodeRecupPull = 0 И uivoltage = "не 0" И i12 > 50 И (dpc12 - vf) < 5 И i12 озрастает более чем на 150 за 1 секунду
  302.  
  303. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i12},{dpc12},{vf},
  304.     CASE
  305.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  306.         CAST({i12} AS FLOAT)>50.0 AND (CAST({dpc12} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  307.         ELSE 0
  308.     END
  309.         {rule_field}
  310. FROM (
  311. SELECT *,
  312.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  313. FROM (
  314. SELECT *,
  315.     CASE
  316.         WHEN CAST({workmodeRecupPull} AS FLOAT)=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i12} AS FLOAT)>50.0 AND
  317.         (CAST({dpc12} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i12} AS FLOAT)-lagi12)>150.0 THEN 1.0
  318.         ELSE 0.0
  319.     END
  320.         params_perform
  321. FROM (
  322. SELECT *,
  323.     LAG(CAST({i12} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi12
  324. FROM  {table})))
  325.  
  326.  
  327. 13_______________VIPShortcutInRecuperationByTED1 (Пробой плеча ВИП в рекуперации по ТЭД1 (Секция 1))
  328. workmodeRecupPull = 1 И uivoltage = "не 0" И i1 > 50 И (dpc1 - vf) < 5 И i1 озрастает более чем на 150 за 1 секунду
  329.  
  330. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i1},{dpc1},{vf},
  331.     CASE
  332.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  333.         CAST({i1} AS FLOAT)>50.0 AND (CAST({dpc1} AS FLOAT)-CAST({vf} AS FLOAT))<5.0   THEN 1
  334.         ELSE 0
  335.     END
  336.         {rule_field}
  337. FROM (
  338. SELECT *,
  339.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  340. FROM (
  341. SELECT *,
  342.     CASE
  343.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i1} AS FLOAT)>50.0 AND
  344.         (CAST({dpc1} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i1} AS FLOAT)-lagi1)>150.0 THEN 1.0
  345.         ELSE 0.0
  346.     END
  347.         params_perform
  348. FROM (
  349. SELECT *,
  350.     LAG(CAST({i1} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi1
  351. FROM  {table})))
  352.  
  353.  
  354. 14_______________VIPShortcutInRecuperationByTED2 (Пробой плеча ВИП в рекуперации по ТЭД2 (Секция 1))
  355. workmodeRecupPull = 1 И uivoltage = "не 0" И i2 > 50 И (dpc2 - vf) < 5 И i2 озрастает более чем на 150 за 1 секунду
  356.  
  357. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i2},{dpc2},{vf},
  358.     CASE
  359.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  360.         CAST({i2} AS FLOAT)>50.0 AND (CAST({dpc2} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  361.         ELSE 0
  362.     END
  363.         {rule_field}
  364. FROM (
  365. SELECT *,
  366.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  367. FROM (
  368. SELECT *,
  369.     CASE
  370.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i2} AS FLOAT)>50.0 AND
  371.         (CAST({dpc2} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i2} AS FLOAT)-lagi2)>150.0 THEN 1.0
  372.         ELSE 0.0
  373.     END
  374.         params_perform
  375. FROM (
  376. SELECT *,
  377.     LAG(CAST({i2} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi2
  378. FROM  {table})))
  379.  
  380.  
  381. 15_______________VIPShortcutInRecuperationByTED3 (Пробой плеча ВИП в рекуперации по ТЭД3 (Секция 1))
  382. workmodeRecupPull = 1 И uivoltage = "не 0" И i3 > 50 И (dpc3 - vf) < 5 И i3 озрастает более чем на 150 за 1 секунду
  383.  
  384. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i3},{dpc3},{vf},
  385.     CASE
  386.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  387.         CAST({i3} AS FLOAT)>50.0 AND (CAST({dpc3} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  388.         ELSE 0
  389.     END
  390.         {rule_field}
  391. FROM (
  392. SELECT *,
  393.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  394. FROM (
  395. SELECT *,
  396.     CASE
  397.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i3} AS FLOAT)>50.0 AND
  398.         (CAST({dpc3} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i3} AS FLOAT)-lagi3)>150.0 THEN 1.0
  399.         ELSE 0.0
  400.     END
  401.         params_perform
  402. FROM (
  403. SELECT *,
  404.     LAG(CAST({i3} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi3
  405. FROM  {table})))
  406.  
  407.  
  408. 16_______________VIPShortcutInRecuperationByTED4 (Пробой плеча ВИП в рекуперации по ТЭД4 (Секция 1))
  409. workmodeRecupPull = 1 И uivoltage = "не 0" И i4 > 50 И (dpc4 - vf) < 5 И i4 озрастает более чем на 150 за 1 секунду
  410.  
  411. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i4},{dpc4},{vf},
  412.     CASE
  413.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  414.         CAST({i4} AS FLOAT)>50.0 AND (CAST({dpc4} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  415.         ELSE 0
  416.     END
  417.         {rule_field}
  418. FROM (
  419. SELECT *,
  420.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  421. FROM (
  422. SELECT *,
  423.     CASE
  424.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i4} AS FLOAT)>50.0 AND
  425.         (CAST({dpc4} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i4} AS FLOAT)-lagi4)>150.0 THEN 1.0
  426.         ELSE 0.0
  427.     END
  428.         params_perform
  429. FROM (
  430. SELECT *,
  431.     LAG(CAST({i4} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi4
  432. FROM  {table})))
  433.  
  434.  
  435. 17_______________VIPShortcutInRecuperationByTED5 (Пробой плеча ВИП в рекуперации по ТЭД5 (Секция 1))
  436. workmodeRecupPull = 1 И uivoltage = "не 0" И i5 > 50 И (dpc5 - vf) < 5 И i5 озрастает более чем на 150 за 1 секунду
  437.  
  438. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i5},{dpc5},{vf},
  439.     CASE
  440.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  441.         CAST({i5} AS FLOAT)>50.0 AND (CAST({dpc5} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  442.         ELSE 0
  443.     END
  444.         {rule_field}
  445. FROM (
  446. SELECT *,
  447.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  448. FROM (
  449. SELECT *,
  450.     CASE
  451.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i5} AS FLOAT)>50.0 AND
  452.         (CAST({dpc5} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i5} AS FLOAT)-lagi5)>150.0 THEN 1.0
  453.         ELSE 0.0
  454.     END
  455.         params_perform
  456. FROM (
  457. SELECT *,
  458.     LAG(CAST({i5} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi5
  459. FROM  {table})))
  460.  
  461.  
  462. 18_______________VIPShortcutInRecuperationByTED6 (Пробой плеча ВИП в рекуперации по ТЭД6 (Секция 1))
  463. workmodeRecupPull = 1 И uivoltage = "не 0" И i6 > 50 И (dpc6 - vf) < 5 И i6 озрастает более чем на 150 за 1 секунду
  464.  
  465. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i6},{dpc6},{vf},
  466.     CASE
  467.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  468.         CAST({i6} AS FLOAT)>50.0 AND (CAST({dpc6} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  469.         ELSE 0
  470.     END
  471.         {rule_field}
  472. FROM (
  473. SELECT *,
  474.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  475. FROM (
  476. SELECT *,
  477.     CASE
  478.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i6} AS FLOAT)>50.0 AND
  479.         (CAST({dpc6} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i6} AS FLOAT)-lagi6)>150.0 THEN 1.0
  480.         ELSE 0.0
  481.     END
  482.         params_perform
  483. FROM (
  484. SELECT *,
  485.     LAG(CAST({i6} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi6
  486. FROM  {table})))
  487.  
  488.  
  489. 19_______________VIPShortcutInRecuperationByTED7 (Пробой плеча ВИП в рекуперации по ТЭД7 (Секция 1))
  490. workmodeRecupPull = 1 И uivoltage = "не 0" И i7 > 50 И (dpc7 - vf) < 5 И i7 озрастает более чем на 150 за 1 секунду
  491.  
  492. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i7},{dpc7},{vf},
  493.     CASE
  494.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  495.         CAST({i7} AS FLOAT)>50.0 AND (CAST({dpc7} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  496.         ELSE 0
  497.     END
  498.         {rule_field}
  499. FROM (
  500. SELECT *,
  501.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  502. FROM (
  503. SELECT *,
  504.     CASE
  505.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i7} AS FLOAT)>50.0 AND
  506.         (CAST({dpc7} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i7} AS FLOAT)-lagi7)>150.0 THEN 1.0
  507.         ELSE 0.0
  508.     END
  509.         params_perform
  510. FROM (
  511. SELECT *,
  512.     LAG(CAST({i7} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi7
  513. FROM  {table})))
  514.  
  515.  
  516. 20_______________VIPShortcutInRecuperationByTED8 (Пробой плеча ВИП в рекуперации по ТЭД8 (Секция 1))
  517. workmodeRecupPull = 1 И uivoltage = "не 0" И i8 > 50 И (dpc8 - vf) < 5 И i8 озрастает более чем на 150 за 1 секунду
  518.  
  519. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i8},{dpc8},{vf},
  520.     CASE
  521.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  522.         CAST({i8} AS FLOAT)>50.0 AND (CAST({dpc8} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  523.         ELSE 0
  524.     END
  525.         {rule_field}
  526. FROM (
  527. SELECT *,
  528.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  529. FROM (
  530. SELECT *,
  531.     CASE
  532.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i8} AS FLOAT)>50.0 AND
  533.         (CAST({dpc8} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i8} AS FLOAT)-lagi8)>150.0 THEN 1.0
  534.         ELSE 0.0
  535.     END
  536.         params_perform
  537. FROM (
  538. SELECT *,
  539.     LAG(CAST({i8} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi8
  540. FROM  {table})))
  541.  
  542.  
  543. 21_______________VIPShortcutInRecuperationByTED9 (Пробой плеча ВИП в рекуперации по ТЭД9 (Секция 1))
  544. workmodeRecupPull = 1 И uivoltage = "не 0" И i9 > 50 И (dpc9 - vf) < 5 И i9 озрастает более чем на 150 за 1 секунду
  545.  
  546. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i9},{dpc9},{vf},
  547.     CASE
  548.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  549.         CAST({i9} AS FLOAT)>50.0 AND (CAST({dpc9} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  550.         ELSE 0
  551.     END
  552.         {rule_field}
  553. FROM (
  554. SELECT *,
  555.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  556. FROM (
  557. SELECT *,
  558.     CASE
  559.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i9} AS FLOAT)>50.0 AND
  560.         (CAST({dpc9} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i9} AS FLOAT)-lagi9)>150.0 THEN 1.0
  561.         ELSE 0.0
  562.     END
  563.         params_perform
  564. FROM (
  565. SELECT *,
  566.     LAG(CAST({i9} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi9
  567. FROM  {table})))
  568.  
  569.  
  570. 22_______________VIPShortcutInRecuperationByTED10 (Пробой плеча ВИП в рекуперации по ТЭД10 (Секция 1))
  571. workmodeRecupPull = 1 И uivoltage = "не 0" И i10 > 50 И (dpc10 - vf) < 5 И i10 озрастает более чем на 150 за 1 секунду
  572.  
  573. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i10},{dpc10},{vf},
  574.     CASE
  575.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  576.         CAST({i10} AS FLOAT)>50.0 AND (CAST({dpc10} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  577.         ELSE 0
  578.     END
  579.         {rule_field}
  580. FROM (
  581. SELECT *,
  582.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  583. FROM (
  584. SELECT *,
  585.     CASE
  586.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i10} AS FLOAT)>50.0 AND
  587.         (CAST({dpc10} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i10} AS FLOAT)-lagi10)>150.0 THEN 1.0
  588.         ELSE 0.0
  589.     END
  590.         params_perform
  591. FROM (
  592. SELECT *,
  593.     LAG(CAST({i10} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi10
  594. FROM  {table})))
  595.  
  596.  
  597. 23_______________VIPShortcutInRecuperationByTED11 (Пробой плеча ВИП в рекуперации по ТЭД11 (Секция 1))
  598. workmodeRecupPull = 1 И uivoltage = "не 0" И i11 > 50 И (dpc11 - vf) < 5 И i11 озрастает более чем на 150 за 1 секунду
  599.  
  600. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i11},{dpc11},{vf},
  601.     CASE
  602.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  603.         CAST({i11} AS FLOAT)>50.0 AND (CAST({dpc11} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  604.         ELSE 0
  605.     END
  606.         {rule_field}
  607. FROM (
  608. SELECT *,
  609.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  610. FROM (
  611. SELECT *,
  612.     CASE
  613.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i11} AS FLOAT)>50.0 AND
  614.         (CAST({dpc11} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i11} AS FLOAT)-lagi11)>150.0 THEN 1.0
  615.         ELSE 0.0
  616.     END
  617.         params_perform
  618. FROM (
  619. SELECT *,
  620.     LAG(CAST({i11} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi11
  621. FROM  {table})))
  622.  
  623.  
  624. 24_______________VIPShortcutInRecuperationByTED12 (Пробой плеча ВИП в рекуперации по ТЭД12 (Секция 1))
  625. workmodeRecupPull = 1 И uivoltage = "не 0" И i12 > 50 И (dpc12 - vf) < 5 И i12 озрастает более чем на 150 за 1 секунду
  626.  
  627. SELECT {select_fields},{workmodeRecupPull},{uivoltage},{i12},{dpc12},{vf},
  628.     CASE
  629.         WHEN max_params_perform=1.0 AND CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND
  630.         CAST({i12} AS FLOAT)>50.0 AND (CAST({dpc12} AS FLOAT)-CAST({vf} AS FLOAT))<5.0  THEN 1
  631.         ELSE 0
  632.     END
  633.         {rule_field}
  634. FROM (
  635. SELECT *,
  636.     MAX(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) AS max_params_perform
  637. FROM (
  638. SELECT *,
  639.     CASE
  640.         WHEN CAST({workmodeRecupPull} AS FLOAT)=1.0 AND CAST({uivoltage} AS FLOAT)!=0.0 AND CAST({i12} AS FLOAT)>50.0 AND
  641.         (CAST({dpc12} AS FLOAT)-CAST({vf} AS FLOAT))<5.0 AND (CAST({i12} AS FLOAT)-lagi12)>150.0 THEN 1.0
  642.         ELSE 0.0
  643.     END
  644.         params_perform
  645. FROM (
  646. SELECT *,
  647.     LAG(CAST({i12} AS FLOAT)) OVER (ORDER BY {datetime}) AS lagi12
  648. FROM  {table})))
  649.  
  650.  
  651.  
  652. ----25_______________RecupCurrentDispExcTED1-Sec1 (Превышение допустимого разброса токов ТЭД в рекуперации (по ТЭД1) (секция 1))
  653. 1. iavr = (i1 + i2 + i3 + i4) / 4
  654. 2. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  655. 2. workmodeRecupPull = "не 0" И i1 > 50 И i2 > 50 И i3 > 50 И i4 > 50 И
  656. dpc1 > 5 И  dpc2 > 5 И  dpc3 > 5 И dpc4 > 5 И (|dpc1 - dpcavr| / dpc1) < 0,12 И (|iavr - i1| / iavr) > 0,2
  657.  
  658. SELECT {select_fields},{workmodeRecupPull},{i1},{i2},{i3},{i4},{dpc1},{dpc2},{dpc3},{dpc4},
  659.     CASE
  660.         WHEN CAST({workmodeRecupPull} AS FLOAT)!=0.0 AND CAST({i1} AS FLOAT)>50.0 AND CAST({i2} AS FLOAT)>50.0 AND
  661.         CAST({i3} AS FLOAT)>50.0 AND CAST({i4} AS FLOAT)>50.0 AND CAST({dpc1} AS FLOAT)>5.0 AND
  662.         CAST({dpc2} AS FLOAT)>5.0 AND CAST({dpc3} AS FLOAT)>5.0 AND CAST({dpc4} AS FLOAT)>5.0 AND
  663.         (ABS(CAST({dpc1} AS FLOAT) - dpcavr) / CAST({dpc1} AS FLOAT)) > 0.12 AND
  664.         (ABS(CAST({i1} AS FLOAT) - iavr) / iavr) > 0.2
  665.         THEN 1
  666.         ELSE 0
  667.     END
  668.         {rule_field}
  669. FROM (
  670. SELECT *,
  671.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr,
  672.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr
  673. FROM  {table})
  674.  
  675.  
  676.  
  677. 49_______________CurrentSensorMeltdownTED1Section1 (Неисправность датчика тока ТЭД1 (секция 1))
  678. i1 = 0 И dpc1 > 5 И bpros1defendTD1 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  679.  
  680. SELECT {select_fields},{i1},{dpc1},{bpros1defendTD1},{W},{uivoltage},
  681. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  682. FROM (
  683. SELECT *,
  684.   CASE
  685.         WHEN sum_params_perform=4.0 THEN 1
  686.         ELSE 0
  687.     END
  688.         rule
  689. FROM (
  690. SELECT *,
  691.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  692. FROM (
  693. SELECT *,
  694.     CASE
  695.         WHEN CAST({i1} AS FLOAT)=0.0 AND CAST({dpc1} AS FLOAT)>5.0 AND CAST({bpros1defendTD1} AS FLOAT)=0.0 AND
  696.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  697.         ELSE 0.0
  698.     END
  699.         params_perform
  700. FROM  {table})))
  701.  
  702.  
  703. 50_______________CurrentSensorMeltdownTED2Section1 (Неисправность датчика тока ТЭД2 (секция 1))
  704. i2 = 0 И dpc2 > 5 И bpros1defendTD2 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  705.  
  706. SELECT {select_fields},{i2},{dpc2},{bpros1defendTD2},{W},{uivoltage},
  707. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  708. FROM (
  709. SELECT *,
  710.   CASE
  711.         WHEN sum_params_perform=4.0 THEN 1
  712.         ELSE 0
  713.     END
  714.         rule
  715. FROM (
  716. SELECT *,
  717.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  718. FROM (
  719. SELECT *,
  720.     CASE
  721.         WHEN CAST({i2} AS FLOAT)=0.0 AND CAST({dpc2} AS FLOAT)>5.0 AND CAST({bpros1defendTD2} AS FLOAT)=0.0 AND
  722.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  723.         ELSE 0.0
  724.     END
  725.         params_perform
  726. FROM  {table})))
  727.  
  728.  
  729. 51_______________CurrentSensorMeltdownTED3Section1 (Неисправность датчика тока ТЭД3 (секция 1))
  730. i3 = 0 И dpc3 > 5 И bpros1defendTD3 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  731.  
  732. SELECT {select_fields},{i3},{dpc3},{bpros1defendTD3},{W},{uivoltage},
  733. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  734. FROM (
  735. SELECT *,
  736.   CASE
  737.         WHEN sum_params_perform=4.0 THEN 1
  738.         ELSE 0
  739.     END
  740.         rule
  741. FROM (
  742. SELECT *,
  743.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  744. FROM (
  745. SELECT *,
  746.     CASE
  747.         WHEN CAST({i3} AS FLOAT)=0.0 AND CAST({dpc3} AS FLOAT)>5.0 AND CAST({bpros1defendTD3} AS FLOAT)=0.0 AND
  748.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  749.         ELSE 0.0
  750.     END
  751.         params_perform
  752. FROM  {table})))
  753.  
  754.  
  755. 52_______________CurrentSensorMeltdownTED4Section1 (Неисправность датчика тока ТЭД4 (секция 1))
  756. i4 = 0 И dpc4 > 5 И bpros1defendTD4 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  757.  
  758. SELECT {select_fields},{i4},{dpc4},{bpros1defendTD4},{W},{uivoltage},
  759. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  760. FROM (
  761. SELECT *,
  762.   CASE
  763.         WHEN sum_params_perform=4.0 THEN 1
  764.         ELSE 0
  765.     END
  766.         rule
  767. FROM (
  768. SELECT *,
  769.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  770. FROM (
  771. SELECT *,
  772.     CASE
  773.         WHEN CAST({i4} AS FLOAT)=0.0 AND CAST({dpc4} AS FLOAT)>5.0 AND CAST({bpros1defendTD4} AS FLOAT)=0.0 AND
  774.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  775.         ELSE 0.0
  776.     END
  777.         params_perform
  778. FROM  {table})))
  779.  
  780.  
  781. 53_______________CurrentSensorMeltdownTED5Section2 (Неисправность датчика тока ТЭД5 (секция 2))
  782. i5 = 0 И dpc5 > 5 И bpros1defendTD5 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  783.  
  784. SELECT {select_fields},{i5},{dpc5},{bpros1defendTD5},{W},{uivoltage},
  785. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  786. FROM (
  787. SELECT *,
  788.   CASE
  789.         WHEN sum_params_perform=4.0 THEN 1
  790.         ELSE 0
  791.     END
  792.         rule
  793. FROM (
  794. SELECT *,
  795.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  796. FROM (
  797. SELECT *,
  798.     CASE
  799.         WHEN CAST({i5} AS FLOAT)=0.0 AND CAST({dpc5} AS FLOAT)>5.0 AND CAST({bpros1defendTD5} AS FLOAT)=0.0 AND
  800.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  801.         ELSE 0.0
  802.     END
  803.         params_perform
  804. FROM  {table})))
  805.  
  806.  
  807. 54_______________CurrentSensorMeltdownTED6Section2 (Неисправность датчика тока ТЭД6 (секция 2))
  808. i6 = 0 И dpc6 > 5 И bpros1defendTD6 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  809.  
  810. SELECT {select_fields},{i6},{dpc6},{bpros1defendTD6},{W},{uivoltage},
  811. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  812. FROM (
  813. SELECT *,
  814.   CASE
  815.         WHEN sum_params_perform=4.0 THEN 1
  816.         ELSE 0
  817.     END
  818.         rule
  819. FROM (
  820. SELECT *,
  821.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  822. FROM (
  823. SELECT *,
  824.     CASE
  825.         WHEN CAST({i6} AS FLOAT)=0.0 AND CAST({dpc6} AS FLOAT)>5.0 AND CAST({bpros1defendTD6} AS FLOAT)=0.0 AND
  826.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  827.         ELSE 0.0
  828.     END
  829.         params_perform
  830. FROM  {table})))
  831.  
  832.  
  833. 55_______________CurrentSensorMeltdownTED7Section2 (Неисправность датчика тока ТЭД7 (секция 2))
  834. i7 = 0 И dpc7 > 5 И bpros1defendTD7 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  835.  
  836. SELECT {select_fields},{i7},{dpc7},{bpros1defendTD7},{W},{uivoltage},
  837. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  838. FROM (
  839. SELECT *,
  840.   CASE
  841.         WHEN sum_params_perform=4.0 THEN 1
  842.         ELSE 0
  843.     END
  844.         rule
  845. FROM (
  846. SELECT *,
  847.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  848. FROM (
  849. SELECT *,
  850.     CASE
  851.         WHEN CAST({i7} AS FLOAT)=0.0 AND CAST({dpc7} AS FLOAT)>5.0 AND CAST({bpros1defendTD7} AS FLOAT)=0.0 AND
  852.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  853.         ELSE 0.0
  854.     END
  855.         params_perform
  856. FROM  {table})))
  857.  
  858.  
  859. 56_______________CurrentSensorMeltdownTED8Section2 (Неисправность датчика тока ТЭД8 (секция 2))
  860. i8 = 0 И dpc8 > 5 И bpros1defendTD8 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  861.  
  862. SELECT {select_fields},{i8},{dpc8},{bpros1defendTD8},{W},{uivoltage},
  863. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  864. FROM (
  865. SELECT *,
  866.   CASE
  867.         WHEN sum_params_perform=4.0 THEN 1
  868.         ELSE 0
  869.     END
  870.         rule
  871. FROM (
  872. SELECT *,
  873.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  874. FROM (
  875. SELECT *,
  876.     CASE
  877.         WHEN CAST({i8} AS FLOAT)=0.0 AND CAST({dpc8} AS FLOAT)>5.0 AND CAST({bpros1defendTD8} AS FLOAT)=0.0 AND
  878.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  879.         ELSE 0.0
  880.     END
  881.         params_perform
  882. FROM  {table})))
  883.  
  884.  
  885. 57_______________CurrentSensorMeltdownTED9Section3 (Неисправность датчика тока ТЭД9 (секция 3))
  886. i9 = 0 И dpc9 > 5 И bpros1defendTD9 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  887.  
  888. SELECT {select_fields},{i9},{dpc9},{bpros1defendTD9},{W},{uivoltage},
  889. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  890. FROM (
  891. SELECT *,
  892.   CASE
  893.         WHEN sum_params_perform=4.0 THEN 1
  894.         ELSE 0
  895.     END
  896.         rule
  897. FROM (
  898. SELECT *,
  899.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  900. FROM (
  901. SELECT *,
  902.     CASE
  903.         WHEN CAST({i9} AS FLOAT)=0.0 AND CAST({dpc9} AS FLOAT)>5.0 AND CAST({bpros1defendTD9} AS FLOAT)=0.0 AND
  904.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  905.         ELSE 0.0
  906.     END
  907.         params_perform
  908. FROM  {table})))
  909.  
  910.  
  911. 58_______________CurrentSensorMeltdownTED10Section3 (Неисправность датчика тока ТЭД10 (секция 3))
  912. i10 = 0 И dpc10 > 5 И bpros1defendTD10 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  913.  
  914. SELECT {select_fields},{i10},{dpc10},{bpros1defendTD10},{W},{uivoltage},
  915. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  916. FROM (
  917. SELECT *,
  918.   CASE
  919.         WHEN sum_params_perform=4.0 THEN 1
  920.         ELSE 0
  921.     END
  922.         rule
  923. FROM (
  924. SELECT *,
  925.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  926. FROM (
  927. SELECT *,
  928.     CASE
  929.         WHEN CAST({i10} AS FLOAT)=0.0 AND CAST({dpc10} AS FLOAT)>5.0 AND CAST({bpros1defendTD10} AS FLOAT)=0.0 AND
  930.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  931.         ELSE 0.0
  932.     END
  933.         params_perform
  934. FROM  {table})))
  935.  
  936.  
  937. 59_______________CurrentSensorMeltdownTED11Section3 (Неисправность датчика тока ТЭД11 (секция 3))
  938. i11 = 0 И dpc11 > 5 И bpros1defendTD11 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  939.  
  940. SELECT {select_fields},{i11},{dpc11},{bpros1defendTD11},{W},{uivoltage},
  941. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  942. FROM (
  943. SELECT *,
  944.   CASE
  945.         WHEN sum_params_perform=4.0 THEN 1
  946.         ELSE 0
  947.     END
  948.         rule
  949. FROM (
  950. SELECT *,
  951.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  952. FROM (
  953. SELECT *,
  954.     CASE
  955.         WHEN CAST({i11} AS FLOAT)=0.0 AND CAST({dpc11} AS FLOAT)>5.0 AND CAST({bpros1defendTD11} AS FLOAT)=0.0 AND
  956.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  957.         ELSE 0.0
  958.     END
  959.         params_perform
  960. FROM  {table})))
  961.  
  962.  
  963. 60_______________CurrentSensorMeltdownTED12Section3 (Неисправность датчика тока ТЭД12 (секция 3))
  964. i12 = 0 И dpc12 > 5 И bpros1defendTD12 = 0 И W = "не 0" И uivoltage = "не 0" более 3 секунд
  965.  
  966. SELECT {select_fields},{i12},{dpc12},{bpros1defendTD12},{W},{uivoltage},
  967. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  968. FROM (
  969. SELECT *,
  970.   CASE
  971.         WHEN sum_params_perform=4.0 THEN 1
  972.         ELSE 0
  973.     END
  974.         rule
  975. FROM (
  976. SELECT *,
  977.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  978. FROM (
  979. SELECT *,
  980.     CASE
  981.         WHEN CAST({i12} AS FLOAT)=0.0 AND CAST({dpc12} AS FLOAT)>5.0 AND CAST({bpros1defendTD12} AS FLOAT)=0.0 AND
  982.         CAST({W} AS FLOAT)!=0.0 AND CAST({uivoltage} AS FLOAT)!=0.0 THEN 1.0
  983.         ELSE 0.0
  984.     END
  985.         params_perform
  986. FROM  {table})))
  987.  
  988.  
  989. 64_______________WP1SpeedSensorFailSection1 (Неисправность датчика скорости КП1 (секция 1))
  990. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  991. 2. iavr = (i1 + i2 + i3 + i4) / 4
  992. 3. bpros1defendTD1 = 0 И bpros1defendTD2 = 0 И bpros1defendTD3 = 0 И bpros1defendTD4 = 0 И bpros1defendVIP61 = 0 И
  993. bpros1defendVIP62 = 0 И (dpcavr - dpc1) > 2 И (i1 - iavr) < 75 более 3 секунд
  994.  
  995. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros1defendTD1},{bpros1defendTD2},
  996.     {bpros1defendTD3},{bpros1defendTD4},{bpros1defendVIP61},{bpros1defendVIP62},
  997. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  998. FROM (
  999. SELECT *,
  1000.   CASE
  1001.         WHEN sum_params_perform=4.0 THEN 1
  1002.         ELSE 0
  1003.     END
  1004.         rule
  1005. FROM (
  1006. SELECT *,
  1007.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1008. FROM (
  1009. SELECT *,
  1010.     CASE
  1011.         WHEN CAST({bpros1defendTD1} AS FLOAT)=0.0 AND CAST({bpros1defendTD2} AS FLOAT)=0.0 AND CAST({bpros1defendTD3} AS FLOAT)=0.0 AND
  1012.         CAST({bpros1defendTD4} AS FLOAT)=0.0 AND CAST({bpros1defendVIP61} AS FLOAT)=0.0 AND CAST({bpros1defendVIP62} AS FLOAT)=0.0 AND
  1013.         (dpcavr - CAST({dpc1} AS FLOAT))>2.0 AND (CAST({i1} AS FLOAT)-iavr)<75.0 THEN 1.0
  1014.         ELSE 0.0
  1015.     END
  1016.         params_perform
  1017. FROM (
  1018. SELECT *,
  1019.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1020.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1021. FROM  {table}))))
  1022.  
  1023.  
  1024.  
  1025. 65_______________WP2SpeedSensorFailSection1 (Неисправность датчика скорости КП2 (секция 1))
  1026.  
  1027. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1028. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1029. 3. bpros1defendTD1 = 0 И bpros1defendTD2 = 0 И bpros1defendTD3 = 0 И bpros1defendTD4 = 0 И bpros1defendVIP61 = 0 И
  1030. bpros1defendVIP62 = 0 И (dpcavr - dpc2) > 2 И (i2 - iavr) < 75 более 3 секунд
  1031.  
  1032. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros1defendTD1},{bpros1defendTD2},
  1033.     {bpros1defendTD3},{bpros1defendTD4},{bpros1defendVIP61},{bpros1defendVIP62},
  1034. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1035. FROM (
  1036. SELECT *,
  1037.   CASE
  1038.         WHEN sum_params_perform=4.0 THEN 1
  1039.         ELSE 0
  1040.     END
  1041.         rule
  1042. FROM (
  1043. SELECT *,
  1044.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1045. FROM (
  1046. SELECT *,
  1047.     CASE
  1048.         WHEN CAST({bpros1defendTD1} AS FLOAT)=0.0 AND CAST({bpros1defendTD2} AS FLOAT)=0.0 AND CAST({bpros1defendTD3} AS FLOAT)=0.0 AND
  1049.         CAST({bpros1defendTD4} AS FLOAT)=0.0 AND CAST({bpros1defendVIP61} AS FLOAT)=0.0 AND CAST({bpros1defendVIP62} AS FLOAT)=0.0 AND
  1050.         (dpcavr - CAST({dpc2} AS FLOAT))>2.0 AND (CAST({i2} AS FLOAT)-iavr)<75.0 THEN 1.0
  1051.         ELSE 0.0
  1052.     END
  1053.         params_perform
  1054. FROM (
  1055. SELECT *,
  1056.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1057.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1058. FROM  {table}))))
  1059.  
  1060.  
  1061.  
  1062. 66_______________WP3SpeedSensorFailSection1 (Неисправность датчика скорости КП3 (секция 1))
  1063.  
  1064. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1065. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1066. 3. bpros1defendTD1 = 0 И bpros1defendTD2 = 0 И bpros1defendTD3 = 0 И bpros1defendTD4 = 0 И bpros1defendVIP61 = 0 И
  1067. bpros1defendVIP62 = 0 И (dpcavr - dpc3) > 2 И (i3 - iavr) < 75 более 3 секунд
  1068.  
  1069. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros1defendTD1},{bpros1defendTD2},
  1070.     {bpros1defendTD3},{bpros1defendTD4},{bpros1defendVIP61},{bpros1defendVIP62},
  1071. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1072. FROM (
  1073. SELECT *,
  1074.   CASE
  1075.         WHEN sum_params_perform=4.0 THEN 1
  1076.         ELSE 0
  1077.     END
  1078.         rule
  1079. FROM (
  1080. SELECT *,
  1081.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1082. FROM (
  1083. SELECT *,
  1084.     CASE
  1085.         WHEN CAST({bpros1defendTD1} AS FLOAT)=0.0 AND CAST({bpros1defendTD2} AS FLOAT)=0.0 AND CAST({bpros1defendTD3} AS FLOAT)=0.0 AND
  1086.         CAST({bpros1defendTD4} AS FLOAT)=0.0 AND CAST({bpros1defendVIP61} AS FLOAT)=0.0 AND CAST({bpros1defendVIP62} AS FLOAT)=0.0 AND
  1087.         (dpcavr - CAST({dpc3} AS FLOAT))>2.0 AND (CAST({i3} AS FLOAT)-iavr)<75.0 THEN 1.0
  1088.         ELSE 0.0
  1089.     END
  1090.         params_perform
  1091. FROM (
  1092. SELECT *,
  1093.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1094.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1095. FROM  {table}))))
  1096.  
  1097.  
  1098.  
  1099. 67_______________WP4SpeedSensorFailSection1 (Неисправность датчика скорости КП4 (секция 1))
  1100.  
  1101. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1102. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1103. 3. bpros1defendTD1 = 0 И bpros1defendTD2 = 0 И bpros1defendTD3 = 0 И bpros1defendTD4 = 0 И bpros1defendVIP61 = 0 И
  1104. bpros1defendVIP62 = 0 И (dpcavr - dpc4) > 2 И (i4 - iavr) < 75 более 3 секунд
  1105.  
  1106. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros1defendTD1},{bpros1defendTD2},
  1107.     {bpros1defendTD3},{bpros1defendTD4},{bpros1defendVIP61},{bpros1defendVIP62},
  1108. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1109. FROM (
  1110. SELECT *,
  1111.   CASE
  1112.         WHEN sum_params_perform=4.0 THEN 1
  1113.         ELSE 0
  1114.     END
  1115.         rule
  1116. FROM (
  1117. SELECT *,
  1118.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1119. FROM (
  1120. SELECT *,
  1121.     CASE
  1122.         WHEN CAST({bpros1defendTD1} AS FLOAT)=0.0 AND CAST({bpros1defendTD2} AS FLOAT)=0.0 AND CAST({bpros1defendTD3} AS FLOAT)=0.0 AND
  1123.         CAST({bpros1defendTD4} AS FLOAT)=0.0 AND CAST({bpros1defendVIP61} AS FLOAT)=0.0 AND CAST({bpros1defendVIP62} AS FLOAT)=0.0 AND
  1124.         (dpcavr - CAST({dpc4} AS FLOAT))>2.0 AND (CAST({i4} AS FLOAT)-iavr)<75.0 THEN 1.0
  1125.         ELSE 0.0
  1126.     END
  1127.         params_perform
  1128. FROM (
  1129. SELECT *,
  1130.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1131.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1132. FROM  {table}))))
  1133.  
  1134.  
  1135.  
  1136. 68_______________WP5SpeedSensorFailSection2 (Неисправность датчика скорости КП5 (секция 2))
  1137. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1138. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1139. 3. bpros2defendTD1 = 0 И bpros2defendTD2 = 0 И bpros2defendTD3 = 0 И bpros2defendTD4 = 0 И bpros2defendVIP61 = 0 И
  1140. bpros2defendVIP62 = 0 И (dpcavr - dpc1) > 2 И (i1 - iavr) < 75 более 3 секунд
  1141.  
  1142. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros2defendTD1},{bpros2defendTD2},
  1143.     {bpros2defendTD3},{bpros2defendTD4},{bpros2defendVIP61},{bpros2defendVIP62},
  1144. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1145. FROM (
  1146. SELECT *,
  1147.   CASE
  1148.         WHEN sum_params_perform=4.0 THEN 1
  1149.         ELSE 0
  1150.     END
  1151.         rule
  1152. FROM (
  1153. SELECT *,
  1154.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1155. FROM (
  1156. SELECT *,
  1157.     CASE
  1158.         WHEN CAST({bpros2defendTD1} AS FLOAT)=0.0 AND CAST({bpros2defendTD2} AS FLOAT)=0.0 AND CAST({bpros2defendTD3} AS FLOAT)=0.0 AND
  1159.         CAST({bpros2defendTD4} AS FLOAT)=0.0 AND CAST({bpros2defendVIP61} AS FLOAT)=0.0 AND CAST({bpros2defendVIP62} AS FLOAT)=0.0 AND
  1160.         (dpcavr - CAST({dpc1} AS FLOAT))>2.0 AND (CAST({i1} AS FLOAT)-iavr)<75.0 THEN 1.0
  1161.         ELSE 0.0
  1162.     END
  1163.         params_perform
  1164. FROM (
  1165. SELECT *,
  1166.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1167.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1168. FROM  {table}))))
  1169.  
  1170.  
  1171.  
  1172. 69_______________WP6SpeedSensorFailSection2 (Неисправность датчика скорости КП6 (секция 2))
  1173. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1174. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1175. 3. bpros2defendTD1 = 0 И bpros2defendTD2 = 0 И bpros2defendTD3 = 0 И bpros2defendTD4 = 0 И bpros2defendVIP61 = 0 И
  1176. bpros2defendVIP62 = 0 И (dpcavr - dpc2) > 2 И (i2 - iavr) < 75 более 3 секунд
  1177.  
  1178. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros2defendTD1},{bpros2defendTD2},
  1179.     {bpros2defendTD3},{bpros2defendTD4},{bpros2defendVIP61},{bpros2defendVIP62},
  1180. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1181. FROM (
  1182. SELECT *,
  1183.   CASE
  1184.         WHEN sum_params_perform=4.0 THEN 1
  1185.         ELSE 0
  1186.     END
  1187.         rule
  1188. FROM (
  1189. SELECT *,
  1190.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1191. FROM (
  1192. SELECT *,
  1193.     CASE
  1194.         WHEN CAST({bpros2defendTD1} AS FLOAT)=0.0 AND CAST({bpros2defendTD2} AS FLOAT)=0.0 AND CAST({bpros2defendTD3} AS FLOAT)=0.0 AND
  1195.         CAST({bpros2defendTD4} AS FLOAT)=0.0 AND CAST({bpros2defendVIP61} AS FLOAT)=0.0 AND CAST({bpros2defendVIP62} AS FLOAT)=0.0 AND
  1196.         (dpcavr - CAST({dpc2} AS FLOAT))>2.0 AND (CAST({i2} AS FLOAT)-iavr)<75.0 THEN 1.0
  1197.         ELSE 0.0
  1198.     END
  1199.         params_perform
  1200. FROM (
  1201. SELECT *,
  1202.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1203.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1204. FROM  {table}))))
  1205.  
  1206.  
  1207.  
  1208. 70_______________WP7SpeedSensorFailSection2 (Неисправность датчика скорости КП7 (секция 2))
  1209. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1210. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1211. 3. bpros2defendTD1 = 0 И bpros2defendTD2 = 0 И bpros2defendTD3 = 0 И bpros2defendTD4 = 0 И bpros2defendVIP61 = 0 И
  1212. bpros2defendVIP62 = 0 И (dpcavr - dpc3) > 2 И (i3 - iavr) < 75 более 3 секунд
  1213.  
  1214. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros2defendTD1},{bpros2defendTD2},
  1215.     {bpros2defendTD3},{bpros2defendTD4},{bpros2defendVIP61},{bpros2defendVIP62},
  1216. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1217. FROM (
  1218. SELECT *,
  1219.   CASE
  1220.         WHEN sum_params_perform=4.0 THEN 1
  1221.         ELSE 0
  1222.     END
  1223.         rule
  1224. FROM (
  1225. SELECT *,
  1226.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1227. FROM (
  1228. SELECT *,
  1229.     CASE
  1230.         WHEN CAST({bpros2defendTD1} AS FLOAT)=0.0 AND CAST({bpros2defendTD2} AS FLOAT)=0.0 AND CAST({bpros2defendTD3} AS FLOAT)=0.0 AND
  1231.         CAST({bpros2defendTD4} AS FLOAT)=0.0 AND CAST({bpros2defendVIP61} AS FLOAT)=0.0 AND CAST({bpros2defendVIP62} AS FLOAT)=0.0 AND
  1232.         (dpcavr - CAST({dpc3} AS FLOAT))>2.0 AND (CAST({i3} AS FLOAT)-iavr)<75.0 THEN 1.0
  1233.         ELSE 0.0
  1234.     END
  1235.         params_perform
  1236. FROM (
  1237. SELECT *,
  1238.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1239.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1240. FROM  {table}))))
  1241.  
  1242.  
  1243.  
  1244. 71_______________WP8SpeedSensorFailSection2 (Неисправность датчика скорости КП8 (секция 2))
  1245. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1246. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1247. 3. bpros2defendTD1 = 0 И bpros2defendTD2 = 0 И bpros2defendTD3 = 0 И bpros2defendTD4 = 0 И bpros2defendVIP61 = 0 И
  1248. bpros2defendVIP62 = 0 И (dpcavr - dpc4) > 2 И (i4 - iavr) < 75 более 3 секунд
  1249.  
  1250. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros2defendTD1},{bpros2defendTD2},
  1251.     {bpros2defendTD3},{bpros2defendTD4},{bpros2defendVIP61},{bpros2defendVIP62},
  1252. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1253. FROM (
  1254. SELECT *,
  1255.   CASE
  1256.         WHEN sum_params_perform=4.0 THEN 1
  1257.         ELSE 0
  1258.     END
  1259.         rule
  1260. FROM (
  1261. SELECT *,
  1262.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1263. FROM (
  1264. SELECT *,
  1265.     CASE
  1266.         WHEN CAST({bpros2defendTD1} AS FLOAT)=0.0 AND CAST({bpros2defendTD2} AS FLOAT)=0.0 AND CAST({bpros2defendTD3} AS FLOAT)=0.0 AND
  1267.         CAST({bpros2defendTD4} AS FLOAT)=0.0 AND CAST({bpros2defendVIP61} AS FLOAT)=0.0 AND CAST({bpros2defendVIP62} AS FLOAT)=0.0 AND
  1268.         (dpcavr - CAST({dpc4} AS FLOAT))>2.0 AND (CAST({i4} AS FLOAT)-iavr)<75.0 THEN 1.0
  1269.         ELSE 0.0
  1270.     END
  1271.         params_perform
  1272. FROM (
  1273. SELECT *,
  1274.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1275.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1276. FROM  {table}))))
  1277.  
  1278.  
  1279. 72_______________WP9SpeedSensorFailSection3 (Неисправность датчика скорости КП9 (секция 3))
  1280. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1281. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1282. 3. bpros3defendTD1 = 0 И bpros3defendTD2 = 0 И bpros3defendTD3 = 0 И bpros3defendTD4 = 0 И bpros3defendVIP61 = 0 И
  1283. bpros3defendVIP62 = 0 И (dpcavr - dpc1) > 2 И (i1 - iavr) < 75 более 3 секунд
  1284.  
  1285. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros3defendTD1},{bpros3defendTD2},
  1286.     {bpros3defendTD3},{bpros3defendTD4},{bpros3defendVIP61},{bpros3defendVIP62},
  1287. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1288. FROM (
  1289. SELECT *,
  1290.   CASE
  1291.         WHEN sum_params_perform=4.0 THEN 1
  1292.         ELSE 0
  1293.     END
  1294.         rule
  1295. FROM (
  1296. SELECT *,
  1297.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1298. FROM (
  1299. SELECT *,
  1300.     CASE
  1301.         WHEN CAST({bpros3defendTD1} AS FLOAT)=0.0 AND CAST({bpros3defendTD2} AS FLOAT)=0.0 AND CAST({bpros3defendTD3} AS FLOAT)=0.0 AND
  1302.         CAST({bpros3defendTD4} AS FLOAT)=0.0 AND CAST({bpros3defendVIP61} AS FLOAT)=0.0 AND CAST({bpros3defendVIP62} AS FLOAT)=0.0 AND
  1303.         (dpcavr - CAST({dpc1} AS FLOAT))>2.0 AND (CAST({i1} AS FLOAT)-iavr)<75.0 THEN 1.0
  1304.         ELSE 0.0
  1305.     END
  1306.         params_perform
  1307. FROM (
  1308. SELECT *,
  1309.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1310.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1311. FROM  {table}))))
  1312.  
  1313.  
  1314.  
  1315. 73_______________WP10SpeedSensorFailSection3 (Неисправность датчика скорости КП10 (секция 3))
  1316. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1317. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1318. 3. bpros3defendTD1 = 0 И bpros3defendTD2 = 0 И bpros3defendTD3 = 0 И bpros3defendTD4 = 0 И bpros3defendVIP61 = 0 И
  1319. bpros3defendVIP62 = 0 И (dpcavr - dpc2) > 2 И (i2 - iavr) < 75 более 3 секунд
  1320.  
  1321. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros3defendTD1},{bpros3defendTD2},
  1322.     {bpros3defendTD3},{bpros3defendTD4},{bpros3defendVIP61},{bpros3defendVIP62},
  1323. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1324. FROM (
  1325. SELECT *,
  1326.   CASE
  1327.         WHEN sum_params_perform=4.0 THEN 1
  1328.         ELSE 0
  1329.     END
  1330.         rule
  1331. FROM (
  1332. SELECT *,
  1333.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1334. FROM (
  1335. SELECT *,
  1336.     CASE
  1337.         WHEN CAST({bpros3defendTD1} AS FLOAT)=0.0 AND CAST({bpros3defendTD2} AS FLOAT)=0.0 AND CAST({bpros3defendTD3} AS FLOAT)=0.0 AND
  1338.         CAST({bpros3defendTD4} AS FLOAT)=0.0 AND CAST({bpros3defendVIP61} AS FLOAT)=0.0 AND CAST({bpros3defendVIP62} AS FLOAT)=0.0 AND
  1339.         (dpcavr - CAST({dpc2} AS FLOAT))>2.0 AND (CAST({i2} AS FLOAT)-iavr)<75.0 THEN 1.0
  1340.         ELSE 0.0
  1341.     END
  1342.         params_perform
  1343. FROM (
  1344. SELECT *,
  1345.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1346.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1347. FROM  {table}))))
  1348.  
  1349.  
  1350.  
  1351. 74_______________WP11SpeedSensorFailSection3 (Неисправность датчика скорости КП11 (секция 3))
  1352. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1353. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1354. 3. bpros3defendTD1 = 0 И bpros3defendTD2 = 0 И bpros3defendTD3 = 0 И bpros3defendTD4 = 0 И bpros3defendVIP61 = 0 И
  1355. bpros3defendVIP62 = 0 И (dpcavr - dpc3) > 2 И (i3 - iavr) < 75 более 3 секунд
  1356.  
  1357. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros3defendTD1},{bpros3defendTD2},
  1358.     {bpros3defendTD3},{bpros3defendTD4},{bpros3defendVIP61},{bpros3defendVIP62},
  1359. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1360. FROM (
  1361. SELECT *,
  1362.   CASE
  1363.         WHEN sum_params_perform=4.0 THEN 1
  1364.         ELSE 0
  1365.     END
  1366.         rule
  1367. FROM (
  1368. SELECT *,
  1369.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1370. FROM (
  1371. SELECT *,
  1372.     CASE
  1373.         WHEN CAST({bpros3defendTD1} AS FLOAT)=0.0 AND CAST({bpros3defendTD2} AS FLOAT)=0.0 AND CAST({bpros3defendTD3} AS FLOAT)=0.0 AND
  1374.         CAST({bpros3defendTD4} AS FLOAT)=0.0 AND CAST({bpros3defendVIP61} AS FLOAT)=0.0 AND CAST({bpros3defendVIP62} AS FLOAT)=0.0 AND
  1375.         (dpcavr - CAST({dpc3} AS FLOAT))>2.0 AND (CAST({i3} AS FLOAT)-iavr)<75.0 THEN 1.0
  1376.         ELSE 0.0
  1377.     END
  1378.         params_perform
  1379. FROM (
  1380. SELECT *,
  1381.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1382.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1383. FROM  {table}))))
  1384.  
  1385.  
  1386.  
  1387. 75_______________WP12SpeedSensorFailSection3 (Неисправность датчика скорости КП12 (секция 3))
  1388. 1. dpcavr = (dpc1 + dpc2 + dpc3 + dpc4) / 4
  1389. 2. iavr = (i1 + i2 + i3 + i4) / 4
  1390. 3. bpros3defendTD1 = 0 И bpros3defendTD2 = 0 И bpros3defendTD3 = 0 И bpros3defendTD4 = 0 И bpros3defendVIP61 = 0 И
  1391. bpros3defendVIP62 = 0 И (dpcavr - dpc4) > 2 И (i4 - iavr) < 75 более 3 секунд
  1392.  
  1393. SELECT {select_fields},{dpc1},{dpc2},{dpc3},{dpc4},{i1},{i2},{i3},{i4},{bpros3defendTD1},{bpros3defendTD2},
  1394.     {bpros3defendTD3},{bpros3defendTD4},{bpros3defendVIP61},{bpros3defendVIP62},
  1395. MAX(rule) OVER (ORDER BY {datetime} ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING ) AS {rule_field}
  1396. FROM (
  1397. SELECT *,
  1398.   CASE
  1399.         WHEN sum_params_perform=4.0 THEN 1
  1400.         ELSE 0
  1401.     END
  1402.         rule
  1403. FROM (
  1404. SELECT *,
  1405.   SUM(params_perform) OVER (ORDER BY {datetime} ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) AS sum_params_perform
  1406. FROM (
  1407. SELECT *,
  1408.     CASE
  1409.         WHEN CAST({bpros3defendTD1} AS FLOAT)=0.0 AND CAST({bpros3defendTD2} AS FLOAT)=0.0 AND CAST({bpros3defendTD3} AS FLOAT)=0.0 AND
  1410.         CAST({bpros3defendTD4} AS FLOAT)=0.0 AND CAST({bpros3defendVIP61} AS FLOAT)=0.0 AND CAST({bpros3defendVIP62} AS FLOAT)=0.0 AND
  1411.         (dpcavr - CAST({dpc4} AS FLOAT))>2.0 AND (CAST({i4} AS FLOAT)-iavr)<75.0 THEN 1.0
  1412.         ELSE 0.0
  1413.     END
  1414.         params_perform
  1415. FROM (
  1416. SELECT *,
  1417.     (CAST({dpc1} AS FLOAT) + CAST({dpc2} AS FLOAT) + CAST({dpc3} AS FLOAT) + CAST({dpc4} AS FLOAT)) / 4 AS dpcavr,
  1418.     (CAST({i1} AS FLOAT) + CAST({i2} AS FLOAT) + CAST({i3} AS FLOAT) + CAST({i4} AS FLOAT)) / 4 AS iavr
  1419. FROM  {table}))))
RAW Paste Data
Top