/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.sys.dao;

import com.jeeplus.common.persistence.CrudDao;
import com.jeeplus.common.persistence.annotation.MyBatisDao;
import com.jeeplus.modules.sys.entity.Workattachment;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 附件信息DAO接口
 * @author yangfan
 * @version 2017-10-11
 */
@MyBatisDao
public interface WorkattachmentDao extends CrudDao<Workattachment> {


    //根据相同的url删除附件
    int deleteByUrl(Workattachment workattachment);
    Workattachment getByUrl(@Param("url") String url);

    //根据相同的attachment_id
    List<String> getAttachmentIds(String attachmentId);

    Workattachment getByAttachmentId(String attachmentId);

    List<Workattachment> getListOfAttachment(@Param("attachmentId") String attachmentId,@Param("type") String type);

    //查找附件
    Workattachment getByAttachmentIdAndFlag(Map<String, String> map);

    //用户在不同公司的评价表
    List<Workattachment> getByAttachmentIdAndCompanyIdAndFlag(Map<String, String> map);

    //相同attachmentId的 集合
    List<Workattachment> getListByAttachmentIdAndFlag(Map<String, String> map);

    int updateAttachmentId(@Param("oldAttachmentId") String oldAttachmentId, @Param("newAttachmentId") String newAttachmentId);
}