cloudroam
2025-06-12 b06162b2966eea4f092b3edf3032de843059af4b
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
28
29
30
31
32
33
package com.mzl.flower.mapper.film;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mzl.flower.entity.film.FilmCollects;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
 
import java.time.LocalDate;
 
/**
 * <p>
 * 影视作品收藏表 Mapper 接口
 * </p>
 *
 * @author generator@Fang
 * @since 2025-05-29
 */
@Repository
public interface FilmCollectsMapper extends BaseMapper<FilmCollects> {
 
    @Select("select * from film_collects where film_id = #{filmId} and create_by = #{createBy}")
    FilmCollects getFilmCollectsByfilmIdAndCreateBy(Integer filmId, String createBy);
 
    @Update("UPDATE film_collects SET status = #{status}, update_by = #{updateBy}, update_time = NOW() WHERE id = #{id}")
    int updateStatusById(@Param("id") Long id,
                         @Param("status") Boolean status,
                         @Param("updateBy") String updateBy);
 
    @Select("SELECT COUNT(*) FROM film_collects WHERE film_id = #{filmId} AND DATE(create_time) = #{date} and deleted = '0' ")
    int countByFilmIdAndDate(Long id, LocalDate yesterday);
}