无关风月
2025-02-08 bd7d053beb9ba667a7842080661c6cc49be4fa69
ruoyi-system/src/main/resources/mapper/system/TContractMapper.xml
@@ -9,7 +9,7 @@
        <result column="contract_name" property="contractName" />
        <result column="start_time" property="startTime" />
        <result column="end_time" property="endTime" />
        <result column="total_rent" property="totalRent" />
        <result column="month_rent" property="monthRent" />
        <result column="deposit" property="deposit" />
        <result column="pay_type" property="payType" />
        <result column="first_pay_time" property="firstPayTime" />
@@ -32,11 +32,17 @@
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
        <result column="memory" property="memory" />
        <result column="contract_file_name" property="contractFileName" />
        <result column="signature" property="signature" />
        <result column="terminate_remark" property="terminateRemark" />
        <result column="total_year" property="totalYear" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, contract_number, contract_name, start_time, end_time, total_rent, deposit, pay_type, first_pay_time, isIncreasing, isIncreasing_deposit, proportion, house_id, party_one_name, party_one_person, party_one_phone, tenant_id, party_two_name, party_two_person, party_two_phone, contract_file, remark, status, create_time, update_time, create_by, update_by, disabled
        id, contract_number, contract_name, start_time, end_time, month_rent, deposit, pay_type, first_pay_time, isIncreasing, isIncreasing_deposit, proportion, house_id, party_one_name, party_one_person, party_one_phone, tenant_id, party_two_name, party_two_person, party_two_phone, contract_file, remark, status, create_time, update_time, create_by, update_by, disabled,
            memory, contract_file_name, signature, terminate_remark, total_year
    </sql>
    <select id="contractList" resultType="com.ruoyi.system.model.TContract">
        select t1.* from t_contract t1
@@ -57,5 +63,28 @@
        </where>
    </select>
    <select id="contractAppletList" resultType="com.ruoyi.system.model.TContract">
        select t1.* from t_contract t1
        <where>
            <if test="query.status != null">
                and t1.status = #{query.status}
            </if>
            <if test="query.tenantId != null">
                and t1.tenant_id = #{query.tenantId}
            </if>
            AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
    </select>
    <select id="contractBillList" resultType="com.ruoyi.system.vo.BillVO">
        select t1.*,t2.contract_number as contractNumber,t3.resident_name as residentName,t3.phone as phone
        from t_bill t1
        left join t_contract t2 on t1.contract_id = t2.id
        left join t_resident t3 on t2.tenant_id = t3.id
        where t2.id = #{query.id}
        and (t1.pay_fees_status = 1 or t1.pay_fees_status = 4)
        AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        AND t2.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        AND t3.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
    </select>
</mapper>