xuhy
2025-02-10 c9743d30317ed0aaa70a2f6f3649915051ea59b8
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.system.mapper.TBillMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TBill">
        <id column="id" property="id" />
        <result column="contract_id" property="contractId" />
        <result column="contract_number" property="contractNumber" />
        <result column="payable_fees_money" property="payableFeesMoney" />
        <result column="payable_fees_time" property="payableFeesTime" />
        <result column="pay_fees_status" property="payFeesStatus" />
        <result column="pay_fees_money" property="payFeesMoney" />
        <result column="pay_fees_time" property="payFeesTime" />
        <result column="pay_fees_type" property="payFeesType" />
        <result column="bill_type" property="billType" />
        <result column="over_days" property="overDays" />
        <result column="payable_fees_penalty" property="payableFeesPenalty" />
        <result column="start_time" property="startTime" />
        <result column="end_time" property="endTime" />
        <result column="bank_serial_number" property="bankSerialNumber" />
        <result column="outstanding_money" property="outstandingMoney" />
        <result column="voucher" property="voucher" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, contract_id,contract_number, payable_fees_money, payable_fees_time, pay_fees_status, pay_fees_money, pay_fees_time, pay_fees_type, bill_type, over_days, payable_fees_penalty, start_time, end_time, bank_serial_number, outstanding_money, voucher, create_time, update_time, create_by, update_by, disabled
    </sql>
 
    <select id="page" resultType="com.ruoyi.system.dto.TBillDto">
        SELECT
            b.*,
            t.resident_name as residentName,
            t.phone,
            t.account
        FROM
            t_bill b
        LEFT JOIN t_contract c ON c.contract_number = b.contract_number
        LEFT JOIN t_tenant t ON t.id = c.tenant_id
        <where>
            <if test="query.payFeesStatus != null">
                and b.pay_fees_status = #{query.payFeesStatus}
            </if>
            <if test="query.phone != null and query.phone !=''">
                and t.phone = #{query.phone}
            </if>
            <if test="query.residentName != null and query.residentName !=''">
                and t.resident_name like concat('%',#{query.residentName},'%')
            </if>
            <if test="query.contractNumber != null and query.contractNumber !=''">
                and b.contract_number = #{contractNumber}
            </if>
        </where>
    </select>
</mapper>