From 55d677758efadb6d42e6d4e595cecc2c50c20d5a Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Sat, 23 Dec 2023 17:19:12 +0800
Subject: [PATCH] bug修复
---
src/main/java/org/springblade/modules/house/mapper/HouseTenantMapper.xml | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/house/mapper/HouseTenantMapper.xml b/src/main/java/org/springblade/modules/house/mapper/HouseTenantMapper.xml
index fc26e32..74127e4 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseTenantMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseTenantMapper.xml
@@ -15,10 +15,40 @@
<result column="is_deleted" property="isDeleted"/>
</resultMap>
+ <sql id="selectHouseTenant">
+ select
+ id,
+ housing_rental_id,
+ name,
+ phone,
+ id_card,
+ domicile,
+ work_unit,
+ remark,
+ is_deleted
+ from
+ jczz_house_tenant
+ </sql>
+
<select id="selectHouseTenantPage" resultMap="houseTenantResultMap">
- select * from jczz_house_tenant where is_deleted = 0
+ <include refid="selectHouseTenant"/>
+ <where>
+ <if test="houseTenant.id != null "> and id = #{houseTenant.id}</if>
+ <if test="houseTenant.housingRentalId != null "> and housing_rental_id = #{houseTenant.housingRentalId}</if>
+ <if test="houseTenant.name != null and name != ''"> and name = #{houseTenant.name}</if>
+ <if test="houseTenant.phone != null and phone != ''"> and phone = #{houseTenant.phone}</if>
+ <if test="houseTenant.idCard != null and idCard != ''"> and id_card = #{houseTenant.idCard}</if>
+ <if test="houseTenant.domicile != null and domicile != ''"> and domicile = #{houseTenant.domicile}</if>
+ <if test="houseTenant.workUnit != null and workUnit != ''"> and work_unit = #{houseTenant.workUnit}</if>
+ <if test="houseTenant.remark != null and remark != ''"> and remark = #{houseTenant.remark}</if>
+ <if test="houseTenant.isDeleted != null "> and is_deleted = #{houseTenant.isDeleted}</if>
+ </where>
</select>
+ <!--根据租房id删除租户信息-->
+ <update id="removeByHousingRentalId">
+ update jczz_house_tenant set is_deleted = 1 where housing_rental_id = #{housingRentalId}
+ </update>
</mapper>
--
Gitblit v1.9.3