Browse Source

优化代码

java110 4 years ago
parent
commit
72dba0047b

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/owner/OwnerRoomRelDto.java

@@ -20,6 +20,7 @@ public class OwnerRoomRelDto extends PageDto implements Serializable {
     private String state;
     private String ownerId;
     private String ownerName;
+    private String ownerNameLike;
     private String idCard;
     private String link;
     private String userId;
@@ -156,4 +157,12 @@ public class OwnerRoomRelDto extends PageDto implements Serializable {
     public void setEndTime(Date endTime) {
         this.endTime = endTime;
     }
+
+    public String getOwnerNameLike() {
+        return ownerNameLike;
+    }
+
+    public void setOwnerNameLike(String ownerNameLike) {
+        this.ownerNameLike = ownerNameLike;
+    }
 }

+ 8 - 2
java110-db/src/main/resources/mapper/user/OwnerRoomRelServiceDaoImplMapper.xml

@@ -110,7 +110,10 @@
             and bow.status_cd = '0'
         </if>
         <if test="byOwnerInfo == true and ownerName !=null and ownerName != ''">
-            and bow.name like concat('%',#{ownerName},'%')
+            and bow.name = #{ownerName}
+        </if>
+        <if test="byOwnerInfo == true and ownerNameLike !=null and ownerNameLike != ''">
+            and bow.name like concat('%',#{ownerNameLike},'%')
         </if>
         <if test="byOwnerInfo == true and idCard !=null and idCard != ''">
             and bow.id_card = #{idCard}
@@ -197,7 +200,10 @@
             and bow.status_cd = '0'
         </if>
         <if test="byOwnerInfo == true and ownerName !=null and ownerName != ''">
-            and bow.name like concat('%',#{ownerName},'%')
+            and bow.name = #{ownerName}
+        </if>
+        <if test="byOwnerInfo == true and ownerNameLike !=null and ownerNameLike != ''">
+            and bow.name like concat('%',#{ownerNameLike},'%')
         </if>
         <if test="byOwnerInfo == true and idCard !=null and idCard != ''">
             and bow.id_card = #{idCard}

+ 1 - 1
service-api/src/main/java/com/java110/api/listener/fee/ListRoomsWhereFeeSetListener.java

@@ -75,7 +75,7 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
 
         ApiRoomVo apiRoomVo = new ApiRoomVo();
         //根据 业主来定位房屋信息
-        if (reqJson.containsKey("ownerName") || reqJson.containsKey("idCard")) {
+        if (reqJson.containsKey("ownerName") || reqJson.containsKey("idCard") || reqJson.containsKey("ownerNameLike")) {
             queryRoomByOwnerInfo(apiRoomVo, reqJson, context);
             return;
         }