InfoCommentMapper.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.ubitech.ttc.dao.InfoCommentMapper">
  4. <!-- 开启二级缓存 -->
  5. <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
  6. <select id="getConnInfoModelByCommentId" resultType="cn.ubitech.ttc.model.information.BaseInfoModel">
  7. SELECT
  8. i.id infoid,
  9. i.title title
  10. FROM connectioninfo i,
  11. info_comment c
  12. WHERE i.id = c.infoid
  13. AND c.infotype = 81
  14. AND i.isenabled = 1
  15. AND c.id = #{commentid}
  16. </select>
  17. <select id="getResourceInfoModelByCommentId" resultType="cn.ubitech.ttc.model.information.BaseInfoModel">
  18. SELECT
  19. i.id infoid,
  20. i.title title
  21. FROM resourcelibrary i,
  22. info_comment c
  23. WHERE i.id = c.infoid
  24. AND c.infotype = 81
  25. AND i.isenabled = 1
  26. AND c.id = #{commentid}
  27. </select>
  28. <select id="getCountGroupbyResourceid" resultType="cn.ubitech.ttc.model.information.BaseInfoModel">
  29. SELECT
  30. i.infoid AS infoid,
  31. COUNT(i.infoid) AS ishastag
  32. FROM
  33. info_comment i,
  34. resourcelibrary l,
  35. typeentry t
  36. WHERE
  37. i.infoid = l.id
  38. AND t.itemvalue = i.infotype
  39. AND t.tcname = 'resourcelibrary'
  40. GROUP BY
  41. i.infoid;
  42. </select>
  43. </mapper>