Просмотр исходного кода

访客登记页面修正b_id错误

duckweed лет назад: 7
Родитель
Сommit
0c9db7d87c

+ 2 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/VisitServiceDaoImpl.java

@@ -6,9 +6,11 @@ import com.java110.common.exception.DAOException;
 import com.java110.common.util.DateUtil;
 import com.java110.community.dao.IVisitServiceDao;
 import com.java110.core.base.dao.BaseServiceDao;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;

+ 12 - 10
CommunityService/src/main/java/com/java110/community/listener/visit/AbstractVisitBusinessServiceDataFlowListener.java

@@ -5,8 +5,10 @@ import com.java110.common.constant.ResponseConstant;
 import com.java110.common.constant.StatusConstant;
 import com.java110.common.exception.ListenerExecuteException;
 import com.java110.community.dao.IVisitServiceDao;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.entity.center.Business;
 import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,17 +39,17 @@ public abstract class AbstractVisitBusinessServiceDataFlowListener extends Abstr
      */
     protected void flushBusinessVisitInfo(Map businessVisitInfo, String statusCd) {
         businessVisitInfo.put("newBId", businessVisitInfo.get("b_id"));
-        businessVisitInfo.put("vId", businessVisitInfo.get("v_id"));
         businessVisitInfo.put("departureTime", businessVisitInfo.get("departure_time"));
+        businessVisitInfo.put("visitGender", businessVisitInfo.get("visit_gender"));
+        businessVisitInfo.put("ownerId", businessVisitInfo.get("owner_id"));
+        businessVisitInfo.put("userId", businessVisitInfo.get("user_id"));
+        businessVisitInfo.put("vId", businessVisitInfo.get("v_id"));
         businessVisitInfo.put("visitTime", businessVisitInfo.get("visit_time"));
-        businessVisitInfo.put("phoneNumber", businessVisitInfo.get("phoneNumber"));
+        businessVisitInfo.put("phoneNumber", businessVisitInfo.get("phone_number"));
         businessVisitInfo.put("operate", businessVisitInfo.get("operate"));
         businessVisitInfo.put("name", businessVisitInfo.get("name"));
         businessVisitInfo.put("visitCase", businessVisitInfo.get("visit_case"));
         businessVisitInfo.put("communityId", businessVisitInfo.get("community_id"));
-        businessVisitInfo.put("visitGender", businessVisitInfo.get("visit_gender"));
-        businessVisitInfo.put("ownerId", businessVisitInfo.get("owner_id"));
-        businessVisitInfo.put("userId", businessVisitInfo.get("userId"));
         businessVisitInfo.remove("bId");
         businessVisitInfo.put("statusCd", statusCd);
     }
@@ -72,17 +74,17 @@ public abstract class AbstractVisitBusinessServiceDataFlowListener extends Abstr
 
         currentVisitInfo.put("bId", business.getbId());
 
-        currentVisitInfo.put("vId", currentVisitInfo.get("v_id"));
         currentVisitInfo.put("departureTime", currentVisitInfo.get("departure_time"));
+        currentVisitInfo.put("visitGender", currentVisitInfo.get("visit_gender"));
+        currentVisitInfo.put("ownerId", currentVisitInfo.get("owner_id"));
+        currentVisitInfo.put("userId", currentVisitInfo.get("user_id"));
+        currentVisitInfo.put("vId", currentVisitInfo.get("v_id"));
         currentVisitInfo.put("visitTime", currentVisitInfo.get("visit_time"));
-        currentVisitInfo.put("phoneNumber", currentVisitInfo.get("phoneNumber"));
+        currentVisitInfo.put("phoneNumber", currentVisitInfo.get("phone_number"));
         currentVisitInfo.put("operate", currentVisitInfo.get("operate"));
         currentVisitInfo.put("name", currentVisitInfo.get("name"));
         currentVisitInfo.put("visitCase", currentVisitInfo.get("visit_case"));
         currentVisitInfo.put("communityId", currentVisitInfo.get("community_id"));
