VisitServiceDaoImplMapper.xml 9.3 KB

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