package com.ejweb.modules.front.upload.util;

import com.ejweb.core.utils.SpringContextHolder;
import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.reportAttachment.dao.ReportAttachmentMapper;
import com.ejweb.modules.reportAttachment.entity.ReportAttachment;

/**
 * Created by mengxy on 2017/9/19.
 */
public class ReportAttachmentUtils {

    private static ReportDao reportDao = SpringContextHolder.getBean(ReportDao.class);
    private static ReportAttachmentMapper attachmentMapper = SpringContextHolder.getBean(ReportAttachmentMapper.class);

    public static void add(ReportAttachmentEntity attachmentEntity){
        reportDao.addReportAttachment(attachmentEntity);
    }
    public static void addReportId(String id,String reportId){
        ReportAttachment attachmentEntity = new ReportAttachment();
        attachmentEntity.setId(id);
        attachmentEntity.setReportId(reportId);
        attachmentMapper.updateByPrimaryKeySelective(attachmentEntity);
    }

}