-        currentVisitInfo.put("visitGender", currentVisitInfo.get("visit_gender"));
-        currentVisitInfo.put("ownerId", currentVisitInfo.get("owner_id"));
-        currentVisitInfo.put("userId", currentVisitInfo.get("userId"));
 
 
         currentVisitInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 1 - 0
CommunityService/src/main/java/com/java110/community/listener/visit/UpdateVisitInfoListener.java

@@ -11,6 +11,7 @@ import com.java110.community.dao.IVisitServiceDao;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.entity.center.Business;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 1
CommunityService/src/main/java/com/java110/community/smo/impl/VisitInnerServiceSMOImpl.java

@@ -2,11 +2,13 @@ package com.java110.community.smo.impl;
 
 
 import com.java110.common.util.BeanConvertUtil;
+
 import com.java110.community.dao.IVisitServiceDao;
 import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.core.smo.user.IUserInnerServiceSMO;
 import com.java110.core.smo.visit.IVisitInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
 import com.java110.dto.PageDto;
+
 import com.java110.dto.UserDto;
 import com.java110.dto.visit.VisitDto;
 import org.springframework.beans.factory.annotation.Autowired;

+ 45 - 49
java110-bean/src/main/java/com/java110/dto/visit/VisitDto.java

@@ -15,42 +15,29 @@ import java.util.Date;
  **/
 public class VisitDto extends PageDto implements Serializable {
 
-    private String vId;
-    private String name;
+    private String departureTime;
     private String visitGender;
-    private String phoneNumber;
-    private String userId;
-    private String communityId;
     private String ownerId;
+    private String userId;
+    private String vId;
+    private String visitTime;
+    private String phoneNumber;
+    private String name;
     private String visitCase;
-    private Date visitTime;
-    private Date departureTime;
-    private Date createTime;
-    private String bId;
-    private String statusCd = "0";
+    private String communityId;
 
-    public String getbId() {
-        return bId;
-    }
 
-    public void setbId(String bId) {
-        this.bId = bId;
-    }
+    private Date createTime;
 
-    public String getvId() {
-        return vId;
-    }
+    private String statusCd = "0";
 
-    public void setvId(String vId) {
-        this.vId = vId;
-    }
 
-    public String getName() {
-        return name;
+    public String getDepartureTime() {
+        return departureTime;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setDepartureTime(String departureTime) {
+        this.departureTime = departureTime;
     }
 
     public String getVisitGender() {
@@ -61,12 +48,12 @@ public class VisitDto extends PageDto implements Serializable {
         this.visitGender = visitGender;
     }
 
-    public String getPhoneNumber() {
-        return phoneNumber;
+    public String getOwnerId() {
+        return ownerId;
     }
 
-    public void setPhoneNumber(String phoneNumber) {
-        this.phoneNumber = phoneNumber;
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
     }
 
     public String getUserId() {
@@ -77,20 +64,36 @@ public class VisitDto extends PageDto implements Serializable {
         this.userId = userId;
     }
 
-    public String getCommunityId() {
-        return communityId;
+    public String getVId() {
+        return vId;
     }
 
-    public void setCommunityId(String communityId) {
-        this.communityId = communityId;
+    public void setVId(String vId) {
+        this.vId = vId;
     }
 
-    public String getOwnerId() {
-        return ownerId;
+    public String getVisitTime() {
+        return visitTime;
     }
 
-    public void setOwnerId(String ownerId) {
-        this.ownerId = ownerId;
+    public void setVisitTime(String visitTime) {
+        this.visitTime = visitTime;
+    }
+
+    public String getPhoneNumber() {
+        return phoneNumber;
+    }
+
+    public void setPhoneNumber(String phoneNumber) {
+        this.phoneNumber = phoneNumber;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
     }
 
     public String getVisitCase() {
@@ -101,21 +104,14 @@ public class VisitDto extends PageDto implements Serializable {
         this.visitCase = visitCase;
     }
 
-    public Date getVisitTime() {
-        return visitTime;
-    }
-
-    public void setVisitTime(Date visitTime) {
-        this.visitTime = visitTime;
+    public String getCommunityId() {
+        return communityId;
     }
 
-    public Date getDepartureTime() {
-        return departureTime;
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
     }
 
-    public void setDepartureTime(Date departureTime) {
-        this.departureTime = departureTime;
-    }
 
     public Date getCreateTime() {
         return createTime;

+ 1 - 0
java110-code-generator/src/main/java/com/java110/VisitGeneratorApplication.java

@@ -50,6 +50,7 @@ public class VisitGeneratorApplication {
         param.put("departureTime", "departure_time");
         param.put("statusCd", "status_cd");
         param.put("operate", "operate");
+        param.put("bId", "b_id");
         data.setParams(param);
         GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener();
         generatorSaveInfoListener.generator(data);

+ 1 - 0
java110-core/src/main/java/com/java110/core/smo/visit/IVisitInnerServiceSMO.java

@@ -2,6 +2,7 @@ package com.java110.core.smo.visit;
 
 import com.java110.core.feign.FeignConfiguration;
 
+
 import com.java110.dto.visit.VisitDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;

+ 209 - 197
java110-db/src/main/resources/mapper/visit/VisitServiceDaoImplMapper.xml

@@ -5,230 +5,242 @@
 <mapper namespace="visitServiceDaoImpl">
 
     <!-- 保存访客信息信息 add by wuxw 2018-07-03 -->
-    <insert id="saveBusinessVisitInfo" parameterType="Map">
+       <insert id="saveBusinessVisitInfo" parameterType="Map">
            insert into business_visit_info(
-v_id,departure_time,visit_time,phone_number,operate,name,visit_case,community_id,visit_gender,owner_id,user_id
+departure_time,visit_gender,owner_id,user_id,v_id,visit_time,phone_number,operate,name,visit_case,community_id,b_id
 ) values (
-#{vId},#{departureTime},#{visitTime},#{phoneNumber},#{operate},#{name},#{visitCase},#{communityId},#{visitGender},#{ownerId},#{userId}
+#{departureTime},#{visitGender},#{ownerId},#{userId},#{vId},NOW(),#{phoneNumber},#{operate},#{name},#{visitCase},#{communityId},#{bId}
 )
        </insert>
 
 
-    <!-- 查询访客信息信息(Business) add by wuxw 2018-07-03 -->
-    <select id="getBusinessVisitInfo" parameterType="Map" resultType="Map">
-        select t.v_id,t.v_id vId,t.departure_time,t.departure_time departureTime,t.visit_time,t.visit_time
-        visitTime,t.phone_number,t.phone_number phoneNumber,t.operate,t.name,t.visit_case,t.visit_case
-        visitCase,t.community_id,t.community_id communityId,t.visit_gender,t.visit_gender
-        visitGender,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id userId
-        from business_visit_info t
-        where 1 =1
-        <if test="vId !=null and vId != ''">
-            and t.v_id= #{vId}
-        </if>
-        <if test="departureTime !=null and departureTime != ''">
-            and t.departure_time= #{departureTime}
-        </if>
-        <if test="visitTime !=null and visitTime != ''">
-            and t.visit_time= #{visitTime}
-        </if>
-        <if test="phoneNumber !=null and phoneNumber != ''">
-            and t.phone_number= #{phoneNumber}
-        </if>
-        <if test="operate !=null and operate != ''">
-            and t.operate= #{operate}
-        </if>
-        <if test="name !=null and name != ''">
-            and t.name= #{name}
-        </if>
-        <if test="visitCase !=null and visitCase != ''">
-            and t.visit_case= #{visitCase}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            and t.community_id= #{communityId}
-        </if>
-        <if test="visitGender !=null and visitGender != ''">
-            and t.visit_gender= #{visitGender}
-        </if>
-        <if test="ownerId !=null and ownerId != ''">
-            and t.owner_id= #{ownerId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            and t.user_id= #{userId}
-        </if>
+       <!-- 查询访客信息信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessVisitInfo" parameterType="Map" resultType="Map">
+           select  t.departure_time,t.departure_time departureTime,t.visit_gender,t.visit_gender visitGender,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id userId,t.v_id,t.v_id vId,t.visit_time,t.visit_time visitTime,t.phone_number,t.phone_number phoneNumber,t.operate,t.name,t.visit_case,t.visit_case visitCase,t.community_id,t.community_id communityId,t.b_id,t.b_id bId 
+from business_visit_info t 
+where 1 =1 
+<if test="departureTime !=null and departureTime != ''">
+   and t.departure_time= #{departureTime}
+</if> 
+<if test="visitGender !=null and visitGender != ''">
+   and t.visit_gender= #{visitGender}
+</if> 
+<if test="ownerId !=null and ownerId != ''">
+   and t.owner_id= #{ownerId}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="vId !=null and vId != ''">
+   and t.v_id= #{vId}
+</if> 
+<if test="visitTime !=null and visitTime != ''">
+   and t.visit_time= #{visitTime}
+</if> 
+<if test="phoneNumber !=null and phoneNumber != ''">
+   and t.phone_number= #{phoneNumber}
+</if> 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="visitCase !=null and visitCase != ''">
+   and t.visit_case= #{visitCase}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+
+       </select>
+
+
 
-    </select>
 
 
     <!-- 保存访客信息信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveVisitInfoInstance" parameterType="Map">
         insert into s_visit_info(
-        v_id,departure_time,visit_time,phone_number,name,visit_case,status_cd,community_id,visit_gender,owner_id,user_id
-        ) select
-        t.v_id,t.departure_time,t.visit_time,t.phone_number,t.name,t.visit_case,'0',t.community_id,t.visit_gender,t.owner_id,t.user_id
-        from business_visit_info t where 1=1
-        <if test="vId !=null and vId != ''">
-            and t.v_id= #{vId}
-        </if>
-        <if test="departureTime !=null and departureTime != ''">
-            and t.departure_time= #{departureTime}
-        </if>
-        <if test="visitTime !=null and visitTime != ''">
-            and t.visit_time= #{visitTime}
-        </if>
-        <if test="phoneNumber !=null and phoneNumber != ''">
-            and t.phone_number= #{phoneNumber}
-        </if>
-        and t.operate= 'ADD'
-        <if test="name !=null and name != ''">
-            and t.name= #{name}
-        </if>
-        <if test="visitCase !=null and visitCase != ''">
-            and t.visit_case= #{visitCase}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            and t.community_id= #{communityId}
-        </if>
-        <if test="visitGender !=null and visitGender != ''">
-            and t.visit_gender= #{visitGender}
-        </if>
-        <if test="ownerId !=null and ownerId != ''">
-            and t.owner_id= #{ownerId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            and t.user_id= #{userId}
-        </if>
+departure_time,status_cd,visit_gender,owner_id,user_id,v_id,visit_time,phone_number,name,visit_case,community_id,b_id
+) select t.departure_time,'0',t.visit_gender,t.owner_id,t.user_id,t.v_id,t.visit_time,t.phone_number,t.name,t.visit_case,t.community_id,t.b_id from business_visit_info t where 1=1
+<if test="departureTime !=null and departureTime != ''">
+   and t.departure_time= #{departureTime}
+</if> 
+<if test="visitGender !=null and visitGender != ''">
+   and t.visit_gender= #{visitGender}
+</if> 
+<if test="ownerId !=null and ownerId != ''">
+   and t.owner_id= #{ownerId}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="vId !=null and vId != ''">
+   and t.v_id= #{vId}
+</if> 
+<if test="visitTime !=null and visitTime != ''">
+   and t.visit_time= #{visitTime}
+</if> 
+<if test="phoneNumber !=null and phoneNumber != ''">
+   and t.phone_number= #{phoneNumber}
+</if> 
+   and t.operate= 'ADD'
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="visitCase !=null and visitCase != ''">
+   and t.visit_case= #{visitCase}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
 
     </insert>
 
 
+
     <!-- 查询访客信息信息 add by wuxw 2018-07-03 -->
     <select id="getVisitInfo" parameterType="Map" resultType="Map">
-        select t.v_id,t.v_id vId,t.departure_time,t.departure_time departureTime,t.visit_time,t.visit_time
-        visitTime,t.phone_number,t.phone_number phoneNumber,t.name,t.visit_case,t.visit_case
-        visitCase,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
-        communityId,t.visit_gender,t.visit_gender visitGender,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id userId
-        from s_visit_info t
-        where 1 =1
-        <if test="vId !=null and vId != ''">
-            and t.v_id= #{vId}
-        </if>
-        <if test="departureTime !=null and departureTime != ''">
-            and t.departure_time= #{departureTime}
-        </if>
-        <if test="visitTime !=null and visitTime != ''">
-            and t.visit_time= #{visitTime}
-        </if>
-        <if test="phoneNumber !=null and phoneNumber != ''">
-            and t.phone_number= #{phoneNumber}
-        </if>
-        <if test="name !=null and name != ''">
-            and t.name= #{name}
-        </if>
-        <if test="visitCase !=null and visitCase != ''">
-            and t.visit_case= #{visitCase}
-        </if>
-        <if test="statusCd !=null and statusCd != ''">
-            and t.status_cd= #{statusCd}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            and t.community_id= #{communityId}
-        </if>
-        <if test="visitGender !=null and visitGender != ''">
-            and t.visit_gender= #{visitGender}
-        </if>
-        <if test="ownerId !=null and ownerId != ''">
-            and t.owner_id= #{ownerId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            and t.user_id= #{userId}
-        </if>
-        <if test="page != -1 and page != null ">
-            limit #{page},#{row}
-        </if>
+        select  t.departure_time,t.departure_time departureTime,t.status_cd,t.status_cd statusCd,t.visit_gender,t.visit_gender visitGender,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id userId,t.v_id,t.v_id vId,t.visit_time,t.visit_time visitTime,t.phone_number,t.phone_number phoneNumber,t.name,t.visit_case,t.visit_case visitCase,t.community_id,t.community_id communityId,t.b_id,t.b_id bId 
+from s_visit_info t 
+where 1 =1 
+<if test="departureTime !=null and departureTime != ''">
+   and t.departure_time= #{departureTime}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="visitGender !=null and visitGender != ''">
+   and t.visit_gender= #{visitGender}
+</if> 
+<if test="ownerId !=null and ownerId != ''">
+   and t.owner_id= #{ownerId}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="vId !=null and vId != ''">
+   and t.v_id= #{vId}
+</if> 
+<if test="visitTime !=null and visitTime != ''">
+   and t.visit_time= #{visitTime}
+</if> 
+<if test="phoneNumber !=null and phoneNumber != ''">
+   and t.phone_number= #{phoneNumber}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="visitCase !=null and visitCase != ''">
+   and t.visit_case= #{visitCase}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
 
     </select>
 
 
+
+
     <!-- 修改访客信息信息 add by wuxw 2018-07-03 -->
     <update id="updateVisitInfoInstance" parameterType="Map">
-        update s_visit_info t set t.status_cd = #{statusCd}
-        <if test="newBId != null and newBId != ''">
-            ,t.b_id = #{newBId}
-        </if>
-        <if test="departureTime !=null and departureTime != ''">
-            , t.departure_time= #{departureTime}
-        </if>
-        <if test="visitTime !=null and visitTime != ''">
-            , t.visit_time= #{visitTime}
-        </if>
-        <if test="phoneNumber !=null and phoneNumber != ''">
-            , t.phone_number= #{phoneNumber}
-        </if>
-        <if test="name !=null and name != ''">
-            , t.name= #{name}
-        </if>
-        <if test="visitCase !=null and visitCase != ''">
-            , t.visit_case= #{visitCase}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            , t.community_id= #{communityId}
-        </if>
-        <if test="visitGender !=null and visitGender != ''">
-            , t.visit_gender= #{visitGender}
-        </if>
-        <if test="ownerId !=null and ownerId != ''">
-            , t.owner_id= #{ownerId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            , t.user_id= #{userId}
-        </if>
-        where 1=1
-        <if test="vId !=null and vId != ''">
-            and t.v_id= #{vId}
-        </if>
+        update  s_visit_info t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="departureTime !=null and departureTime != ''">
+, t.departure_time= #{departureTime}
+</if> 
+<if test="visitGender !=null and visitGender != ''">
+, t.visit_gender= #{visitGender}
+</if> 
+<if test="ownerId !=null and ownerId != ''">
+, t.owner_id= #{ownerId}
+</if> 
+<if test="userId !=null and userId != ''">
+, t.user_id= #{userId}
+</if> 
+<if test="visitTime !=null and visitTime != ''">
+, t.visit_time= #{visitTime}
+</if> 
+<if test="phoneNumber !=null and phoneNumber != ''">
+, t.phone_number= #{phoneNumber}
+</if> 
+<if test="name !=null and name != ''">
+, t.name= #{name}
+</if> 
+<if test="visitCase !=null and visitCase != ''">
+, t.visit_case= #{visitCase}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+ where 1=1 <if test="vId !=null and vId != ''">
+and t.v_id= #{vId}
+</if> 
+<if test="bId !=null and bId != ''">
+and t.b_id= #{bId}
+</if> 
 
     </update>
 
     <!-- 查询访客信息数量 add by wuxw 2018-07-03 -->
-    <select id="queryVisitsCount" parameterType="Map" resultType="Map">
-        select count(1) count
-        from s_visit_info t
-        where 1 =1
-        <if test="vId !=null and vId != ''">
-            and t.v_id= #{vId}
-        </if>
-        <if test="departureTime !=null and departureTime != ''">
-            and t.departure_time= #{departureTime}
-        </if>
-        <if test="visitTime !=null and visitTime != ''">
-            and t.visit_time= #{visitTime}
-        </if>
-        <if test="phoneNumber !=null and phoneNumber != ''">
-            and t.phone_number= #{phoneNumber}
-        </if>
-        <if test="name !=null and name != ''">
-            and t.name= #{name}
-        </if>
-        <if test="visitCase !=null and visitCase != ''">
-            and t.visit_case= #{visitCase}
-        </if>
-        <if test="statusCd !=null and statusCd != ''">
-            and t.status_cd= #{statusCd}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            and t.community_id= #{communityId}
-        </if>
-        <if test="visitGender !=null and visitGender != ''">
-            and t.visit_gender= #{visitGender}
-        </if>
-        <if test="ownerId !=null and ownerId != ''">
-            and t.owner_id= #{ownerId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            and t.user_id= #{userId}
-        </if>
-
-
-    </select>
+     <select id="queryVisitsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from s_visit_info t 
+where 1 =1 
+<if test="departureTime !=null and departureTime != ''">
+   and t.departure_time= #{departureTime}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="visitGender !=null and visitGender != ''">
+   and t.visit_gender= #{visitGender}
+</if> 
+<if test="ownerId !=null and ownerId != ''">
+   and t.owner_id= #{ownerId}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="vId !=null and vId != ''">
+   and t.v_id= #{vId}
+</if> 
+<if test="visitTime !=null and visitTime != ''">
+   and t.visit_time= #{visitTime}
+</if> 
+<if test="phoneNumber !=null and phoneNumber != ''">
+   and t.phone_number= #{phoneNumber}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="visitCase !=null and visitCase != ''">
+   and t.visit_case= #{visitCase}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+
+
+     </select>
 
 </mapper>