PersonalAuthenticationMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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.izouma.awesomeadmin.dao.PersonalAuthenticationMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.PersonalAuthentication" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  8. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  11. <result column="user_id" property="userId" jdbcType="INTEGER" />
  12. <result column="user_name" property="userName" jdbcType="VARCHAR" />
  13. <result column="real_name" property="realName" jdbcType="VARCHAR" />
  14. <result column="idcard" property="idcard" jdbcType="VARCHAR" />
  15. <result column="face_image" property="faceImage" jdbcType="VARCHAR" />
  16. <result column="back_image" property="backImage" jdbcType="VARCHAR" />
  17. <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
  18. <result column="telephone" property="telephone" jdbcType="VARCHAR" />
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. <trim suffixOverrides="," >
  22. id,
  23. del_flag,
  24. update_time,
  25. update_user,
  26. create_time,
  27. create_user,
  28. user_id,
  29. user_name,
  30. real_name,
  31. idcard,
  32. face_image,
  33. back_image,
  34. status_flag,
  35. telephone,
  36. </trim>
  37. </sql>
  38. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  39. select
  40. <include refid="Base_Column_List" />
  41. from personal_authentication
  42. where id = #{id,jdbcType=INTEGER}
  43. </select>
  44. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  45. delete from personal_authentication
  46. where id = #{id,jdbcType=INTEGER}
  47. </delete>
  48. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.PersonalAuthentication" useGeneratedKeys="true" keyProperty="id">
  49. insert into personal_authentication
  50. <trim prefix="(" suffix=")" suffixOverrides="," >
  51. <if test="id!= null" >
  52. id,
  53. </if>
  54. <if test="delFlag!= null" >
  55. del_flag,
  56. </if>
  57. <if test="updateTime!= null" >
  58. update_time,
  59. </if>
  60. <if test="updateUser!= null" >
  61. update_user,
  62. </if>
  63. <if test="createTime!= null" >
  64. create_time,
  65. </if>
  66. <if test="createUser!= null" >
  67. create_user,
  68. </if>
  69. <if test="userId!= null" >
  70. user_id,
  71. </if>
  72. <if test="userName!= null" >
  73. user_name,
  74. </if>
  75. <if test="realName!= null" >
  76. real_name,
  77. </if>
  78. <if test="idcard!= null" >
  79. idcard,
  80. </if>
  81. <if test="faceImage!= null" >
  82. face_image,
  83. </if>
  84. <if test="backImage!= null" >
  85. back_image,
  86. </if>
  87. <if test="statusFlag!= null" >
  88. status_flag,
  89. </if>
  90. <if test="telephone!= null" >
  91. telephone,
  92. </if>
  93. </trim>
  94. <trim prefix="values (" suffix=")" suffixOverrides="," >
  95. <if test="id != null" >
  96. #{id,jdbcType=INTEGER},
  97. </if>
  98. <if test="delFlag != null" >
  99. #{delFlag,jdbcType=CHAR},
  100. </if>
  101. <if test="updateTime != null" >
  102. #{updateTime,jdbcType=TIMESTAMP},
  103. </if>
  104. <if test="updateUser != null" >
  105. #{updateUser,jdbcType=VARCHAR},
  106. </if>
  107. <if test="createTime != null" >
  108. #{createTime,jdbcType=TIMESTAMP},
  109. </if>
  110. <if test="createUser != null" >
  111. #{createUser,jdbcType=VARCHAR},
  112. </if>
  113. <if test="userId != null" >
  114. #{userId,jdbcType=INTEGER},
  115. </if>
  116. <if test="userName != null" >
  117. #{userName,jdbcType=VARCHAR},
  118. </if>
  119. <if test="realName != null" >
  120. #{realName,jdbcType=VARCHAR},
  121. </if>
  122. <if test="idcard != null" >
  123. #{idcard,jdbcType=VARCHAR},
  124. </if>
  125. <if test="faceImage != null" >
  126. #{faceImage,jdbcType=VARCHAR},
  127. </if>
  128. <if test="backImage != null" >
  129. #{backImage,jdbcType=VARCHAR},
  130. </if>
  131. <if test="statusFlag != null" >
  132. #{statusFlag,jdbcType=INTEGER},
  133. </if>
  134. <if test="telephone != null" >
  135. #{telephone,jdbcType=VARCHAR},
  136. </if>
  137. </trim>
  138. </insert>
  139. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.PersonalAuthentication" >
  140. update personal_authentication
  141. <set >
  142. <if test="id != null" >
  143. id= #{id,jdbcType=INTEGER},
  144. </if>
  145. <if test="delFlag != null" >
  146. del_flag= #{delFlag,jdbcType=CHAR},
  147. </if>
  148. <if test="updateTime != null" >
  149. update_time= #{updateTime,jdbcType=TIMESTAMP},
  150. </if>
  151. <if test="updateUser != null" >
  152. update_user= #{updateUser,jdbcType=VARCHAR},
  153. </if>
  154. <if test="createTime != null" >
  155. create_time= #{createTime,jdbcType=TIMESTAMP},
  156. </if>
  157. <if test="createUser != null" >
  158. create_user= #{createUser,jdbcType=VARCHAR},
  159. </if>
  160. <if test="userId != null" >
  161. user_id= #{userId,jdbcType=INTEGER},
  162. </if>
  163. <if test="userName != null" >
  164. user_name= #{userName,jdbcType=VARCHAR},
  165. </if>
  166. <if test="realName != null" >
  167. real_name= #{realName,jdbcType=VARCHAR},
  168. </if>
  169. <if test="idcard != null" >
  170. idcard= #{idcard,jdbcType=VARCHAR},
  171. </if>
  172. <if test="faceImage != null" >
  173. face_image= #{faceImage,jdbcType=VARCHAR},
  174. </if>
  175. <if test="backImage != null" >
  176. back_image= #{backImage,jdbcType=VARCHAR},
  177. </if>
  178. <if test="statusFlag != null" >
  179. status_flag= #{statusFlag,jdbcType=INTEGER},
  180. </if>
  181. <if test="telephone != null" >
  182. telephone= #{telephone,jdbcType=VARCHAR},
  183. </if>
  184. </set>
  185. where id = #{id,jdbcType=INTEGER}
  186. </update>
  187. <select id="queryPersonalAuthenticationByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PersonalAuthentication">
  188. select <include refid="Base_Column_List"/> from personal_authentication
  189. <where>
  190. and del_flag = 'N'
  191. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  192. and id = #{record.id}
  193. </if>
  194. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  195. and del_flag = #{record.delFlag}
  196. </if>
  197. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  198. and update_time = #{record.updateTime}
  199. </if>
  200. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  201. and update_user = #{record.updateUser}
  202. </if>
  203. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  204. and create_time = #{record.createTime}
  205. </if>
  206. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  207. and create_user = #{record.createUser}
  208. </if>
  209. <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
  210. and user_id = #{record.userId}
  211. </if>
  212. <if test="record.userName != null and !&quot;&quot;.equals(record.userName)">
  213. and user_name = #{record.userName}
  214. </if>
  215. <if test="record.realName != null and !&quot;&quot;.equals(record.realName)">
  216. and real_name = #{record.realName}
  217. </if>
  218. <if test="record.idcard != null and !&quot;&quot;.equals(record.idcard)">
  219. and idcard = #{record.idcard}
  220. </if>
  221. <if test="record.faceImage != null and !&quot;&quot;.equals(record.faceImage)">
  222. and face_image = #{record.faceImage}
  223. </if>
  224. <if test="record.backImage != null and !&quot;&quot;.equals(record.backImage)">
  225. and back_image = #{record.backImage}
  226. </if>
  227. <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
  228. and status_flag = #{record.statusFlag}
  229. </if>
  230. <if test="record.telephone != null and !&quot;&quot;.equals(record.telephone)">
  231. and telephone = #{record.telephone}
  232. </if>
  233. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  234. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  235. OR user_id LIKE concat('%',#{record.searchKey},'%')
  236. OR user_name LIKE concat('%',#{record.searchKey},'%')
  237. OR real_name LIKE concat('%',#{record.searchKey},'%')
  238. OR idcard LIKE concat('%',#{record.searchKey},'%')
  239. OR status_flag LIKE concat('%',#{record.searchKey},'%')
  240. OR telephone LIKE concat('%',#{record.searchKey},'%')
  241. </trim>
  242. </if>
  243. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  244. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  245. <choose>
  246. <when test="item.indexOf('like') != -1">
  247. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  248. <if test="detailIndex == 3">
  249. concat('%',#{itemDetail},'%')
  250. </if>
  251. <if test="detailIndex &lt; 3">
  252. ${itemDetail}
  253. </if>
  254. </foreach>
  255. </when>
  256. <otherwise>
  257. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  258. <if test="detailIndex == 3">
  259. #{itemDetail}
  260. </if>
  261. <if test="detailIndex &lt; 3">
  262. ${itemDetail}
  263. </if>
  264. </foreach>
  265. </otherwise>
  266. </choose>
  267. </foreach>
  268. </if>
  269. </where>
  270. order by
  271. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  272. <trim suffixOverrides=",">
  273. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  274. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  275. ${itemDetail}
  276. </foreach>
  277. </foreach>
  278. </trim>
  279. ,
  280. </if>
  281. id desc
  282. </select>
  283. <select id="queryAllPersonalAuthentication" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PersonalAuthentication">
  284. select <include refid="Base_Column_List"/> from personal_authentication
  285. <where>
  286. and del_flag = 'N'
  287. <if test="id != null and !&quot;&quot;.equals(id)">
  288. and id = #{id}
  289. </if>
  290. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  291. and del_flag = #{delFlag}
  292. </if>
  293. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  294. and update_time = #{updateTime}
  295. </if>
  296. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  297. and update_user = #{updateUser}
  298. </if>
  299. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  300. and create_time = #{createTime}
  301. </if>
  302. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  303. and create_user = #{createUser}
  304. </if>
  305. <if test="userId != null and !&quot;&quot;.equals(userId)">
  306. and user_id = #{userId}
  307. </if>
  308. <if test="userName != null and !&quot;&quot;.equals(userName)">
  309. and user_name = #{userName}
  310. </if>
  311. <if test="realName != null and !&quot;&quot;.equals(realName)">
  312. and real_name = #{realName}
  313. </if>
  314. <if test="idcard != null and !&quot;&quot;.equals(idcard)">
  315. and idcard = #{idcard}
  316. </if>
  317. <if test="faceImage != null and !&quot;&quot;.equals(faceImage)">
  318. and face_image = #{faceImage}
  319. </if>
  320. <if test="backImage != null and !&quot;&quot;.equals(backImage)">
  321. and back_image = #{backImage}
  322. </if>
  323. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  324. and status_flag = #{statusFlag}
  325. </if>
  326. <if test="telephone != null and !&quot;&quot;.equals(telephone)">
  327. and telephone = #{telephone}
  328. </if>
  329. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  330. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  331. OR user_id LIKE concat('%',#{searchKey},'%')
  332. OR user_name LIKE concat('%',#{searchKey},'%')
  333. OR real_name LIKE concat('%',#{searchKey},'%')
  334. OR idcard LIKE concat('%',#{searchKey},'%')
  335. OR status_flag LIKE concat('%',#{searchKey},'%')
  336. OR telephone LIKE concat('%',#{searchKey},'%')
  337. </trim>
  338. </if>
  339. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  340. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  341. <choose>
  342. <when test="item.indexOf('like') != -1">
  343. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  344. <if test="detailIndex == 3">
  345. concat('%',#{itemDetail},'%')
  346. </if>
  347. <if test="detailIndex &lt; 3">
  348. ${itemDetail}
  349. </if>
  350. </foreach>
  351. </when>
  352. <otherwise>
  353. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  354. <if test="detailIndex == 3">
  355. #{itemDetail}
  356. </if>
  357. <if test="detailIndex &lt; 3">
  358. ${itemDetail}
  359. </if>
  360. </foreach>
  361. </otherwise>
  362. </choose>
  363. </foreach>
  364. </if>
  365. </where>
  366. order by
  367. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  368. <trim suffixOverrides=",">
  369. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  370. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  371. ${itemDetail}
  372. </foreach>
  373. </foreach>
  374. </trim>
  375. ,
  376. </if>
  377. id desc
  378. </select>
  379. <select id="queryPersonalAuthentication" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PersonalAuthentication">
  380. select <include refid="Base_Column_List"/> from personal_authentication
  381. <where>
  382. and del_flag = 'N'
  383. <if test="id != null and !&quot;&quot;.equals(id)">
  384. and id = #{id}
  385. </if>
  386. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  387. and del_flag = #{delFlag}
  388. </if>
  389. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  390. and update_time = #{updateTime}
  391. </if>
  392. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  393. and update_user = #{updateUser}
  394. </if>
  395. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  396. and create_time = #{createTime}
  397. </if>
  398. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  399. and create_user = #{createUser}
  400. </if>
  401. <if test="userId != null and !&quot;&quot;.equals(userId)">
  402. and user_id = #{userId}
  403. </if>
  404. <if test="userName != null and !&quot;&quot;.equals(userName)">
  405. and user_name = #{userName}
  406. </if>
  407. <if test="realName != null and !&quot;&quot;.equals(realName)">
  408. and real_name = #{realName}
  409. </if>
  410. <if test="idcard != null and !&quot;&quot;.equals(idcard)">
  411. and idcard = #{idcard}
  412. </if>
  413. <if test="faceImage != null and !&quot;&quot;.equals(faceImage)">
  414. and face_image = #{faceImage}
  415. </if>
  416. <if test="backImage != null and !&quot;&quot;.equals(backImage)">
  417. and back_image = #{backImage}
  418. </if>
  419. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  420. and status_flag = #{statusFlag}
  421. </if>
  422. <if test="telephone != null and !&quot;&quot;.equals(telephone)">
  423. and telephone = #{telephone}
  424. </if>
  425. </where>
  426. LIMIT 1
  427. </select>
  428. <update id="delete">
  429. UPDATE personal_authentication SET del_flag = 'Y'
  430. <where>
  431. AND id = #{id}
  432. </where>
  433. </update>
  434. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PersonalAuthentication">
  435. select <include refid="Base_Column_List"/> from personal_authentication
  436. <where>
  437. and del_flag = 'N'
  438. </where>
  439. order by id desc
  440. </select>
  441. </mapper>