xuhy
2025-02-20 b9c032d96e236d9c45ca748be63a327755b82a06
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
62
63
64
65
66
67
68
69
70
71
72
73
74
<?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.TTenantMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TTenant">
        <id column="id" property="id" />
        <result column="resident_name" property="residentName" />
        <result column="checkIn_time" property="checkinTime" />
        <result column="tenant_attributes" property="tenantAttributes" />
        <result column="tenant_type" property="tenantType" />
        <result column="phone" property="phone" />
        <result column="id_card" property="idCard" />
        <result column="email" property="email" />
        <result column="bank_number" property="bankNumber" />
        <result column="mail_address" property="mailAddress" />
        <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" />
        <result column="account" property="account" />
        <result column="password" property="password" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, resident_name, checkIn_time, tenant_attributes, tenant_type, phone, id_card, email,
            bank_number, mail_address, create_time, update_time, create_by, update_by, disabled,account,password
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TenantVO">
        SELECT id, resident_name, checkIn_time, tenant_attributes, tenant_type, phone, id_card, email,
        bank_number, mail_address, create_time, disabled,account
        FROM t_tenant
        <where>
            <if test="query.residentName != null and query.residentName != ''">
                AND resident_name LIKE concat('%',#{query.residentName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                AND phone LIKE concat('%',#{query.phone},'%')
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="pageListApplet" resultType="com.ruoyi.system.vo.TenantVO">
        SELECT id, resident_name, checkIn_time, tenant_attributes, tenant_type, phone, id_card, email,
        bank_number, mail_address, create_time, disabled,account
        FROM t_tenant
        <where>
            <if test="query.residentNameOrPhone != null and query.residentNameOrPhone != ''">
                AND (resident_name LIKE concat('%',#{query.residentNameOrPhone},'%')or phone LIKE concat('%',#{query.residentNameOrPhone},'%'))
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="listBill" resultType="com.ruoyi.system.vo.TBillVO">
        select t1.* from
                     t_bill t1
        where 1=1
        <if test="query.payFeesStatus != null and query.payFeesStatus != ''">
          AND t1.pay_fees_status = #{query.payFeesStatus}
        </if>
        <if test="null != query.contractIds and query.contractIds.size() > 0">
            and t1.contract_id in
            <foreach collection="query.contractIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
    </select>
 
</mapper>