/*
 * Copyright (c) 京北方信息技术股份有限公司 Corporation 2022 . All rights reserved.
 *
 */
package net.northking.cctp.attachment.db.dao;

import net.northking.cctp.attachment.db.entity.Attachment;
import net.northking.cctp.attachment.db.mapper.AttachmentMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * Mybatis数据库持久层（业务层）：附件
 *
 * <p>文件内容由代码生成器产生，请不要手动修改！ <br>
 * createdate:  2022-03-08 10:25:33  <br>
 *
 * @author: maven-cctp-plugin  <br>
 * @since: 1.0 <br>
 */
@Repository
public interface AttachmentDao extends AttachmentMapper {

    int existTable(@Param("tableName") String tableName);


    void createNewTable(@Param("tenantId") String tenantId);

    Attachment findByPK(Attachment attachment);

    void updateAllNewFile(Attachment update);

    List<Attachment> queryClearRecordScreenshot(@Param("businessCodes") List<String> businessCodes, @Param("date") LocalDate date, @Param("tableSuffix") String tableSuffix);

    void updateByObjIds(@Param("objectIds") List<String> objectIds, @Param("tableSuffix") String tableSuffix);


    List<Attachment> queryByObjId(@Param("objId") String objId, @Param("date") LocalDate date, @Param("tableSuffix") String tableSuffix);

    List<Attachment> findByPrimaryKeys(@Param("list") List<String> ids, @Param("tableSuffix") String tableSuffix);

    void clearAttachmentsByIds(@Param("deleteIds") List<String> deleteIds, @Param("tableSuffix") String tableSuffix);

    void associatedFiles(@Param("objectId") String objectId, @Param("fileIds") List<String> fileIds, @Param("tableSuffix") String tableSuffix);

    List<Attachment> queryByOverTime(@Param("overTime") LocalDateTime overTime, @Param("tableSuffix") String tableSuffix);

    List<Attachment> queryByBusiness(@Param("date") LocalDate date, @Param("tableSuffix") String tableSuffix);
}
