buhuazhen
昨天 1a376098d2e27eeb9c2af90fa501311c2035d5ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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>