SHARE
TWEET

Untitled

a guest May 26th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE ALGORITHM
  2. =UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vw_objeto_aprendizagem_colabore_criterio` AS
  3. select `res`.`id
  4. ` AS `id`,`res`.`titulo` AS `titulo`,`res`.`descricao` AS `descricao`,`res`.`video_id` AS `video_id`,`res`.`duracao` AS `duracao`,`res`.`imagem_url` AS `imagem_url`,`res`.`dt_criacao` AS `dt_criacao`,`res`.`dt_atualizacao` AS `dt_atualizacao`,`res`.`dt_remocao` AS `dt_remocao`,`res`.`coringa_json` AS `coringa_json`,`res`.`objetoAprendizagemId` AS `objetoAprendizagemId`,`res`.`status` AS `status`,`res`.`usuarioId` AS `usuarioId`,`res`.`criterioOrdem` AS `criterioOrdem` from
  5. (((select `development_api`.`pel_objeto_aprendizagem_colabore
  6. `.`id` AS `id`,`development_api`.`pel_objeto_aprendizagem_colabore`.`titulo` AS `titulo`,`development_api`.`pel_objeto_aprendizagem_colabore`.`descricao` AS `descricao`,`development_api`.`pel_objeto_aprendizagem_colabore`.`video_id` AS `video_id`,`development_api`.`pel_objeto_aprendizagem_colabore`.`duracao` AS `duracao`,`development_api`.`pel_objeto_aprendizagem_colabore`.`imagem_url` AS `imagem_url`,`development_api`.`pel_objeto_aprendizagem_colabore`.`dt_criacao` AS `dt_criacao`,`development_api`.`pel_objeto_aprendizagem_colabore`.`dt_atualizacao` AS `dt_atualizacao`,`development_api`.`pel_objeto_aprendizagem_colabore`.`dt_remocao` AS `dt_remocao`,`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` AS `coringa_json`,`development_api`.`pel_objeto_aprendizagem_colabore`.`objetoAprendizagemId` AS `objetoAprendizagemId`,`development_api`.`pel_objeto_aprendizagem_colabore`.`status` AS `status`,`development_api`.`pel_objeto_aprendizagem_colabore`.`usuarioId` AS `usuarioId`,
  7. ((cast
  8. (json_extract
  9. (cast
  10. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.viewCount') as unsigned) * cast
  11. (json_extract
  12. (cast
  13. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.likeCount') as unsigned)) / cast
  14. (json_extract
  15. (cast
  16. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.dislikeCount') as unsigned)) AS `criterioOrdem` from `development_api`.`pel_objeto_aprendizagem_colabore` where
  17. ((`development_api`.`pel_objeto_aprendizagem_colabore`.`status` = 'NI') and isnull
  18. (`development_api`.`pel_objeto_aprendizagem_colabore`.`dt_remocao`) and
  19. (time_to_sec
  20. (
  21. if((length(`development_api`.`pel_objeto_aprendizagem_colabore`.`duracao`) = 5),concat
  22. ('00:',`development_api`.`pel_objeto_aprendizagem_colabore`.`duracao`),`development_api`.`pel_objeto_aprendizagem_colabore`.`duracao`)) < time_to_sec
  23. ('00:11:00')) and
  24. (((cast
  25. (json_extract
  26. (cast
  27. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.viewCount') as unsigned) * cast
  28. (json_extract
  29. (cast
  30. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.likeCount') as unsigned)) / cast
  31. (json_extract
  32. (cast
  33. (`development_api`.`pel_objeto_aprendizagem_colabore`.`coringa_json` as json),'$.video.statistics.dislikeCount') as unsigned)) is not null)))) `res` left join `development_api`.`pel_objeto_aprendizagem` `oa` on
  34. ((`oa`.`video_id` = `res`.`video_id`))) where
  35. (isnull
  36. (`oa`.`id`) and
  37. (`res`.`criterioOrdem` > 0)) order by `res`.`criterioOrdem` desc
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