ClickRecordMapper.xml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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.ClickRecordMapper">
  4. <!-- 开启二级缓存 -->
  5. <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
  6. <select id="getMyCollect" resultType="cn.ubitech.ttc.entity.ClickRecord">
  7. select * from click_record where moduleid = #{moduleid} and clicktype = #{clicktype} and userid = #{userid} and status = 1 order by createtime desc
  8. </select>
  9. <select id="getMyCollectCount" resultType="java.lang.Integer">
  10. select count(*) from click_record where moduleid = #{moduleid} and clicktype = #{clicktype} and userid = #{userid} and status = 1
  11. </select>
  12. <select id="getCountByGroup" resultType="cn.ubitech.ttc.model.click.clickrecordModel">
  13. SELECT
  14. c.*, COUNT(c.targetid)as countvalue
  15. FROM
  16. click_record c,
  17. resourcelibrary r,
  18. typeentry t
  19. WHERE
  20. c.targetid = r.id
  21. AND c.moduleid = t.itemvalue
  22. AND t.typename = 'tablecode'
  23. AND c.clicktype=#{clicktype}
  24. AND t.tcname = #{tcname}
  25. GROUP BY
  26. c.targetid
  27. </select>
  28. </mapper>