CorpUserFollowRelationMapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031
  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="com.cyksj.mapper.corp.CorpUserFollowRelationMapper">
  4. <select id="selectCorpEqubeBytime" resultType="java.lang.Integer">
  5. select count(distinct s.id)
  6. from (select u.id
  7. from (select distinct cu.unionid
  8. from corp_user cu
  9. left join corp_user_follow_relation cr on cu.external_userid = cr.corp_user_id
  10. left join corp_user_tag ct on ct.relation_id = cr.id
  11. where ct.tag_name = '设备' and cu.unionid != '' and cu.created_time BETWEEN #{start} and #{end}) s
  12. left join user u on u.unionid = s.unionid
  13. where u.unionid != '') s
  14. left join order_don od on od.user_id = s.id where od.status = 'complete' and od.pay_time BETWEEN #{start} and #{end}
  15. </select>
  16. <select id="selectCorpAccountBytime" resultType="java.lang.Integer">
  17. select count(distinct s.id)
  18. from (select u.id
  19. from (select distinct cu.unionid
  20. from corp_user cu
  21. left join corp_user_follow_relation cr on cu.external_userid = cr.corp_user_id
  22. left join corp_user_tag ct on ct.relation_id = cr.id
  23. where ct.tag_name = '账号' and cu.unionid != '' and cu.created_time BETWEEN #{start} and #{end}) s
  24. left join user u on u.unionid = s.unionid
  25. where u.unionid != '') s
  26. left join order_don od on od.user_id = s.id where od.status = 'complete' and od.pay_time BETWEEN #{start} and #{end}
  27. </select>
  28. </mapper>