BuildingMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  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.huaxu.zoniot.dao.BuildingMapper">
  4. <resultMap id="BaseResultMap" type="com.huaxu.zoniot.entity.Building">
  5. <!--@mbg.generated-->
  6. <!--@Table sc_building-->
  7. <id column="id" jdbcType="INTEGER" property="id" />
  8. <result column="site_id" jdbcType="INTEGER" property="siteId" />
  9. <result column="name" jdbcType="VARCHAR" property="name" />
  10. <result column="address" jdbcType="VARCHAR" property="address" />
  11. <result column="contact_penson" jdbcType="VARCHAR" property="contactPenson" />
  12. <result column="completion_date" jdbcType="TIMESTAMP" property="completionDate" />
  13. <result column="contact_phone" jdbcType="VARCHAR" property="contactPhone" />
  14. <result column="access_unit_id" jdbcType="INTEGER" property="accessUnitId" />
  15. <result column="province" jdbcType="INTEGER" property="province" />
  16. <result column="city" jdbcType="INTEGER" property="city" />
  17. <result column="region" jdbcType="INTEGER" property="region" />
  18. <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
  19. <result column="region_code" jdbcType="VARCHAR" property="regionCode" />
  20. <result column="door_no" jdbcType="VARCHAR" property="doorNo" />
  21. <result column="road_name" jdbcType="VARCHAR" property="roadName" />
  22. <result column="stree_no" jdbcType="VARCHAR" property="streeNo" />
  23. <result column="buildl_no" jdbcType="VARCHAR" property="buildlNo" />
  24. <result column="longitude" jdbcType="DECIMAL" property="longitude" />
  25. <result column="latitude" jdbcType="DECIMAL" property="latitude" />
  26. <result column="highly" jdbcType="VARCHAR" property="highly" />
  27. <result column="building_area" jdbcType="VARCHAR" property="buildingArea" />
  28. <result column="building_category" jdbcType="INTEGER" property="buildingCategory" />
  29. <result column="building_structure" jdbcType="INTEGER" property="buildingStructure" />
  30. <result column="fire_rating" jdbcType="INTEGER" property="fireRating" />
  31. <result column="risk_rating" jdbcType="INTEGER" property="riskRating" />
  32. <result column="has_control_roon" jdbcType="INTEGER" property="hasControlRoon" />
  33. <result column="control_roon_loc" jdbcType="VARCHAR" property="controlRoonLoc" />
  34. <result column="building_usage" jdbcType="INTEGER" property="buildingUsage" />
  35. <result column="building_usage_cla" jdbcType="VARCHAR" property="buildingUsageCla" />
  36. <result column="rights" jdbcType="INTEGER" property="rights" />
  37. <result column="cover_area" jdbcType="VARCHAR" property="coverArea" />
  38. <result column="stand_bed_area" jdbcType="VARCHAR" property="standBedArea" />
  39. <result column="under_floor_num" jdbcType="INTEGER" property="underFloorNum" />
  40. <result column="under_floor_area" jdbcType="VARCHAR" property="underFloorArea" />
  41. <result column="floor_num" jdbcType="INTEGER" property="floorNum" />
  42. <result column="floor_area" jdbcType="VARCHAR" property="floorArea" />
  43. <result column="asylum_floor_num" jdbcType="VARCHAR" property="asylumFloorNum" />
  44. <result column="asylum_floor_area" jdbcType="VARCHAR" property="asylumFloorArea" />
  45. <result column="asylum_floor_loc" jdbcType="VARCHAR" property="asylumFloorLoc" />
  46. <result column="fire_lift_num" jdbcType="VARCHAR" property="fireLiftNum" />
  47. <result column="fire_lift_loc" jdbcType="VARCHAR" property="fireLiftLoc" />
  48. <result column="check_in_func" jdbcType="VARCHAR" property="checkInFunc" />
  49. <result column="max_capacity" jdbcType="VARCHAR" property="maxCapacity" />
  50. <result column="has_auto_equipme" jdbcType="INTEGER" property="hasAutoEquipme" />
  51. <result column="equipment_status" jdbcType="VARCHAR" property="equipmentStatus" />
  52. <result column="equipment_desc" jdbcType="VARCHAR" property="equipmentDesc" />
  53. <result column="beside_buildind_desc" jdbcType="VARCHAR" property="besideBuildindDesc" />
  54. <result column="geography" jdbcType="VARCHAR" property="geography" />
  55. <result column="status" jdbcType="BOOLEAN" property="status" />
  56. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  57. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  58. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  59. <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  60. <result column="community" jdbcType="INTEGER" property="community" />
  61. <result column="unit" jdbcType="VARCHAR" property="unit" />
  62. </resultMap>
  63. <sql id="Base_Column_List">
  64. <!--@mbg.generated-->
  65. id, site_id, `name`, address, contact_penson, completion_date, contact_phone, access_unit_id,
  66. province, city, region, detail_address, region_code, door_no, road_name, stree_no,
  67. buildl_no, longitude, latitude, highly, building_area, building_category, building_structure,
  68. fire_rating, risk_rating, has_control_roon, control_roon_loc, building_usage, building_usage_cla,
  69. rights, cover_area, stand_bed_area, under_floor_num, under_floor_area, floor_num,
  70. floor_area, asylum_floor_num, asylum_floor_area, asylum_floor_loc, fire_lift_num,
  71. fire_lift_loc, check_in_func, max_capacity, has_auto_equipme, equipment_status, equipment_desc,
  72. beside_buildind_desc, geography, `status`, create_date, create_by, update_date, update_by,
  73. community, unit
  74. </sql>
  75. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  76. <!--@mbg.generated-->
  77. select
  78. <include refid="Base_Column_List" />
  79. from sc_building
  80. where id = #{id,jdbcType=INTEGER}
  81. </select>
  82. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  83. <!--@mbg.generated-->
  84. delete from sc_building
  85. where id = #{id,jdbcType=INTEGER}
  86. </delete>
  87. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.huaxu.zoniot.entity.Building" useGeneratedKeys="true">
  88. <!--@mbg.generated-->
  89. insert into sc_building (site_id, `name`, address,
  90. contact_penson, completion_date, contact_phone,
  91. access_unit_id, province, city,
  92. region, detail_address, region_code,
  93. door_no, road_name, stree_no,
  94. buildl_no, longitude, latitude,
  95. highly, building_area, building_category,
  96. building_structure, fire_rating, risk_rating,
  97. has_control_roon, control_roon_loc, building_usage,
  98. building_usage_cla, rights, cover_area,
  99. stand_bed_area, under_floor_num, under_floor_area,
  100. floor_num, floor_area, asylum_floor_num,
  101. asylum_floor_area, asylum_floor_loc, fire_lift_num,
  102. fire_lift_loc, check_in_func, max_capacity,
  103. has_auto_equipme, equipment_status, equipment_desc,
  104. beside_buildind_desc, geography, `status`,
  105. create_date, create_by, update_date,
  106. update_by, community, unit
  107. )
  108. values (#{siteId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
  109. #{contactPenson,jdbcType=VARCHAR}, #{completionDate,jdbcType=TIMESTAMP}, #{contactPhone,jdbcType=VARCHAR},
  110. #{accessUnitId,jdbcType=INTEGER}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
  111. #{region,jdbcType=INTEGER}, #{detailAddress,jdbcType=VARCHAR}, #{regionCode,jdbcType=VARCHAR},
  112. #{doorNo,jdbcType=VARCHAR}, #{roadName,jdbcType=VARCHAR}, #{streeNo,jdbcType=VARCHAR},
  113. #{buildlNo,jdbcType=VARCHAR}, #{longitude,jdbcType=DECIMAL}, #{latitude,jdbcType=DECIMAL},
  114. #{highly,jdbcType=VARCHAR}, #{buildingArea,jdbcType=VARCHAR}, #{buildingCategory,jdbcType=INTEGER},
  115. #{buildingStructure,jdbcType=INTEGER}, #{fireRating,jdbcType=INTEGER}, #{riskRating,jdbcType=INTEGER},
  116. #{hasControlRoon,jdbcType=INTEGER}, #{controlRoonLoc,jdbcType=VARCHAR}, #{buildingUsage,jdbcType=INTEGER},
  117. #{buildingUsageCla,jdbcType=VARCHAR}, #{rights,jdbcType=INTEGER}, #{coverArea,jdbcType=VARCHAR},
  118. #{standBedArea,jdbcType=VARCHAR}, #{underFloorNum,jdbcType=INTEGER}, #{underFloorArea,jdbcType=VARCHAR},
  119. #{floorNum,jdbcType=INTEGER}, #{floorArea,jdbcType=VARCHAR}, #{asylumFloorNum,jdbcType=VARCHAR},
  120. #{asylumFloorArea,jdbcType=VARCHAR}, #{asylumFloorLoc,jdbcType=VARCHAR}, #{fireLiftNum,jdbcType=VARCHAR},
  121. #{fireLiftLoc,jdbcType=VARCHAR}, #{checkInFunc,jdbcType=VARCHAR}, #{maxCapacity,jdbcType=VARCHAR},
  122. #{hasAutoEquipme,jdbcType=INTEGER}, #{equipmentStatus,jdbcType=VARCHAR}, #{equipmentDesc,jdbcType=VARCHAR},
  123. #{besideBuildindDesc,jdbcType=VARCHAR}, #{geography,jdbcType=VARCHAR}, #{status,jdbcType=BOOLEAN},
  124. #{createDate,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP},
  125. #{updateBy,jdbcType=VARCHAR}, #{community,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}
  126. )
  127. </insert>
  128. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.huaxu.zoniot.entity.Building" useGeneratedKeys="true">
  129. <!--@mbg.generated-->
  130. insert into sc_building
  131. <trim prefix="(" suffix=")" suffixOverrides=",">
  132. <if test="siteId != null">
  133. site_id,
  134. </if>
  135. <if test="name != null">
  136. `name`,
  137. </if>
  138. <if test="address != null">
  139. address,
  140. </if>
  141. <if test="contactPenson != null">
  142. contact_penson,
  143. </if>
  144. <if test="completionDate != null">
  145. completion_date,
  146. </if>
  147. <if test="contactPhone != null">
  148. contact_phone,
  149. </if>
  150. <if test="accessUnitId != null">
  151. access_unit_id,
  152. </if>
  153. <if test="province != null">
  154. province,
  155. </if>
  156. <if test="city != null">
  157. city,
  158. </if>
  159. <if test="region != null">
  160. region,
  161. </if>
  162. <if test="detailAddress != null">
  163. detail_address,
  164. </if>
  165. <if test="regionCode != null">
  166. region_code,
  167. </if>
  168. <if test="doorNo != null">
  169. door_no,
  170. </if>
  171. <if test="roadName != null">
  172. road_name,
  173. </if>
  174. <if test="streeNo != null">
  175. stree_no,
  176. </if>
  177. <if test="buildlNo != null">
  178. buildl_no,
  179. </if>
  180. <if test="longitude != null">
  181. longitude,
  182. </if>
  183. <if test="latitude != null">
  184. latitude,
  185. </if>
  186. <if test="highly != null">
  187. highly,
  188. </if>
  189. <if test="buildingArea != null">
  190. building_area,
  191. </if>
  192. <if test="buildingCategory != null">
  193. building_category,
  194. </if>
  195. <if test="buildingStructure != null">
  196. building_structure,
  197. </if>
  198. <if test="fireRating != null">
  199. fire_rating,
  200. </if>
  201. <if test="riskRating != null">
  202. risk_rating,
  203. </if>
  204. <if test="hasControlRoon != null">
  205. has_control_roon,
  206. </if>
  207. <if test="controlRoonLoc != null">
  208. control_roon_loc,
  209. </if>
  210. <if test="buildingUsage != null">
  211. building_usage,
  212. </if>
  213. <if test="buildingUsageCla != null">
  214. building_usage_cla,
  215. </if>
  216. <if test="rights != null">
  217. rights,
  218. </if>
  219. <if test="coverArea != null">
  220. cover_area,
  221. </if>
  222. <if test="standBedArea != null">
  223. stand_bed_area,
  224. </if>
  225. <if test="underFloorNum != null">
  226. under_floor_num,
  227. </if>
  228. <if test="underFloorArea != null">
  229. under_floor_area,
  230. </if>
  231. <if test="floorNum != null">
  232. floor_num,
  233. </if>
  234. <if test="floorArea != null">
  235. floor_area,
  236. </if>
  237. <if test="asylumFloorNum != null">
  238. asylum_floor_num,
  239. </if>
  240. <if test="asylumFloorArea != null">
  241. asylum_floor_area,
  242. </if>
  243. <if test="asylumFloorLoc != null">
  244. asylum_floor_loc,
  245. </if>
  246. <if test="fireLiftNum != null">
  247. fire_lift_num,
  248. </if>
  249. <if test="fireLiftLoc != null">
  250. fire_lift_loc,
  251. </if>
  252. <if test="checkInFunc != null">
  253. check_in_func,
  254. </if>
  255. <if test="maxCapacity != null">
  256. max_capacity,
  257. </if>
  258. <if test="hasAutoEquipme != null">
  259. has_auto_equipme,
  260. </if>
  261. <if test="equipmentStatus != null">
  262. equipment_status,
  263. </if>
  264. <if test="equipmentDesc != null">
  265. equipment_desc,
  266. </if>
  267. <if test="besideBuildindDesc != null">
  268. beside_buildind_desc,
  269. </if>
  270. <if test="geography != null">
  271. geography,
  272. </if>
  273. <if test="status != null">
  274. `status`,
  275. </if>
  276. <if test="createDate != null">
  277. create_date,
  278. </if>
  279. <if test="createBy != null">
  280. create_by,
  281. </if>
  282. <if test="updateDate != null">
  283. update_date,
  284. </if>
  285. <if test="updateBy != null">
  286. update_by,
  287. </if>
  288. <if test="community != null">
  289. community,
  290. </if>
  291. <if test="unit != null">
  292. unit,
  293. </if>
  294. </trim>
  295. <trim prefix="values (" suffix=")" suffixOverrides=",">
  296. <if test="siteId != null">
  297. #{siteId,jdbcType=INTEGER},
  298. </if>
  299. <if test="name != null">
  300. #{name,jdbcType=VARCHAR},
  301. </if>
  302. <if test="address != null">
  303. #{address,jdbcType=VARCHAR},
  304. </if>
  305. <if test="contactPenson != null">
  306. #{contactPenson,jdbcType=VARCHAR},
  307. </if>
  308. <if test="completionDate != null">
  309. #{completionDate,jdbcType=TIMESTAMP},
  310. </if>
  311. <if test="contactPhone != null">
  312. #{contactPhone,jdbcType=VARCHAR},
  313. </if>
  314. <if test="accessUnitId != null">
  315. #{accessUnitId,jdbcType=INTEGER},
  316. </if>
  317. <if test="province != null">
  318. #{province,jdbcType=INTEGER},
  319. </if>
  320. <if test="city != null">
  321. #{city,jdbcType=INTEGER},
  322. </if>
  323. <if test="region != null">
  324. #{region,jdbcType=INTEGER},
  325. </if>
  326. <if test="detailAddress != null">
  327. #{detailAddress,jdbcType=VARCHAR},
  328. </if>
  329. <if test="regionCode != null">
  330. #{regionCode,jdbcType=VARCHAR},
  331. </if>
  332. <if test="doorNo != null">
  333. #{doorNo,jdbcType=VARCHAR},
  334. </if>
  335. <if test="roadName != null">
  336. #{roadName,jdbcType=VARCHAR},
  337. </if>
  338. <if test="streeNo != null">
  339. #{streeNo,jdbcType=VARCHAR},
  340. </if>
  341. <if test="buildlNo != null">
  342. #{buildlNo,jdbcType=VARCHAR},
  343. </if>
  344. <if test="longitude != null">
  345. #{longitude,jdbcType=DECIMAL},
  346. </if>
  347. <if test="latitude != null">
  348. #{latitude,jdbcType=DECIMAL},
  349. </if>
  350. <if test="highly != null">
  351. #{highly,jdbcType=VARCHAR},
  352. </if>
  353. <if test="buildingArea != null">
  354. #{buildingArea,jdbcType=VARCHAR},
  355. </if>
  356. <if test="buildingCategory != null">
  357. #{buildingCategory,jdbcType=INTEGER},
  358. </if>
  359. <if test="buildingStructure != null">
  360. #{buildingStructure,jdbcType=INTEGER},
  361. </if>
  362. <if test="fireRating != null">
  363. #{fireRating,jdbcType=INTEGER},
  364. </if>
  365. <if test="riskRating != null">
  366. #{riskRating,jdbcType=INTEGER},
  367. </if>
  368. <if test="hasControlRoon != null">
  369. #{hasControlRoon,jdbcType=INTEGER},
  370. </if>
  371. <if test="controlRoonLoc != null">
  372. #{controlRoonLoc,jdbcType=VARCHAR},
  373. </if>
  374. <if test="buildingUsage != null">
  375. #{buildingUsage,jdbcType=INTEGER},
  376. </if>
  377. <if test="buildingUsageCla != null">
  378. #{buildingUsageCla,jdbcType=VARCHAR},
  379. </if>
  380. <if test="rights != null">
  381. #{rights,jdbcType=INTEGER},
  382. </if>
  383. <if test="coverArea != null">
  384. #{coverArea,jdbcType=VARCHAR},
  385. </if>
  386. <if test="standBedArea != null">
  387. #{standBedArea,jdbcType=VARCHAR},
  388. </if>
  389. <if test="underFloorNum != null">
  390. #{underFloorNum,jdbcType=INTEGER},
  391. </if>
  392. <if test="underFloorArea != null">
  393. #{underFloorArea,jdbcType=VARCHAR},
  394. </if>
  395. <if test="floorNum != null">
  396. #{floorNum,jdbcType=INTEGER},
  397. </if>
  398. <if test="floorArea != null">
  399. #{floorArea,jdbcType=VARCHAR},
  400. </if>
  401. <if test="asylumFloorNum != null">
  402. #{asylumFloorNum,jdbcType=VARCHAR},
  403. </if>
  404. <if test="asylumFloorArea != null">
  405. #{asylumFloorArea,jdbcType=VARCHAR},
  406. </if>
  407. <if test="asylumFloorLoc != null">
  408. #{asylumFloorLoc,jdbcType=VARCHAR},
  409. </if>
  410. <if test="fireLiftNum != null">
  411. #{fireLiftNum,jdbcType=VARCHAR},
  412. </if>
  413. <if test="fireLiftLoc != null">
  414. #{fireLiftLoc,jdbcType=VARCHAR},
  415. </if>
  416. <if test="checkInFunc != null">
  417. #{checkInFunc,jdbcType=VARCHAR},
  418. </if>
  419. <if test="maxCapacity != null">
  420. #{maxCapacity,jdbcType=VARCHAR},
  421. </if>
  422. <if test="hasAutoEquipme != null">
  423. #{hasAutoEquipme,jdbcType=INTEGER},
  424. </if>
  425. <if test="equipmentStatus != null">
  426. #{equipmentStatus,jdbcType=VARCHAR},
  427. </if>
  428. <if test="equipmentDesc != null">
  429. #{equipmentDesc,jdbcType=VARCHAR},
  430. </if>
  431. <if test="besideBuildindDesc != null">
  432. #{besideBuildindDesc,jdbcType=VARCHAR},
  433. </if>
  434. <if test="geography != null">
  435. #{geography,jdbcType=VARCHAR},
  436. </if>
  437. <if test="status != null">
  438. #{status,jdbcType=BOOLEAN},
  439. </if>
  440. <if test="createDate != null">
  441. #{createDate,jdbcType=TIMESTAMP},
  442. </if>
  443. <if test="createBy != null">
  444. #{createBy,jdbcType=VARCHAR},
  445. </if>
  446. <if test="updateDate != null">
  447. #{updateDate,jdbcType=TIMESTAMP},
  448. </if>
  449. <if test="updateBy != null">
  450. #{updateBy,jdbcType=VARCHAR},
  451. </if>
  452. <if test="community != null">
  453. #{community,jdbcType=INTEGER},
  454. </if>
  455. <if test="unit != null">
  456. #{unit,jdbcType=VARCHAR},
  457. </if>
  458. </trim>
  459. </insert>
  460. <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.zoniot.entity.Building">
  461. <!--@mbg.generated-->
  462. update sc_building
  463. <set>
  464. <if test="siteId != null">
  465. site_id = #{siteId,jdbcType=INTEGER},
  466. </if>
  467. <if test="name != null">
  468. `name` = #{name,jdbcType=VARCHAR},
  469. </if>
  470. <if test="address != null">
  471. address = #{address,jdbcType=VARCHAR},
  472. </if>
  473. <if test="contactPenson != null">
  474. contact_penson = #{contactPenson,jdbcType=VARCHAR},
  475. </if>
  476. <if test="completionDate != null">
  477. completion_date = #{completionDate,jdbcType=TIMESTAMP},
  478. </if>
  479. <if test="contactPhone != null">
  480. contact_phone = #{contactPhone,jdbcType=VARCHAR},
  481. </if>
  482. <if test="accessUnitId != null">
  483. access_unit_id = #{accessUnitId,jdbcType=INTEGER},
  484. </if>
  485. <if test="province != null">
  486. province = #{province,jdbcType=INTEGER},
  487. </if>
  488. <if test="city != null">
  489. city = #{city,jdbcType=INTEGER},
  490. </if>
  491. <if test="region != null">
  492. region = #{region,jdbcType=INTEGER},
  493. </if>
  494. <if test="detailAddress != null">
  495. detail_address = #{detailAddress,jdbcType=VARCHAR},
  496. </if>
  497. <if test="regionCode != null">
  498. region_code = #{regionCode,jdbcType=VARCHAR},
  499. </if>
  500. <if test="doorNo != null">
  501. door_no = #{doorNo,jdbcType=VARCHAR},
  502. </if>
  503. <if test="roadName != null">
  504. road_name = #{roadName,jdbcType=VARCHAR},
  505. </if>
  506. <if test="streeNo != null">
  507. stree_no = #{streeNo,jdbcType=VARCHAR},
  508. </if>
  509. <if test="buildlNo != null">
  510. buildl_no = #{buildlNo,jdbcType=VARCHAR},
  511. </if>
  512. <if test="longitude != null">
  513. longitude = #{longitude,jdbcType=DECIMAL},
  514. </if>
  515. <if test="latitude != null">
  516. latitude = #{latitude,jdbcType=DECIMAL},
  517. </if>
  518. <if test="highly != null">
  519. highly = #{highly,jdbcType=VARCHAR},
  520. </if>
  521. <if test="buildingArea != null">
  522. building_area = #{buildingArea,jdbcType=VARCHAR},
  523. </if>
  524. <if test="buildingCategory != null">
  525. building_category = #{buildingCategory,jdbcType=INTEGER},
  526. </if>
  527. <if test="buildingStructure != null">
  528. building_structure = #{buildingStructure,jdbcType=INTEGER},
  529. </if>
  530. <if test="fireRating != null">
  531. fire_rating = #{fireRating,jdbcType=INTEGER},
  532. </if>
  533. <if test="riskRating != null">
  534. risk_rating = #{riskRating,jdbcType=INTEGER},
  535. </if>
  536. <if test="hasControlRoon != null">
  537. has_control_roon = #{hasControlRoon,jdbcType=INTEGER},
  538. </if>
  539. <if test="controlRoonLoc != null">
  540. control_roon_loc = #{controlRoonLoc,jdbcType=VARCHAR},
  541. </if>
  542. <if test="buildingUsage != null">
  543. building_usage = #{buildingUsage,jdbcType=INTEGER},
  544. </if>
  545. <if test="buildingUsageCla != null">
  546. building_usage_cla = #{buildingUsageCla,jdbcType=VARCHAR},
  547. </if>
  548. <if test="rights != null">
  549. rights = #{rights,jdbcType=INTEGER},
  550. </if>
  551. <if test="coverArea != null">
  552. cover_area = #{coverArea,jdbcType=VARCHAR},
  553. </if>
  554. <if test="standBedArea != null">
  555. stand_bed_area = #{standBedArea,jdbcType=VARCHAR},
  556. </if>
  557. <if test="underFloorNum != null">
  558. under_floor_num = #{underFloorNum,jdbcType=INTEGER},
  559. </if>
  560. <if test="underFloorArea != null">
  561. under_floor_area = #{underFloorArea,jdbcType=VARCHAR},
  562. </if>
  563. <if test="floorNum != null">
  564. floor_num = #{floorNum,jdbcType=INTEGER},
  565. </if>
  566. <if test="floorArea != null">
  567. floor_area = #{floorArea,jdbcType=VARCHAR},
  568. </if>
  569. <if test="asylumFloorNum != null">
  570. asylum_floor_num = #{asylumFloorNum,jdbcType=VARCHAR},
  571. </if>
  572. <if test="asylumFloorArea != null">
  573. asylum_floor_area = #{asylumFloorArea,jdbcType=VARCHAR},
  574. </if>
  575. <if test="asylumFloorLoc != null">
  576. asylum_floor_loc = #{asylumFloorLoc,jdbcType=VARCHAR},
  577. </if>
  578. <if test="fireLiftNum != null">
  579. fire_lift_num = #{fireLiftNum,jdbcType=VARCHAR},
  580. </if>
  581. <if test="fireLiftLoc != null">
  582. fire_lift_loc = #{fireLiftLoc,jdbcType=VARCHAR},
  583. </if>
  584. <if test="checkInFunc != null">
  585. check_in_func = #{checkInFunc,jdbcType=VARCHAR},
  586. </if>
  587. <if test="maxCapacity != null">
  588. max_capacity = #{maxCapacity,jdbcType=VARCHAR},
  589. </if>
  590. <if test="hasAutoEquipme != null">
  591. has_auto_equipme = #{hasAutoEquipme,jdbcType=INTEGER},
  592. </if>
  593. <if test="equipmentStatus != null">
  594. equipment_status = #{equipmentStatus,jdbcType=VARCHAR},
  595. </if>
  596. <if test="equipmentDesc != null">
  597. equipment_desc = #{equipmentDesc,jdbcType=VARCHAR},
  598. </if>
  599. <if test="besideBuildindDesc != null">
  600. beside_buildind_desc = #{besideBuildindDesc,jdbcType=VARCHAR},
  601. </if>
  602. <if test="geography != null">
  603. geography = #{geography,jdbcType=VARCHAR},
  604. </if>
  605. <if test="status != null">
  606. `status` = #{status,jdbcType=BOOLEAN},
  607. </if>
  608. <if test="createDate != null">
  609. create_date = #{createDate,jdbcType=TIMESTAMP},
  610. </if>
  611. <if test="createBy != null">
  612. create_by = #{createBy,jdbcType=VARCHAR},
  613. </if>
  614. <if test="updateDate != null">
  615. update_date = #{updateDate,jdbcType=TIMESTAMP},
  616. </if>
  617. <if test="updateBy != null">
  618. update_by = #{updateBy,jdbcType=VARCHAR},
  619. </if>
  620. <if test="community != null">
  621. community = #{community,jdbcType=INTEGER},
  622. </if>
  623. <if test="unit != null">
  624. unit = #{unit,jdbcType=VARCHAR},
  625. </if>
  626. </set>
  627. where id = #{id,jdbcType=INTEGER}
  628. </update>
  629. <update id="updateByPrimaryKey" parameterType="com.huaxu.zoniot.entity.Building">
  630. <!--@mbg.generated-->
  631. update sc_building
  632. set site_id = #{siteId,jdbcType=INTEGER},
  633. `name` = #{name,jdbcType=VARCHAR},
  634. address = #{address,jdbcType=VARCHAR},
  635. contact_penson = #{contactPenson,jdbcType=VARCHAR},
  636. completion_date = #{completionDate,jdbcType=TIMESTAMP},
  637. contact_phone = #{contactPhone,jdbcType=VARCHAR},
  638. access_unit_id = #{accessUnitId,jdbcType=INTEGER},
  639. province = #{province,jdbcType=INTEGER},
  640. city = #{city,jdbcType=INTEGER},
  641. region = #{region,jdbcType=INTEGER},
  642. detail_address = #{detailAddress,jdbcType=VARCHAR},
  643. region_code = #{regionCode,jdbcType=VARCHAR},
  644. door_no = #{doorNo,jdbcType=VARCHAR},
  645. road_name = #{roadName,jdbcType=VARCHAR},
  646. stree_no = #{streeNo,jdbcType=VARCHAR},
  647. buildl_no = #{buildlNo,jdbcType=VARCHAR},
  648. longitude = #{longitude,jdbcType=DECIMAL},
  649. latitude = #{latitude,jdbcType=DECIMAL},
  650. highly = #{highly,jdbcType=VARCHAR},
  651. building_area = #{buildingArea,jdbcType=VARCHAR},
  652. building_category = #{buildingCategory,jdbcType=INTEGER},
  653. building_structure = #{buildingStructure,jdbcType=INTEGER},
  654. fire_rating = #{fireRating,jdbcType=INTEGER},
  655. risk_rating = #{riskRating,jdbcType=INTEGER},
  656. has_control_roon = #{hasControlRoon,jdbcType=INTEGER},
  657. control_roon_loc = #{controlRoonLoc,jdbcType=VARCHAR},
  658. building_usage = #{buildingUsage,jdbcType=INTEGER},
  659. building_usage_cla = #{buildingUsageCla,jdbcType=VARCHAR},
  660. rights = #{rights,jdbcType=INTEGER},
  661. cover_area = #{coverArea,jdbcType=VARCHAR},
  662. stand_bed_area = #{standBedArea,jdbcType=VARCHAR},
  663. under_floor_num = #{underFloorNum,jdbcType=INTEGER},
  664. under_floor_area = #{underFloorArea,jdbcType=VARCHAR},
  665. floor_num = #{floorNum,jdbcType=INTEGER},
  666. floor_area = #{floorArea,jdbcType=VARCHAR},
  667. asylum_floor_num = #{asylumFloorNum,jdbcType=VARCHAR},
  668. asylum_floor_area = #{asylumFloorArea,jdbcType=VARCHAR},
  669. asylum_floor_loc = #{asylumFloorLoc,jdbcType=VARCHAR},
  670. fire_lift_num = #{fireLiftNum,jdbcType=VARCHAR},
  671. fire_lift_loc = #{fireLiftLoc,jdbcType=VARCHAR},
  672. check_in_func = #{checkInFunc,jdbcType=VARCHAR},
  673. max_capacity = #{maxCapacity,jdbcType=VARCHAR},
  674. has_auto_equipme = #{hasAutoEquipme,jdbcType=INTEGER},
  675. equipment_status = #{equipmentStatus,jdbcType=VARCHAR},
  676. equipment_desc = #{equipmentDesc,jdbcType=VARCHAR},
  677. beside_buildind_desc = #{besideBuildindDesc,jdbcType=VARCHAR},
  678. geography = #{geography,jdbcType=VARCHAR},
  679. `status` = #{status,jdbcType=BOOLEAN},
  680. create_date = #{createDate,jdbcType=TIMESTAMP},
  681. create_by = #{createBy,jdbcType=VARCHAR},
  682. update_date = #{updateDate,jdbcType=TIMESTAMP},
  683. update_by = #{updateBy,jdbcType=VARCHAR},
  684. community = #{community,jdbcType=INTEGER},
  685. unit = #{unit,jdbcType=VARCHAR}
  686. where id = #{id,jdbcType=INTEGER}
  687. </update>
  688. <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
  689. <!--@mbg.generated-->
  690. insert into sc_building
  691. (site_id, `name`, address, contact_penson, completion_date, contact_phone, access_unit_id,
  692. province, city, region, detail_address, region_code, door_no, road_name, stree_no,
  693. buildl_no, longitude, latitude, highly, building_area, building_category, building_structure,
  694. fire_rating, risk_rating, has_control_roon, control_roon_loc, building_usage, building_usage_cla,
  695. rights, cover_area, stand_bed_area, under_floor_num, under_floor_area, floor_num,
  696. floor_area, asylum_floor_num, asylum_floor_area, asylum_floor_loc, fire_lift_num,
  697. fire_lift_loc, check_in_func, max_capacity, has_auto_equipme, equipment_status,
  698. equipment_desc, beside_buildind_desc, geography, `status`, create_date, create_by,
  699. update_date, update_by, community, unit)
  700. values
  701. <foreach collection="list" item="item" separator=",">
  702. (#{item.siteId,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR}, #{item.address,jdbcType=VARCHAR},
  703. #{item.contactPenson,jdbcType=VARCHAR}, #{item.completionDate,jdbcType=TIMESTAMP},
  704. #{item.contactPhone,jdbcType=VARCHAR}, #{item.accessUnitId,jdbcType=INTEGER}, #{item.province,jdbcType=INTEGER},
  705. #{item.city,jdbcType=INTEGER}, #{item.region,jdbcType=INTEGER}, #{item.detailAddress,jdbcType=VARCHAR},
  706. #{item.regionCode,jdbcType=VARCHAR}, #{item.doorNo,jdbcType=VARCHAR}, #{item.roadName,jdbcType=VARCHAR},
  707. #{item.streeNo,jdbcType=VARCHAR}, #{item.buildlNo,jdbcType=VARCHAR}, #{item.longitude,jdbcType=DECIMAL},
  708. #{item.latitude,jdbcType=DECIMAL}, #{item.highly,jdbcType=VARCHAR}, #{item.buildingArea,jdbcType=VARCHAR},
  709. #{item.buildingCategory,jdbcType=INTEGER}, #{item.buildingStructure,jdbcType=INTEGER},
  710. #{item.fireRating,jdbcType=INTEGER}, #{item.riskRating,jdbcType=INTEGER}, #{item.hasControlRoon,jdbcType=INTEGER},
  711. #{item.controlRoonLoc,jdbcType=VARCHAR}, #{item.buildingUsage,jdbcType=INTEGER},
  712. #{item.buildingUsageCla,jdbcType=VARCHAR}, #{item.rights,jdbcType=INTEGER}, #{item.coverArea,jdbcType=VARCHAR},
  713. #{item.standBedArea,jdbcType=VARCHAR}, #{item.underFloorNum,jdbcType=INTEGER},
  714. #{item.underFloorArea,jdbcType=VARCHAR}, #{item.floorNum,jdbcType=INTEGER}, #{item.floorArea,jdbcType=VARCHAR},
  715. #{item.asylumFloorNum,jdbcType=VARCHAR}, #{item.asylumFloorArea,jdbcType=VARCHAR},
  716. #{item.asylumFloorLoc,jdbcType=VARCHAR}, #{item.fireLiftNum,jdbcType=VARCHAR},
  717. #{item.fireLiftLoc,jdbcType=VARCHAR}, #{item.checkInFunc,jdbcType=VARCHAR}, #{item.maxCapacity,jdbcType=VARCHAR},
  718. #{item.hasAutoEquipme,jdbcType=INTEGER}, #{item.equipmentStatus,jdbcType=VARCHAR},
  719. #{item.equipmentDesc,jdbcType=VARCHAR}, #{item.besideBuildindDesc,jdbcType=VARCHAR},
  720. #{item.geography,jdbcType=VARCHAR}, #{item.status,jdbcType=BOOLEAN}, #{item.createDate,jdbcType=TIMESTAMP},
  721. #{item.createBy,jdbcType=VARCHAR}, #{item.updateDate,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
  722. #{item.community,jdbcType=INTEGER}, #{item.unit,jdbcType=VARCHAR})
  723. </foreach>
  724. </insert>
  725. <select id="findBuildingByName" resultMap="BaseResultMap">
  726. select
  727. <include refid="Base_Column_List" />
  728. from
  729. sc_building
  730. where status = 1
  731. and name = #{name,jdbcType=VARCHAR}
  732. and community = #{communityId,jdbcType=INTEGER}
  733. limit 1
  734. </select>
  735. </mapper>