VisitServiceDaoImplMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="visitServiceDaoImpl">
  6. <!-- 保存访客信息信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessVisitInfo" parameterType="Map">
  8. insert into business_visit_info(
  9. departure_time,visit_gender,owner_id,user_id,v_id,visit_time,phone_number,operate,name,visit_case,community_id,b_id
  10. ) values (
  11. #{departureTime},#{visitGender},#{ownerId},#{userId},#{vId},NOW(),#{phoneNumber},#{operate},#{name},#{visitCase},#{communityId},#{bId}
  12. )
  13. </insert>
  14. <!-- 查询访客信息信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessVisitInfo" parameterType="Map" resultType="Map">
  16. 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
  17. from business_visit_info t
  18. where 1 =1
  19. <if test="departureTime !=null and departureTime != ''">
  20. and t.departure_time= #{departureTime}
  21. </if>
  22. <if test="visitGender !=null and visitGender != ''">
  23. and t.visit_gender= #{visitGender}
  24. </if>
  25. <if test="ownerId !=null and ownerId != ''">
  26. and t.owner_id= #{ownerId}
  27. </if>
  28. <if test="userId !=null and userId != ''">
  29. and t.user_id= #{userId}
  30. </if>
  31. <if test="vId !=null and vId != ''">
  32. and t.v_id= #{vId}
  33. </if>
  34. <if test="visitTime !=null and visitTime != ''">
  35. and t.visit_time= #{visitTime}
  36. </if>
  37. <if test="phoneNumber !=null and phoneNumber != ''">
  38. and t.phone_number= #{phoneNumber}
  39. </if>
  40. <if test="operate !=null and operate != ''">
  41. and t.operate= #{operate}
  42. </if>
  43. <if test="name !=null and name != ''">
  44. and t.name= #{name}
  45. </if>
  46. <if test="visitCase !=null and visitCase != ''">
  47. and t.visit_case= #{visitCase}
  48. </if>
  49. <if test="communityId !=null and communityId != ''">
  50. and t.community_id= #{communityId}
  51. </if>
  52. <if test="bId !=null and bId != ''">
  53. and t.b_id= #{bId}
  54. </if>
  55. </select>
  56. <!-- 保存访客信息信息至 instance表中 add by wuxw 2018-07-03 -->
  57. <insert id="saveVisitInfoInstance" parameterType="Map">
  58. insert into s_visit_info(
  59. departure_time,status_cd,visit_gender,owner_id,user_id,v_id,visit_time,phone_number,name,visit_case,community_id,b_id
  60. ) 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
  61. <if test="departureTime !=null and departureTime != ''">
  62. and t.departure_time= #{departureTime}
  63. </if>
  64. <if test="visitGender !=null and visitGender != ''">
  65. and t.visit_gender= #{visitGender}
  66. </if>
  67. <if test="ownerId !=null and ownerId != ''">
  68. and t.owner_id= #{ownerId}
  69. </if>
  70. <if test="userId !=null and userId != ''">
  71. and t.user_id= #{userId}
  72. </if>
  73. <if test="vId !=null and vId != ''">
  74. and t.v_id= #{vId}
  75. </if>
  76. <if test="visitTime !=null and visitTime != ''">
  77. and t.visit_time= #{visitTime}
  78. </if>
  79. <if test="phoneNumber !=null and phoneNumber != ''">
  80. and t.phone_number= #{phoneNumber}
  81. </if>
  82. and t.operate= 'ADD'
  83. <if test="name !=null and name != ''">
  84. and t.name= #{name}
  85. </if>
  86. <if test="visitCase !=null and visitCase != ''">
  87. and t.visit_case= #{visitCase}
  88. </if>
  89. <if test="communityId !=null and communityId != ''">
  90. and t.community_id= #{communityId}
  91. </if>
  92. <if test="bId !=null and bId != ''">
  93. and t.b_id= #{bId}
  94. </if>
  95. </insert>
  96. <!-- 查询访客信息信息 add by wuxw 2018-07-03 -->
  97. <select id="getVisitInfo" parameterType="Map" resultType="Map">
  98. 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
  99. from s_visit_info t
  100. where 1 =1
  101. <if test="departureTime !=null and departureTime != ''">
  102. and t.departure_time= #{departureTime}
  103. </if>
  104. <if test="statusCd !=null and statusCd != ''">
  105. and t.status_cd= #{statusCd}
  106. </if>
  107. <if test="visitGender !=null and visitGender != ''">
  108. and t.visit_gender= #{visitGender}
  109. </if>
  110. <if test="ownerId !=null and ownerId != ''">
  111. and t.owner_id= #{ownerId}
  112. </if>
  113. <if test="userId !=null and userId != ''">
  114. and t.user_id= #{userId}
  115. </if>
  116. <if test="vId !=null and vId != ''">
  117. and t.v_id= #{vId}
  118. </if>
  119. <if test="visitTime !=null and visitTime != ''">
  120. and t.visit_time= #{visitTime}
  121. </if>
  122. <if test="phoneNumber !=null and phoneNumber != ''">
  123. and t.phone_number= #{phoneNumber}
  124. </if>
  125. <if test="name !=null and name != ''">
  126. and t.name= #{name}
  127. </if>
  128. <if test="visitCase !=null and visitCase != ''">
  129. and t.visit_case= #{visitCase}
  130. </if>
  131. <if test="communityId !=null and communityId != ''">
  132. and t.community_id= #{communityId}
  133. </if>
  134. <if test="bId !=null and bId != ''">
  135. and t.b_id= #{bId}
  136. </if>
  137. <if test="page != -1 and page != null ">
  138. limit #{page}, #{row}
  139. </if>
  140. </select>
  141. <!-- 修改访客信息信息 add by wuxw 2018-07-03 -->
  142. <update id="updateVisitInfoInstance" parameterType="Map">
  143. update s_visit_info t set t.status_cd = #{statusCd}
  144. <if test="newBId != null and newBId != ''">
  145. ,t.b_id = #{newBId}
  146. </if>
  147. <if test="departureTime !=null and departureTime != ''">
  148. , t.departure_time= #{departureTime}
  149. </if>
  150. <if test="visitGender !=null and visitGender != ''">
  151. , t.visit_gender= #{visitGender}
  152. </if>
  153. <if test="ownerId !=null and ownerId != ''">
  154. , t.owner_id= #{ownerId}
  155. </if>
  156. <if test="userId !=null and userId != ''">
  157. , t.user_id= #{userId}
  158. </if>
  159. <if test="visitTime !=null and visitTime != ''">
  160. , t.visit_time= #{visitTime}
  161. </if>
  162. <if test="phoneNumber !=null and phoneNumber != ''">
  163. , t.phone_number= #{phoneNumber}
  164. </if>
  165. <if test="name !=null and name != ''">
  166. , t.name= #{name}
  167. </if>
  168. <if test="visitCase !=null and visitCase != ''">
  169. , t.visit_case= #{visitCase}
  170. </if>
  171. <if test="communityId !=null and communityId != ''">
  172. , t.community_id= #{communityId}
  173. </if>
  174. where 1=1 <if test="vId !=null and vId != ''">
  175. and t.v_id= #{vId}
  176. </if>
  177. <if test="bId !=null and bId != ''">
  178. and t.b_id= #{bId}
  179. </if>
  180. </update>
  181. <!-- 查询访客信息数量 add by wuxw 2018-07-03 -->
  182. <select id="queryVisitsCount" parameterType="Map" resultType="Map">
  183. select count(1) count
  184. from s_visit_info t
  185. where 1 =1
  186. <if test="departureTime !=null and departureTime != ''">
  187. and t.departure_time= #{departureTime}
  188. </if>
  189. <if test="statusCd !=null and statusCd != ''">
  190. and t.status_cd= #{statusCd}
  191. </if>
  192. <if test="visitGender !=null and visitGender != ''">
  193. and t.visit_gender= #{visitGender}
  194. </if>
  195. <if test="ownerId !=null and ownerId != ''">
  196. and t.owner_id= #{ownerId}
  197. </if>
  198. <if test="userId !=null and userId != ''">
  199. and t.user_id= #{userId}
  200. </if>
  201. <if test="vId !=null and vId != ''">
  202. and t.v_id= #{vId}
  203. </if>
  204. <if test="visitTime !=null and visitTime != ''">
  205. and t.visit_time= #{visitTime}
  206. </if>
  207. <if test="phoneNumber !=null and phoneNumber != ''">
  208. and t.phone_number= #{phoneNumber}
  209. </if>
  210. <if test="name !=null and name != ''">
  211. and t.name= #{name}
  212. </if>
  213. <if test="visitCase !=null and visitCase != ''">
  214. and t.visit_case= #{visitCase}
  215. </if>
  216. <if test="communityId !=null and communityId != ''">
  217. and t.community_id= #{communityId}
  218. </if>
  219. <if test="bId !=null and bId != ''">
  220. and t.b_id= #{bId}
  221. </if>
  222. </select>
  223. </mapper>