Air
2024-11-04 ef8463bc78e8e3f6b6ca3f8a76bb72d000a04ff2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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.nova.sankuai.infra.mapper.ChannelDownloadLogMapper">
 
    <select id="getDownloadCount" resultType="com.nova.sankuai.domain.vo.channel.ChannelDownloadCountVo">
        select
        cdl.channel_id as id,
        count(cdl.id) as count
        from channel_download_log cdl
        <where>
            cdl.channel_id in
            <foreach collection="channelIds" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
            <if test="startDate != null">
                and cdl.creation_date &gt;= #{startDate}
            </if>
            <if test="endDate != null">
                and cdl.creation_date &lt;= #{endDate}
            </if>
        </where>
        group by cdl.channel_id
    </select>
 
</mapper>