SHARE
TWEET

Untitled

a guest Jun 20th, 2019 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     subj.name AS subject,
  3.     split_part(SOURCE.name, ' ', 1) AS SOURCE,
  4.     CASE WHEN SOURCE.TYPE = 'OWN'
  5.         THEN 'Внутренняя'
  6.         ELSE 'Внешняя'
  7.     END AS SrcType,
  8.     macroregion.name AS macro,
  9.     REPLACE(city.nameru, 'ё', 'е') AS city,
  10.     msg.issuedatecreated + INTERVAL '3 hours' AS DATE
  11.     msg.issuedatecreated + INTERVAL '3 hours' AS TIME,
  12.     split_part(msg.issueurl, '#', 1) AS Url,
  13.     msg.issueauthorname AS Author,
  14.     msg.issuetext AS text,
  15.     CASE WHEN msg.entrytone = 'NEGATIVE'
  16.         THEN 'Негатив'
  17.     WHEN msg.entrytone = 'NEUTRAL'
  18.         THEN 'Нейтрал'
  19.     WHEN msg.entrytone = 'POSITIVE'
  20.         THEN 'Позитив'
  21.     END AS Tone,
  22.     cat.name AS Cat,
  23. Ответы,
  24. Вариаты закрытия инцидентов
  25.  
  26. FROM monitoring_customerissues AS msg
  27.     LEFT JOIN monitoring_projectcategories AS cat
  28.         ON (msg.projectcategory_id = cat.id)
  29.     LEFT JOIN geo_city AS city
  30.         ON (city.id = msg.geocity_id)
  31.     LEFT JOIN monitoring_macroregions AS macroregion
  32.         ON (msg.monitoringmacroregion_id = macroregion.id)
  33.     LEFT JOIN monitoring_projectsubjects AS subj
  34.         ON (msg.projectsubject_id = subj.id)
  35.     LEFT JOIN monitoring_projectsites AS SOURCE
  36.         ON (msg.projectsite_id = SOURCE.id)
  37.  
  38. WHERE msg.project_id = 18791
  39.     AND msg.issuedatecreated >= :mindate
  40.     AND msg.issuedatecreated <= :maxdate
  41.     AND msg.deleted IS NULL
  42. ORDER BY msg.issuenumber ASC;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top