package com.sifang.modules.releorder.dao;

import com.sifang.modules.completionrectification.entity.CrmCompletionInfo;
import com.sifang.modules.releorder.entity.CrmInvoiceOperation;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.common.persistence.Parameter;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @title: CrmInvoiceOperationDao
 * @Author Tan
 * @Date: 2024/10/22 17:01
 * @Version 1.0
 */
@Repository
public class CrmInvoiceOperationDao extends BaseDao<CrmInvoiceOperation> {

    public List<CrmInvoiceOperation> findInvoiceByreleCode(String releCode) {
        return find(" from CrmInvoiceOperation where rele_code =:p1", new Parameter(releCode));
    }

    public CrmInvoiceOperation findInvoiceById(String id) {
        return getByHql(" from CrmInvoiceOperation where id =:p1", new Parameter(id));
    }

    public List<CrmInvoiceOperation> findInvoiceNoSubmitData(String releCode, int isSubmit) {
        return find(" from CrmInvoiceOperation where rele_code =:p1 and is_submit =:p2", new Parameter(releCode,isSubmit));
    }

}