| | |
| | | T3.customer_name, |
| | | T4.invoiceFileName, |
| | | T5.product_category, |
| | | T5.specification_model, |
| | | IFNULL(T6.receipt_payment_amount_total ,0) AS receipt_payment_amount_total, |
| | | (T1.invoice_total - IFNULL(T6.receipt_payment_amount_total ,0)) AS no_receipt_amount |
| | | FROM invoice_ledger T1 |
| | |
| | | BY invoice_ledger_id |
| | | ) T6 ON T1.id = T6.invoice_ledger_id |
| | | <where> |
| | | <if test="c.customerName != null and c.customerName !=''"> |
| | | AND T3.customer_name LIKE CONCAT('%',#{c.customerName},'%') |
| | | <if test="req.customerName != null and req.customerName !=''"> |
| | | AND T3.customer_name LIKE CONCAT('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="c.invoiceLedgerId != null"> |
| | | AND T1.id = #{c.invoiceLedgerId} |
| | | <if test="req.invoiceLedgerId != null"> |
| | | AND T1.id = #{req.invoiceLedgerId} |
| | | </if> |
| | | <if test="c.customerContractNo != null and c.customerContractNo !=''"> |
| | | AND T3.customer_contract_no LIKE CONCAT('%',#{c.customerContractNo},'%') |
| | | <if test="req.customerContractNo != null and req.customerContractNo !=''"> |
| | | AND T3.customer_contract_no LIKE CONCAT('%',#{req.customerContractNo},'%') |
| | | </if> |
| | | <if test="c.projectName != null and c.projectName !=''"> |
| | | AND T3.project_name LIKE CONCAT('%',#{c.projectName},'%') |
| | | <if test="req.projectName != null and req.projectName !=''"> |
| | | AND T3.project_name LIKE CONCAT('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.invoiceDateStart != null and req.invoiceDateStart != '' "> |
| | | AND T1.invoice_date >= DATE_FORMAT(#{req.invoiceDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="req.invoiceDateEnd != null and req.invoiceDateEnd != '' "> |
| | | AND T1.invoice_date <= DATE_FORMAT(#{req.invoiceDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | <if test="req.timeOut != null and req.timeOut"> |
| | | AND T1.invoice_date < DATE_SUB(CURDATE(), INTERVAL 15 DAY) |
| | | AND (T1.invoice_total - IFNULL(T6.receipt_payment_amount_total ,0)) > 0 |
| | | </if> |
| | | </where> |
| | | ORDER BY T2.create_time DESC |