| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package top.lvzhiqiang.mapper;
- import org.apache.ibatis.annotations.*;
- import top.lvzhiqiang.entity.VideoSitePool;
- import java.util.List;
- /**
- * 电影站点池Mapper
- *
- * @author lvzhiqiang
- * 2022/4/28 15:53
- */
- public interface VideoSitePoolMapper {
- /**
- * 删除所有
- */
- @Delete("DELETE FROM video_site_pool where 1=1")
- void deleteAll();
- /**
- * 批量新增
- *
- * @param videoSitePoolList
- */
- @Insert({"<script>" +
- "INSERT INTO video_site_pool(url, type, create_time, modify_time) " +
- "VALUES " +
- "<foreach collection='list' item='vsp' index=\"index\" separator=\",\">" +
- " (#{vsp.url}, #{vsp.type}, now(), now())" +
- " </foreach>" +
- "</script>"})
- int insertList(List<VideoSitePool> videoSitePoolList);
- /**
- * 新增
- *
- * @param videoSitePool
- */
- @Insert("INSERT INTO video_site_pool(url, type, create_time, modify_time) " +
- "VALUES (#{url}, #{type}, now(), now())")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- int insert(VideoSitePool videoSitePool);
- /**
- * 查询所有
- */
- @Select("SELECT url FROM video_site_pool where type = #{type}")
- List<String> findUrlByType(@Param("type") Integer type);
- /**
- * 查询所有
- */
- @Select("SELECT url FROM video_site_pool where type = #{type} and delete_flag = #{deleteFlag}")
- List<String> findUrlByTypeAndDeleteFlag(@Param("type") Integer type, @Param("deleteFlag") Integer deleteFlag);
- /**
- * 更新状态
- *
- * @param url
- * @param deleteFlag
- * @return
- */
- @Update("update video_site_pool set delete_flag = #{deleteFlag},modify_time = now() where url = #{url}")
- int updateDeleteFlag(@Param("url") String url, @Param("deleteFlag") Integer deleteFlag);
- /**
- * 根据url模糊查询
- *
- * @return
- */
- @Select({"<script>" +
- "select * from video_site_pool WHERE delete_flag = 1" +
- "<if test=\"url != null and url != ''\">" +
- " and url like concat('%',#{url},'%')" +
- "</if>" +
- "<if test=\"order != null and order != ''\">" +
- " order by create_time ${order}" +
- "</if>" +
- "</script>"})
- List<VideoSitePool> findByUrl(String url, String order);
- }
|