| | |
| | | <mapper namespace="com.ruoyi.purchase.mapper.ProductRecordMapper"> |
| | | |
| | | |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.pojo.ProductRecord"> |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | | distinct |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | sl.customer_name, |
| | | pm.model AS product_model, |
| | | pl.purchase_contract_number, |
| | | pl.supplier_name, |
| | | pr.*, |
| | | tr.invoice_number, |
| | | ROUND(pr.tickets_amount/(1+pr.tax_rate/100),2 ) as un_tickets_price, |
| | | ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount |
| | | |
| | | FROM product_record pr |
| | | left join purchase_ledger pl on pl.id = pr.purchase_ledger_id |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.purchase_ledger_id = pl.id |
| | | left join product_model pm on pm.id = pr.product_model_id |
| | | WHERE type = 2 |
| | | <if test="c.salesContractNo != null and c.salesContractNo != ''"> |
| | | and sl.sales_contract_no = #{c.salesContractNo} |
| | | </if> |
| | | <if test="c.supplierName != null and c.supplierName != ''"> |
| | | and sl.supplier_name = #{c.supplierName} |
| | | </if> |
| | | <if test="c.createdAtStart != null and c.createdAtStart != ''"> |
| | | and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="c.createdAtEnd != null and c.createdAtEnd != ''"> |
| | | and pr.created_at < date_format(#{c.createdAtEnd},'%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | </mapper> |