<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.ruoyi.business.mapper.ReceiptPaymentMapper">
|
|
<select id="invoiceInfo" resultType="com.ruoyi.business.dto.SalesRecordDto">
|
SELECT
|
T1.*,
|
T3.coal
|
FROM
|
sales_record T1
|
LEFT JOIN customer T2 ON T1.customer_id = T2.id
|
LEFT JOIN coal_info T3 ON T1.coal_id = T3.id
|
WHERE T1.id = #{id}
|
</select>
|
<select id="bindInvoiceNoRegPage" resultType="com.ruoyi.business.dto.ReceiptPaymentDto">
|
SELECT
|
T1.*,
|
T2.customer,
|
T3.coal
|
FROM
|
receipt_payment T1
|
LEFT JOIN sales_record T2 ON T1.sales_record_id = T2.id
|
LEFT JOIN coal_info T3 ON T2.coal_id = T3.id
|
where 1=1
|
<if test="receiptPaymentDto.customer != null and receiptPaymentDto.customer != ''">
|
and T2.customer like concat('%',#{receiptPaymentDto.customer},'%')
|
</if>
|
<if test="receiptPaymentDto.coal != null and receiptPaymentDto.coal != ''">
|
and T3.coal like concat('%',#{receiptPaymentDto.coal},'%')
|
</if>
|
<if test="receiptPaymentDto.receiptPaymentDateStart != null and receiptPaymentDto.receiptPaymentDateEnd != ''">
|
and T1.receipt_payment_date between to_timestamp(#{receiptPaymentDto.receiptPaymentDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND
|
to_timestamp(#{receiptPaymentDto.receiptPaymentDateEnd}, 'yyyy-MM-dd HH24:mi:ss')
|
</if>
|
</select>
|
<select id="receiptPaymentHistoryListNoPage" resultType="com.ruoyi.business.dto.ReceiptPaymentDto">
|
SELECT
|
T1.*,
|
T2.customer,
|
T3.coal
|
FROM
|
receipt_payment T1
|
LEFT JOIN sales_record T2 ON T1.sales_record_id = T2.id
|
LEFT JOIN coal_info T3 ON T2.coal_id = T3.id
|
where 1=1
|
<if test="receiptPaymentDto.customer != null and receiptPaymentDto.customer != ''">
|
and T2.customer like concat('%',#{receiptPaymentDto.customer},'%')
|
</if>
|
<if test="receiptPaymentDto.coal != null and receiptPaymentDto.coal != ''">
|
and T3.coal like concat('%',#{receiptPaymentDto.coal},'%')
|
</if>
|
<if test="receiptPaymentDto.receiptPaymentDateStart != null and receiptPaymentDto.receiptPaymentDateEnd != ''">
|
and T1.receipt_payment_date between to_timestamp(#{receiptPaymentDto.receiptPaymentDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND
|
to_timestamp(#{receiptPaymentDto.receiptPaymentDateEnd}, 'yyyy-MM-dd HH24:mi:ss')
|
</if>
|
</select>
|
|
|
</mapper>
|