AccessControlWhiteV1ServiceDaoImplMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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="accessControlWhiteV1ServiceDaoImpl">
  6. <!-- 保存门禁白名单信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveAccessControlWhiteInfo" parameterType="Map">
  8. insert into access_control_white(
  9. third_id,id_card,access_control_key,person_name,machine_id,acw_id,person_id,tel,start_time,end_time,community_id,person_type
  10. ) values (
  11. #{thirdId},#{idCard},#{accessControlKey},#{personName},#{machineId},#{acwId},#{personId},#{tel},#{startTime},#{endTime},#{communityId},#{personType}
  12. )
  13. </insert>
  14. <!-- 查询门禁白名单信息 add by wuxw 2018-07-03 -->
  15. <select id="getAccessControlWhiteInfo" parameterType="Map" resultType="Map">
  16. select t.third_id,t.third_id thirdId,t.id_card,t.id_card idCard,t.access_control_key,t.access_control_key
  17. accessControlKey,t.status_cd,t.status_cd statusCd,t.person_name,t.person_name
  18. personName,t.machine_id,t.machine_id machineId,t.acw_id,t.acw_id acwId,t.person_id,t.person_id
  19. personId,t.tel,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
  20. communityId,t.person_type,t.person_type personType,t.create_time createTime,m.machine_code,m.machine_name machineName
  21. from access_control_white t
  22. left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
  23. where 1 =1
  24. <if test="thirdId !=null and thirdId != ''">
  25. and t.third_id= #{thirdId}
  26. </if>
  27. <if test="idCard !=null and idCard != ''">
  28. and t.id_card= #{idCard}
  29. </if>
  30. <if test="accessControlKey !=null and accessControlKey != ''">
  31. and t.access_control_key= #{accessControlKey}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="personName !=null and personName != ''">
  37. and t.person_name= #{personName}
  38. </if>
  39. <if test="machineId !=null and machineId != ''">
  40. and t.machine_id= #{machineId}
  41. </if>
  42. <if test="acwId !=null and acwId != ''">
  43. and t.acw_id= #{acwId}
  44. </if>
  45. <if test="personId !=null and personId != ''">
  46. and t.person_id= #{personId}
  47. </if>
  48. <if test="tel !=null and tel != ''">
  49. and t.tel= #{tel}
  50. </if>
  51. <if test="startTime !=null and startTime != ''">
  52. and t.start_time= #{startTime}
  53. </if>
  54. <if test="endTime !=null and endTime != ''">
  55. and t.end_time= #{endTime}
  56. </if>
  57. <if test="communityId !=null and communityId != ''">
  58. and t.community_id= #{communityId}
  59. </if>
  60. <if test="personType !=null and personType != ''">
  61. and t.person_type= #{personType}
  62. </if>
  63. order by t.create_time desc
  64. <if test="page != -1 and page != null ">
  65. limit #{page}, #{row}
  66. </if>
  67. </select>
  68. <!-- 修改门禁白名单信息 add by wuxw 2018-07-03 -->
  69. <update id="updateAccessControlWhiteInfo" parameterType="Map">
  70. update access_control_white t set t.status_cd = #{statusCd}
  71. <if test="newBId != null and newBId != ''">
  72. ,t.b_id = #{newBId}
  73. </if>
  74. <if test="thirdId !=null and thirdId != ''">
  75. , t.third_id= #{thirdId}
  76. </if>
  77. <if test="idCard !=null and idCard != ''">
  78. , t.id_card= #{idCard}
  79. </if>
  80. <if test="accessControlKey !=null and accessControlKey != ''">
  81. , t.access_control_key= #{accessControlKey}
  82. </if>
  83. <if test="personName !=null and personName != ''">
  84. , t.person_name= #{personName}
  85. </if>
  86. <if test="machineId !=null and machineId != ''">
  87. , t.machine_id= #{machineId}
  88. </if>
  89. <if test="personId !=null and personId != ''">
  90. , t.person_id= #{personId}
  91. </if>
  92. <if test="tel !=null and tel != ''">
  93. , t.tel= #{tel}
  94. </if>
  95. <if test="startTime !=null and startTime != ''">
  96. , t.start_time= #{startTime}
  97. </if>
  98. <if test="endTime !=null and endTime != ''">
  99. , t.end_time= #{endTime}
  100. </if>
  101. <if test="communityId !=null and communityId != ''">
  102. , t.community_id= #{communityId}
  103. </if>
  104. <if test="personType !=null and personType != ''">
  105. , t.person_type= #{personType}
  106. </if>
  107. where 1=1
  108. <if test="acwId !=null and acwId != ''">
  109. and t.acw_id= #{acwId}
  110. </if>
  111. </update>
  112. <!-- 查询门禁白名单数量 add by wuxw 2018-07-03 -->
  113. <select id="queryAccessControlWhitesCount" parameterType="Map" resultType="Map">
  114. select count(1) count
  115. from access_control_white t
  116. where 1 =1
  117. <if test="thirdId !=null and thirdId != ''">
  118. and t.third_id= #{thirdId}
  119. </if>
  120. <if test="idCard !=null and idCard != ''">
  121. and t.id_card= #{idCard}
  122. </if>
  123. <if test="accessControlKey !=null and accessControlKey != ''">
  124. and t.access_control_key= #{accessControlKey}
  125. </if>
  126. <if test="statusCd !=null and statusCd != ''">
  127. and t.status_cd= #{statusCd}
  128. </if>
  129. <if test="personName !=null and personName != ''">
  130. and t.person_name= #{personName}
  131. </if>
  132. <if test="machineId !=null and machineId != ''">
  133. and t.machine_id= #{machineId}
  134. </if>
  135. <if test="acwId !=null and acwId != ''">
  136. and t.acw_id= #{acwId}
  137. </if>
  138. <if test="personId !=null and personId != ''">
  139. and t.person_id= #{personId}
  140. </if>
  141. <if test="tel !=null and tel != ''">
  142. and t.tel= #{tel}
  143. </if>
  144. <if test="startTime !=null and startTime != ''">
  145. and t.start_time= #{startTime}
  146. </if>
  147. <if test="endTime !=null and endTime != ''">
  148. and t.end_time= #{endTime}
  149. </if>
  150. <if test="communityId !=null and communityId != ''">
  151. and t.community_id= #{communityId}
  152. </if>
  153. <if test="personType !=null and personType != ''">
  154. and t.person_type= #{personType}
  155. </if>
  156. </select>
  157. </mapper>