SweepCodeMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.bofeng.dao.SweepCodeMapper">
  4. <select id="selectCode" resultType="com.bofeng.entity.SysUptownHouse">
  5. select DISTINCT
  6. a.uptown_name,
  7. d.ridgepole,
  8. d.unit,
  9. e.doorplate,
  10. b.door_name,
  11. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  12. c.in_type,
  13. c.go_status as goStatus,
  14. c.error_info as errorInfo,
  15. c.longitude,
  16. c.latitude,
  17. g.linkman,
  18. g.phone,
  19. c.time_update
  20. from out_scan c
  21. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  22. inner join sys_uptown_home g on g.house_id = t.property_id
  23. inner join sys_uptown a on c.uptown_id = a.uptown_id
  24. inner join sys_uptown_door b on c.door_id = b.door_id
  25. inner join sys_uptown_house e on e.house_id = t.property_id
  26. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  27. <where>
  28. <if test="queryProperties != null and queryProperties != ''">
  29. b.door_name like concat('%',#{queryProperties},'%')
  30. </if>
  31. <if test="phone != null and phone != ''">
  32. and (g.linkman like concat('%',#{phone},'%')
  33. or g.phone = #{phone} )
  34. </if>
  35. <if test="uptownId != null and uptownId != ''">
  36. and a.uptown_id = #{uptownId}
  37. </if>
  38. <if test="goStatus != null and goStatus !=''">
  39. and c.go_status = #{goStatus}
  40. </if>
  41. <if test="dateSta != null and dateSta !=''">
  42. and c.date >= #{dateSta}
  43. </if>
  44. <if test="dateEnd != null and dateEnd !=''">
  45. and c.date &lt; #{dateEnd}
  46. </if>
  47. </where>
  48. order by c.time_update desc
  49. </select>
  50. <select id="selectLingyunUser" resultType="com.bofeng.entity.SysUptownHouse">
  51. select
  52. b.user_id,
  53. a.linkman,
  54. a.phone,
  55. c.doorplate,
  56. e.uptown_name,
  57. concat(d.ridgepole,d.unit) as dept
  58. from sys_uptown_home a
  59. inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
  60. inner join sys_uptown_house c on c.house_id = b.property_id
  61. inner join sys_uptown_unit d on c.unit_id = d.unit_id
  62. inner join sys_uptown e on e.uptown_id = d.uptown_id
  63. <where>
  64. <if test="queryProperties != null and queryProperties != ''">
  65. (a.linkman like concat('%',#{queryProperties},'%')
  66. or a.phone like concat('%',#{queryProperties},'%'))
  67. </if>
  68. <if test="uptownId != null and uptownId != ''">
  69. and e.uptown_id = #{uptownId}
  70. </if>
  71. <if test="unitId != null and unitId != ''">
  72. and d.unit_id = #{unitId}
  73. </if>
  74. </where>
  75. </select>
  76. <select id="export" resultType="com.bofeng.entity.SysUptownHouse">
  77. select DISTINCT
  78. a.uptown_name,
  79. d.ridgepole,
  80. d.unit,
  81. e.doorplate,
  82. b.door_name,
  83. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  84. c.in_type,
  85. c.go_status as goStatus,
  86. c.error_info as errorInfo,
  87. c.longitude,
  88. c.latitude,
  89. g.linkman,
  90. g.phone,
  91. c.time_update
  92. from out_scan c
  93. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  94. inner join sys_uptown_home g on g.house_id = t.property_id
  95. inner join sys_uptown a on c.uptown_id = a.uptown_id
  96. inner join sys_uptown_door b on c.door_id = b.door_id
  97. inner join sys_uptown_house e on e.house_id = t.property_id
  98. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  99. <where>
  100. <if test="queryProperties != null and queryProperties != ''">
  101. b.door_name like concat('%',#{queryProperties},'%')
  102. </if>
  103. <if test="phone != null and phone != ''">
  104. and (g.linkman like concat('%',#{phone},'%')
  105. or g.phone = #{phone} )
  106. </if>
  107. <if test="uptownId != null and uptownId != ''">
  108. and a.uptown_id = #{uptownId}
  109. </if>
  110. <if test="goStatus != null and goStatus !=''">
  111. and c.go_status = #{goStatus}
  112. </if>
  113. <if test="dateSta != null and dateSta !=''">
  114. and c.date >= #{dateSta}
  115. </if>
  116. <if test="dateEnd != null and dateEnd !=''">
  117. and c.date &lt; #{dateEnd}
  118. </if>
  119. </where>
  120. order by c.time_update desc
  121. </select>
  122. <select id="selectCodeLY" resultType="com.bofeng.entity.SysUptownHouseLY">
  123. select DISTINCT
  124. a.uptown_name,
  125. CONCAT(d.ridgepole,d.unit) as unit,
  126. e.doorplate,
  127. b.door_name,
  128. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  129. c.in_type,
  130. c.go_status as goStatus,
  131. c.error_info as errorInfo,
  132. c.longitude,
  133. c.latitude,
  134. g.linkman,
  135. g.phone,
  136. c.time_update
  137. from out_scan c
  138. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  139. inner join sys_uptown_home g on g.house_id = t.property_id
  140. inner join sys_uptown a on c.uptown_id = a.uptown_id
  141. inner join sys_uptown_door b on c.door_id = b.door_id
  142. inner join sys_uptown_house e on e.house_id = t.property_id
  143. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  144. <where>
  145. a.uptown_id = 1238790987234
  146. <if test="queryProperties != null and queryProperties != ''">
  147. and b.door_name like concat('%',#{queryProperties},'%')
  148. </if>
  149. <if test="phone != null and phone != ''">
  150. and (g.linkman like concat('%',#{phone},'%')
  151. or g.phone = #{phone} )
  152. </if>
  153. <if test="unitId != null and unitId != ''">
  154. and d.unit_id = #{unitId}
  155. </if>
  156. <if test="goStatus != null and goStatus !=''">
  157. and c.go_status = #{goStatus}
  158. </if>
  159. <if test="dateSta != null and dateSta !=''">
  160. and c.date >= #{dateSta}
  161. </if>
  162. <if test="dateEnd != null and dateEnd !=''">
  163. and c.date &lt; #{dateEnd}
  164. </if>
  165. </where>
  166. order by c.time_update desc
  167. </select>
  168. <select id="exportLY" resultType="com.bofeng.entity.SysUptownHouseLY">
  169. select DISTINCT
  170. a.uptown_name,
  171. CONCAT(d.ridgepole,d.unit) as unit,
  172. e.doorplate,
  173. b.door_name,
  174. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  175. c.in_type,
  176. c.go_status as goStatus,
  177. c.error_info as errorInfo,
  178. c.longitude,
  179. c.latitude,
  180. g.linkman,
  181. g.phone,
  182. c.time_update
  183. from out_scan c
  184. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  185. inner join sys_uptown_home g on g.house_id = t.property_id
  186. inner join sys_uptown a on c.uptown_id = a.uptown_id
  187. inner join sys_uptown_door b on c.door_id = b.door_id
  188. inner join sys_uptown_house e on e.house_id = t.property_id
  189. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  190. <where>
  191. a.uptown_id = 1238790987234
  192. <if test="queryProperties != null and queryProperties != ''">
  193. and b.door_name like concat('%',#{queryProperties},'%')
  194. </if>
  195. <if test="phone != null and phone != ''">
  196. and (g.linkman like concat('%',#{phone},'%')
  197. or g.phone = #{phone} )
  198. </if>
  199. <if test="unitId != null and unitId != ''">
  200. and d.unit_id = #{unitId}
  201. </if>
  202. <if test="goStatus != null and goStatus !=''">
  203. and c.go_status = #{goStatus}
  204. </if>
  205. <if test="dateSta != null and dateSta !=''">
  206. and c.date >= #{dateSta}
  207. </if>
  208. <if test="dateEnd != null and dateEnd !=''">
  209. and c.date &lt; #{dateEnd}
  210. </if>
  211. </where>
  212. order by c.time_update desc
  213. </select>
  214. <select id="selectCodeHC" resultType="com.bofeng.entity.SysUptownHouseLY">
  215. select DISTINCT
  216. a.uptown_name,
  217. CONCAT(d.ridgepole,d.unit) as unit,
  218. e.doorplate,
  219. b.door_name,
  220. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  221. c.in_type,
  222. c.go_status as goStatus,
  223. c.error_info as errorInfo,
  224. c.longitude,
  225. c.latitude,
  226. g.linkman,
  227. g.phone,
  228. c.time_update
  229. from out_scan c
  230. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  231. inner join sys_uptown_home g on g.house_id = t.property_id
  232. inner join sys_uptown a on c.uptown_id = a.uptown_id
  233. inner join sys_uptown_door b on c.door_id = b.door_id
  234. inner join sys_uptown_house e on e.house_id = t.property_id
  235. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  236. <where>
  237. a.uptown_id = 100000002
  238. <if test="queryProperties != null and queryProperties != ''">
  239. and b.door_name like concat('%',#{queryProperties},'%')
  240. </if>
  241. <if test="phone != null and phone != ''">
  242. and (g.linkman like concat('%',#{phone},'%')
  243. or g.phone = #{phone} )
  244. </if>
  245. <if test="unitId != null and unitId != ''">
  246. and d.unit_id = #{unitId}
  247. </if>
  248. <if test="goStatus != null and goStatus !=''">
  249. and c.go_status = #{goStatus}
  250. </if>
  251. <if test="dateSta != null and dateSta !=''">
  252. and c.date >= #{dateSta}
  253. </if>
  254. <if test="dateEnd != null and dateEnd !=''">
  255. and c.date &lt; #{dateEnd}
  256. </if>
  257. </where>
  258. order by c.time_update desc
  259. </select>
  260. <select id="exportHC" resultType="com.bofeng.entity.SysUptownHouseLY">
  261. select DISTINCT
  262. a.uptown_name,
  263. CONCAT(d.ridgepole,d.unit) as unit,
  264. e.doorplate,
  265. b.door_name,
  266. DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
  267. c.in_type,
  268. c.go_status as goStatus,
  269. c.error_info as errorInfo,
  270. c.longitude,
  271. c.latitude,
  272. g.linkman,
  273. g.phone,
  274. c.time_update
  275. from out_scan c
  276. inner join sys_user_role t on c.user_id = t.user_id and role_id =1
  277. inner join sys_uptown_home g on g.house_id = t.property_id
  278. inner join sys_uptown a on c.uptown_id = a.uptown_id
  279. inner join sys_uptown_door b on c.door_id = b.door_id
  280. inner join sys_uptown_house e on e.house_id = t.property_id
  281. inner join sys_uptown_unit d on d.unit_id = e.unit_id
  282. <where>
  283. a.uptown_id = 100000002
  284. <if test="queryProperties != null and queryProperties != ''">
  285. and b.door_name like concat('%',#{queryProperties},'%')
  286. </if>
  287. <if test="phone != null and phone != ''">
  288. and (g.linkman like concat('%',#{phone},'%')
  289. or g.phone = #{phone} )
  290. </if>
  291. <if test="unitId != null and unitId != ''">
  292. and d.unit_id = #{unitId}
  293. </if>
  294. <if test="goStatus != null and goStatus !=''">
  295. and c.go_status = #{goStatus}
  296. </if>
  297. <if test="dateSta != null and dateSta !=''">
  298. and c.date >= #{dateSta}
  299. </if>
  300. <if test="dateEnd != null and dateEnd !=''">
  301. and c.date &lt; #{dateEnd}
  302. </if>
  303. </where>
  304. order by c.time_update desc
  305. </select>
  306. </mapper>