SysNfcBindMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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="com.xunmei.system.mapper.SysNfcBindMapper">
  6. <resultMap type="com.xunmei.system.domain.SysNfcBind" id="SysNfcBindResult">
  7. <result property="id" column="id"/>
  8. <result property="areaId" column="area_id"/>
  9. <result property="enable" column="enable"/>
  10. <result property="code" column="code"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="updateId" column="update_id"/>
  13. <result property="updateBy" column="update_by"/>
  14. <result property="updateTime" column="update_time"/>
  15. <result property="orgId" column="org_id"/>
  16. <result property="orgName" column="org_name"/>
  17. <result property="orgPath" column="org_path"/>
  18. <result property="collectionAreaName" column="collection_area_name"/>
  19. <result property="checkId" column="check_id"/>
  20. </resultMap>
  21. <sql id="selectSysNfcBindVo">
  22. select id,
  23. area_id,
  24. enable,
  25. code,
  26. create_time,
  27. update_id,
  28. update_by,
  29. update_time,
  30. org_id,
  31. org_name,
  32. org_path,
  33. collection_area_name,
  34. check_id
  35. from sys_nfc_bind
  36. </sql>
  37. <select id="selectSysNfcBindList" parameterType="com.xunmei.system.domain.SysNfcBind"
  38. resultMap="SysNfcBindResult">
  39. <include refid="selectSysNfcBindVo"/>
  40. <where>
  41. <if test="areaId != null ">
  42. and area_id = #{areaId}
  43. </if>
  44. <if test="enable != null ">
  45. and enable = #{enable}
  46. </if>
  47. <if test="code != null and code != ''">
  48. and code = #{code}
  49. </if>
  50. <if test="updateId != null ">
  51. and update_id = #{updateId}
  52. </if>
  53. <if test="orgId != null ">
  54. and org_id = #{orgId}
  55. </if>
  56. <if test="orgName != null and orgName != ''">
  57. and org_name like concat('%', #{orgName}, '%')
  58. </if>
  59. <if test="orgPath != null and orgPath != ''">
  60. and org_path = #{orgPath}
  61. </if>
  62. <if test="collectionAreaName != null and collectionAreaName != ''">
  63. and collection_area_name like concat('%', #{collectionAreaName}, '%')
  64. </if>
  65. <if test="checkId != null ">
  66. and check_id = #{checkId}
  67. </if>
  68. </where>
  69. </select>
  70. <select id="selectSysNfcBindById" parameterType="Long"
  71. resultMap="SysNfcBindResult">
  72. <include refid="selectSysNfcBindVo"/>
  73. where id = #{id}
  74. </select>
  75. <select id="selectNFCPage" resultType="com.xunmei.system.domain.SysNfcBind">
  76. SELECT
  77. a.id,
  78. a.area_id,
  79. a.area_name,
  80. a.enable,
  81. a.del_flag,
  82. a.code,
  83. a.label_name,
  84. a.update_id,
  85. a.org_id,
  86. a.org_name,
  87. a.org_path,
  88. a.collection_area_name,
  89. a.check_id,
  90. a.create_by,
  91. a.create_time,
  92. a.update_by,
  93. a.update_time
  94. FROM
  95. sys_nfc_bind a
  96. LEFT JOIN sys_org b on a.org_id = b.id
  97. WHERE
  98. del_flag = 0
  99. <choose>
  100. <when test="info.checkSub">
  101. AND b.path like concat('%', #{info.orgPath}, '%')
  102. </when>
  103. <otherwise>
  104. AND b.id = #{info.orgId}
  105. </otherwise>
  106. </choose>
  107. <if test="info.areaName != null and info.areaName != ''">
  108. and a.area_name like concat("%",#{info.areaName},"%")
  109. </if>
  110. <if test="info.code != null and info.code != ''">
  111. and a.code like concat("%",#{info.code},"%")
  112. </if>
  113. <if test="info.enable != null and info.enable != ''">
  114. and a.enable = #{info.enable}
  115. </if>
  116. <if test="info.labelName !=null and info.labelName !=''">
  117. and a.label_name=#{info.labelName}
  118. </if>
  119. order by a.org_id,a.area_id,code
  120. </select>
  121. <select id="selectSysNfcBindByCode" resultType="com.xunmei.system.domain.SysNfcBind">
  122. SELECT * FROM sys_nfc_bind WHERE del_flag=0 AND code=#{code}
  123. </select>
  124. <insert id="insertSysNfcBind" parameterType="com.xunmei.system.domain.SysNfcBind">
  125. insert into sys_nfc_bind
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="id != null">id,
  128. </if>
  129. <if test="areaId != null">area_id,
  130. </if>
  131. <if test="enable != null">enable,
  132. </if>
  133. <if test="code != null">code,
  134. </if>
  135. <if test="createTime != null">create_time,
  136. </if>
  137. <if test="updateId != null">update_id,
  138. </if>
  139. <if test="updateBy != null">update_by,
  140. </if>
  141. <if test="updateTime != null">update_time,
  142. </if>
  143. <if test="orgId != null">org_id,
  144. </if>
  145. <if test="orgName != null">org_name,
  146. </if>
  147. <if test="orgPath != null">org_path,
  148. </if>
  149. <if test="collectionAreaName != null">collection_area_name,
  150. </if>
  151. <if test="checkId != null">check_id,
  152. </if>
  153. </trim>
  154. <trim prefix="values (" suffix=")" suffixOverrides=",">
  155. <if test="id != null">#{id},
  156. </if>
  157. <if test="areaId != null">#{areaId},
  158. </if>
  159. <if test="enable != null">#{enable},
  160. </if>
  161. <if test="code != null">#{code},
  162. </if>
  163. <if test="createTime != null">#{createTime},
  164. </if>
  165. <if test="updateId != null">#{updateId},
  166. </if>
  167. <if test="updateBy != null">#{updateBy},
  168. </if>
  169. <if test="updateTime != null">#{updateTime},
  170. </if>
  171. <if test="orgId != null">#{orgId},
  172. </if>
  173. <if test="orgName != null">#{orgName},
  174. </if>
  175. <if test="orgPath != null">#{orgPath},
  176. </if>
  177. <if test="collectionAreaName != null">#{collectionAreaName},
  178. </if>
  179. <if test="checkId != null">#{checkId},
  180. </if>
  181. </trim>
  182. </insert>
  183. <update id="updateSysNfcBind" parameterType="com.xunmei.system.domain.SysNfcBind">
  184. update sys_nfc_bind
  185. <trim prefix="SET" suffixOverrides=",">
  186. <if test="areaId != null">area_id =
  187. #{areaId},
  188. </if>
  189. <if test="enable != null">enable =
  190. #{enable},
  191. </if>
  192. <if test="code != null">code =
  193. #{code},
  194. </if>
  195. <if test="createTime != null">create_time =
  196. #{createTime},
  197. </if>
  198. <if test="updateId != null">update_id =
  199. #{updateId},
  200. </if>
  201. <if test="updateBy != null">update_by =
  202. #{updateBy},
  203. </if>
  204. <if test="updateTime != null">update_time =
  205. #{updateTime},
  206. </if>
  207. <if test="orgId != null">org_id =
  208. #{orgId},
  209. </if>
  210. <if test="orgName != null">org_name =
  211. #{orgName},
  212. </if>
  213. <if test="orgPath != null">org_path =
  214. #{orgPath},
  215. </if>
  216. <if test="collectionAreaName != null">collection_area_name =
  217. #{collectionAreaName},
  218. </if>
  219. <if test="checkId != null">check_id =
  220. #{checkId},
  221. </if>
  222. <if test="delFlag !=null">
  223. del_flag= #{delFlag}
  224. </if>
  225. </trim>
  226. where id = #{id}
  227. </update>
  228. <update id="updateAreaNameByAreaId">
  229. UPDATE sys_nfc_bind
  230. SET area_name = #{areaName}
  231. WHERE area_id = #{areaId}
  232. </update>
  233. <update id="updateAreaCheckNameByCheckId">
  234. UPDATE sys_nfc_bind
  235. SET collection_area_name = #{collectionAreaName}
  236. WHERE check_id = #{checkId}
  237. </update>
  238. <delete id="deleteSysNfcBindById" parameterType="Long">
  239. delete
  240. from sys_nfc_bind
  241. where id = #{id}
  242. </delete>
  243. <delete id="deleteSysNfcBindByIds" parameterType="String">
  244. delete from sys_nfc_bind where id in
  245. <foreach item="id" collection="array" open="(" separator="," close=")">
  246. #{id}
  247. </foreach>
  248. </delete>
  249. <delete id="deleteSysNfcBindByCode">
  250. delete
  251. from sys_nfc_bind
  252. where code = #{code}
  253. </delete>
  254. </mapper>