ImUserTopicMapper.xml 1.3 KB

123456789101112131415161718192021222324252627282930
  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.ImUserTopicMapper">
  4. <!-- 开启二级缓存 -->
  5. <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
  6. <select id="getuserTopicByuserid" resultType="cn.ubitech.ttc.model.im.IMUserTopicModel">
  7. select
  8. iut.*,
  9. it.topicname
  10. from im_user_topic iut, im_topic it
  11. where iut.userid = #{userid}
  12. and iut.isactive = 1 and iut.topicid = it.id and it.isactive = 1
  13. </select>
  14. <select id="getuserTopic" resultType="cn.ubitech.ttc.model.im.IMUserTopicModel">
  15. select
  16. iut.*,
  17. it.topicname
  18. from im_user_topic iut, im_topic it
  19. where iut.userid = #{userid} and iut.type = #{type} and iut.reciverid = #{reciverid} and iut.topicid = it.id and it.isactive = 1
  20. </select>
  21. <select id="getUserChatlist" resultType="cn.ubitech.ttc.model.im.IMUserTopicModel">
  22. SELECT
  23. iut.*,
  24. it.topicname
  25. FROM im_user_topic iut, im_topic it
  26. WHERE iut.userId = #{userid} AND iut.isactive = 1 AND iut.topicid = it.id AND it.isactive = 1
  27. </select>
  28. </mapper>