| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package top.lvzhiqiang.mapper;
- import org.apache.ibatis.annotations.*;
- import top.lvzhiqiang.entity.CrawlerXiaoeknowCourse;
- import java.util.List;
- import java.util.Map;
- /**
- * 爬虫小鹅通课程表Mapper
- *
- * @author lvzhiqiang
- * 2022/9/10 21:24
- */
- public interface CrawlerXiaoeknowCourseMapper {
- /**
- * 删除所有
- */
- @Delete("DELETE FROM crawler_xiaoeknow_course where 1=1")
- void deleteAll();
- /**
- * 批量新增
- *
- * @param crawlerXiaoeknowCourseList
- */
- @Insert({"<script>" +
- "INSERT INTO crawler_xiaoeknow_course(app_id, column_id, resource_id, resource_title, resource_type, view_count, start_at, create_time, modify_time) " +
- "VALUES " +
- "<foreach collection='list' item='cxc' index=\"index\" separator=\",\">" +
- " (#{cxc.appId}, #{cxc.columnId}, #{cxc.resourceId}, #{cxc.resourceTitle}, #{cxc.resourceType}, #{cxc.viewCount}, #{cxc.startAt}, #{cxc.createTime}, now())" +
- " </foreach>" +
- "</script>"})
- int insertList(List<CrawlerXiaoeknowCourse> crawlerXiaoeknowCourseList);
- /**
- * 新增
- *
- * @param crawlerXiaoeknowCourse
- */
- @Insert("INSERT INTO crawler_xiaoeknow_course(app_id, column_id, resource_id, resource_title, resource_type, view_count, start_at, create_time, modify_time) " +
- "VALUES (#{appId}, #{columnId}, #{issueDate}, #{resourceId}, #{resourceTitle}, #{resourceType}, #{viewCount}, #{startAt}, #{createTime}, now())")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- int insert(CrawlerXiaoeknowCourse crawlerXiaoeknowCourse);
- /**
- * 查询所有
- */
- @Select("SELECT * FROM crawler_xiaoeknow_course WHERE delete_flag = 1")
- List<CrawlerXiaoeknowCourse> findAll();
- /**
- * 查询最新的一条
- */
- @Select("SELECT * FROM crawler_xiaoeknow_course WHERE delete_flag = 1 and app_id=#{appId} and column_id=#{columnId} order by start_at desc limit 1")
- CrawlerXiaoeknowCourse findLatestInfo(String appId, String columnId);
- @Select({"<script>" +
- "select * from crawler_xiaoeknow_course WHERE delete_flag = 1" +
- "<if test=\"title != null and title != ''\">" +
- " and resource_title like concat('%',#{title},'%')" +
- "</if>" +
- "<if test=\"type != null and type != ''\">" +
- " and resource_type = #{type}" +
- "</if>" +
- "<if test=\"order != null and order != ''\">" +
- " order by ${orderField} ${order}" +
- "</if>" +
- "</script>"})
- List<CrawlerXiaoeknowCourse> findXiaoeknowCourse4MultipleParams(Map<String, Object> params);
- }
|