package com.sifang.modules.releorder.dao;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.releorder.entity.CrmInvoiceInfo;
import com.sifang.modules.sys.common.persistence.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @title: CrmInvoiceInfoDao
 * @Author Tan
 * @Date: 2024/10/21 9:58
 * @Version 1.0
 */
@Repository
public class CrmInvoiceInfoDao extends BaseDao<CrmInvoiceInfo> {

    public List<Record> getInvoiceInfoList(String releCode) {
        StringBuilder sql = new StringBuilder();
        sql.append(" SELECT rele_code,invoice_code,invoice_number,invoice_date,invoice_amount,invoice_tax,invoice_name,remark ");
        sql.append(" FROM crm_invoice_info ");
        sql.append(" WHERE 1 = 1  ");
        sql.append(" AND rele_code = "+"'"+releCode+"'");
        return Db.find(sql.toString());
    }

}