package top.lvzhiqiang.mapper; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import top.lvzhiqiang.entity.*; import java.util.List; import java.util.Map; /** * 照片信息Mapper * * @author lvzhiqiang * 2024/8/26 11:02 */ public interface PictureInfoMapper { @Select("select main_who AS name, count(id) AS count from video_info_infantry where type = #{infantryType} group by main_who order by count(id) desc") List findCast(String infantryType); @Select("select fic.category_name AS name, count(fi.category_id) AS count " + "from file_image fi " + " left join file_image_category fic on fi.category_id = fic.id " + "group by fi.category_id " + "order by count(fi.category_id) desc ") List findUploadGenres(); @Select({""}) List getUploadImageInfoList(Map params); @Insert("INSERT INTO file_image(old_name, new_name, category_id, size, path, remark, create_time, modify_time) " + "VALUES (#{oldName}, #{newName}, #{categoryId}, #{size}, #{path}, #{remark}, now(), now())") int insertFileImage(FileImage fileImage); @Update("update file_image set old_name=#{oldName},new_name=#{newName},category_id=#{categoryId},size=#{size},path=#{path},remark=#{remark},modify_time=now() where id=#{id}") int updateFileImage(FileImage fileImage); @Select({""}) List findImageList(Map params); @Select("select * from file_image where id = #{id}") FileImage findFileImageById(Long id); @Select("delete from file_image where id = #{id}") FileImage deleteFileImageById(Long id); @Select("SELECT * FROM file_crawler_image_log WHERE category_id = #{categoryId} and delete_flag = 1 order by publish_time desc limit 1") FileCrawlerImageLog findLatestCrawlerImage(Integer categoryId); @Insert("INSERT ignore INTO file_crawler_image(old_name, new_name, category_id, log_id, size, path, remark, orgin_url, sort, modify_time) " + "VALUES (#{oldName}, #{newName}, #{categoryId}, #{logId}, #{size}, #{path}, #{remark}, #{orginUrl}, #{sort}, now())") int insertIgnoreFileImage(FileImage fileImage); @Insert("INSERT INTO file_crawler_image_log(id, main_url, main_title, category_id, status, failure_cause, publish_time, create_time, modify_time) " + "VALUES (#{id}, #{mainUrl}, #{mainTitle}, #{categoryId}, #{status}, #{failureCause}, #{publishTime}, now(), now()) " + "ON DUPLICATE KEY UPDATE status=values(status),failure_cause=values(failure_cause),modify_time=now()") void insertOrUpdateFileCrawlerImageLog(FileCrawlerImageLog crawlerImageLog); @Insert("INSERT ignore INTO file_crawler_image_log(id, main_url, main_title, category_id, status, failure_cause, publish_time, create_time, modify_time) " + "VALUES (#{id}, #{mainUrl}, #{mainTitle}, #{categoryId}, #{status}, #{failureCause}, #{publishTime}, now(), now())") int insertIgnoreFileCrawlerImageLog(FileCrawlerImageLog crawlerImageLog); @Select({""}) List getCrawlerImageInfoList(Map params); @Select({""}) List findJsoupFulibaPicDetailListByParams(Map params); }