| | |
| | | sm.supplier_name, |
| | | sm.bank_account_num, |
| | | sm.bank_account_name, |
| | | apa.invoice_application_no AS invoiceApplicationNo |
| | | apa.invoice_application_no AS invoiceApplicationNo, |
| | | if(asd.receipt_number is not null, true, false) as isAccountStatemen |
| | | from account_purchase_payment app |
| | | left join supplier_manage sm on app.supplier_id = sm.id |
| | | left join account_payment_application apa on app.account_payment_application_id=apa.id |
| | | left join account_statement_details asd on app.payment_number = asd.receipt_number |
| | | <where> |
| | | <if test="req.supplierId != null"> |
| | | AND app.supplier_id = #{req.supplierId} |
| | |
| | | AND app.payment_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by app.id desc |
| | | </select> |
| | | <select id="selectPayment" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto"> |
| | | SELECT DATE_FORMAT(payment_date, #{dateFormat}) AS dateStr, |
| | |
| | | GROUP BY dateStr |
| | | ORDER BY dateStr |
| | | </select> |
| | | <select id="selectStockInRecordIdsByPurchaseLedgerId" resultType="java.lang.Long"> |
| | | SELECT sir.id |
| | | FROM stock_in_record sir |
| | | LEFT JOIN quality_inspect qi ON sir.record_type = 10 AND sir.record_id = qi.id |
| | | WHERE sir.approval_status = 1 |
| | | AND sir.record_type IN ('7','10') |
| | | AND IF(sir.record_type = 7, sir.record_id, qi.purchase_ledger_id) = #{purchaseLedgerId} |
| | | </select> |
| | | |
| | | </mapper> |