2025-07-18 16:53:56 +08:00
|
|
|
<?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.atguigu.tingshu.album.mapper.AlbumInfoMapper">
|
2025-07-19 17:24:11 +08:00
|
|
|
<select id="findUserAlbumPage" resultType="com.atguigu.tingshu.vo.album.AlbumListVo">
|
|
|
|
select
|
|
|
|
ai.id album_id,
|
|
|
|
ai.album_title,
|
|
|
|
ai.cover_url,
|
|
|
|
ai.include_track_count,
|
|
|
|
ai.is_finished,
|
|
|
|
ai.status,
|
|
|
|
sum(if(stat_type = '0401', stat_num, 0)) playStatNum,
|
|
|
|
max(if(stat_type = '0402', stat_num, 0)) subscribeSta,
|
|
|
|
max(if(stat_type = '0403', stat_num, 0)) buyStatNum,
|
|
|
|
max(if(stat_type = '0404', stat_num, 0)) commentStatNum
|
|
|
|
from album_info ai
|
|
|
|
inner join album_stat stat on stat.album_id = ai.id and stat.is_deleted = 0
|
|
|
|
<where>
|
|
|
|
<if test="vo.userId != null">
|
|
|
|
and ai.user_id = #{vo.userId}
|
|
|
|
</if>
|
|
|
|
<if test="vo.status != null and vo.status != ''">
|
|
|
|
and ai.status = #{vo.status}
|
|
|
|
</if>
|
|
|
|
<if test="vo.albumTitle != null and vo.albumTitle != ''">
|
|
|
|
and ai.album_title like concat('%', #{vo.albumTitle}, '%')
|
|
|
|
</if>
|
|
|
|
and ai.is_deleted = 0
|
|
|
|
</where>
|
|
|
|
group by ai.id
|
|
|
|
order by ai.id desc
|
|
|
|
</select>
|
2025-07-18 16:53:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|