| 12345678910111213141516171819202122232425262728293031 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.cyksj.mapper.corp.CorpUserFollowRelationMapper">
- <select id="selectCorpEqubeBytime" resultType="java.lang.Integer">
- select count(distinct s.id)
- from (select u.id
- from (select distinct cu.unionid
- from corp_user cu
- left join corp_user_follow_relation cr on cu.external_userid = cr.corp_user_id
- left join corp_user_tag ct on ct.relation_id = cr.id
- where ct.tag_name = '设备' and cu.unionid != '' and cu.created_time BETWEEN #{start} and #{end}) s
- left join user u on u.unionid = s.unionid
- where u.unionid != '') s
- left join order_don od on od.user_id = s.id where od.status = 'complete' and od.pay_time BETWEEN #{start} and #{end}
- </select>
- <select id="selectCorpAccountBytime" resultType="java.lang.Integer">
- select count(distinct s.id)
- from (select u.id
- from (select distinct cu.unionid
- from corp_user cu
- left join corp_user_follow_relation cr on cu.external_userid = cr.corp_user_id
- left join corp_user_tag ct on ct.relation_id = cr.id
- where ct.tag_name = '账号' and cu.unionid != '' and cu.created_time BETWEEN #{start} and #{end}) s
- left join user u on u.unionid = s.unionid
- where u.unionid != '') s
- left join order_don od on od.user_id = s.id where od.status = 'complete' and od.pay_time BETWEEN #{start} and #{end}
- </select>
- </mapper>
|