Advertisement
anne-hasan

aspek_kk_issue_1.2_check

Oct 25th, 2021
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.02 KB | None | 0 0
  1. -- Get jawaban enumerator (sebelum KK)
  2.  
  3. SELECT
  4.     jawaban.*,
  5.     files.id,
  6.     files.created_at,
  7.     files.disk_name,
  8.     files.file_name,
  9.     files.attachment_id,
  10.     CONCAT(
  11.         "https://aspek.ombudsman.go.id/storage/app/uploads/public/",
  12.         CONCAT(
  13.             SUBSTRING(files.disk_name, 1, 3),
  14.             "/",
  15.             SUBSTRING(files.disk_name, 4, 3)),
  16.         CONCAT(
  17.             "/",
  18.             SUBSTRING(files.disk_name, 7, 3),
  19.             "/", files.disk_name)
  20.     ) AS 'Url Path'
  21.  
  22. FROM
  23.     aspek_kepatuhan_detail_jawaban as jawaban
  24. LEFT JOIN
  25.     system_files as files ON files.attachment_id = jawaban.id
  26. JOIN
  27.     aspek_kepatuhan_profile_responden as responden ON responden.id = jawaban.profil_responden_id
  28. WHERE
  29.     responden.id IN (
  30.         SELECT
  31.             responden.id
  32.         FROM
  33.             aspek_kepatuhan_profile_responden as responden
  34.         WHERE
  35.             institution_id = (
  36.             SELECT
  37.                 institution_id
  38.             FROM
  39.                 aspek_kepatuhan_profile_responden
  40.             WHERE
  41.                 id = 37073
  42.             )
  43.         ORDER BY
  44.             responden.id
  45.     )
  46. AND jawaban.questions_id = 23
  47. ORDER BY
  48.     jawaban.profil_responden_id, jawaban.questions_id
  49.  
  50.  
  51. -- Get jawaban setelah KK
  52. SELECT
  53.     jawaban.*,
  54.     files.id,
  55.     files.created_at,
  56.     files.disk_name,
  57.     files.file_name,
  58.     files.attachment_id,
  59.     CONCAT(
  60.         "https://aspek.ombudsman.go.id/storage/app/uploads/public/",
  61.         CONCAT(
  62.             SUBSTRING(files.disk_name, 1, 3),
  63.             "/",
  64.             SUBSTRING(files.disk_name, 4, 3)),
  65.         CONCAT(
  66.             "/",
  67.             SUBSTRING(files.disk_name, 7, 3),
  68.             "/", files.disk_name)
  69.     ) AS 'Url Path'
  70.  
  71. FROM
  72.     aspek_kepatuhan_jawaban_supervisor as jawaban
  73. LEFT JOIN
  74.     system_files as files ON files.id = jawaban.file_id
  75. JOIN
  76.     aspek_kepatuhan_profile_responden as responden ON responden.id = jawaban.profil_responden_id
  77. WHERE
  78.     responden.id IN (
  79.         SELECT
  80.             responden.id
  81.         FROM
  82.             aspek_kepatuhan_profile_responden as responden
  83.         WHERE
  84.             institution_id = (
  85.             SELECT
  86.                 institution_id
  87.             FROM
  88.                 aspek_kepatuhan_profile_responden
  89.             WHERE
  90.                 id = 37073
  91.             )
  92.         ORDER BY
  93.             responden.id
  94.     )
  95. AND jawaban.questions_id = 23
  96. ORDER BY
  97.     jawaban.profil_responden_id, jawaban.questions_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement