UserIdentityMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.goafanti.common.dao.UserIdentityMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserIdentity" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="username" property="username" jdbcType="VARCHAR" />
  8. <result column="sex" property="sex" jdbcType="VARCHAR" />
  9. <result column="date_of_birth_year" property="dateOfBirthYear" jdbcType="VARCHAR" />
  10. <result column="date_of_birth_month" property="dateOfBirthMonth" jdbcType="VARCHAR" />
  11. <result column="id_number" property="idNumber" jdbcType="VARCHAR" />
  12. <result column="positive_id_url" property="positiveIdUrl" jdbcType="VARCHAR" />
  13. <result column="opposite_id_url" property="oppositeIdUrl" jdbcType="VARCHAR" />
  14. <result column="aft_username" property="aftUsername" jdbcType="VARCHAR" />
  15. <result column="province" property="province" jdbcType="VARCHAR" />
  16. <result column="city" property="city" jdbcType="VARCHAR" />
  17. <result column="area" property="area" jdbcType="VARCHAR" />
  18. <result column="contact_mobile" property="contactMobile" jdbcType="VARCHAR" />
  19. <result column="bank_name" property="bankName" jdbcType="VARCHAR" />
  20. <result column="bank_account" property="bankAccount" jdbcType="VARCHAR" />
  21. <result column="bank_card_number" property="bankCardNumber" jdbcType="VARCHAR" />
  22. <result column="amount_money" property="amountMoney" jdbcType="DECIMAL" />
  23. <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
  24. <result column="process" property="process" jdbcType="INTEGER" />
  25. <result column="wrong_count" property="wrongCount" jdbcType="INTEGER" />
  26. <result column="payment_date" property="paymentDate" jdbcType="TIMESTAMP" />
  27. </resultMap>
  28. <sql id="Base_Column_List" >
  29. id, uid, username, sex, date_of_birth_year, date_of_birth_month, id_number, positive_id_url,
  30. opposite_id_url, aft_username, province, city, area, contact_mobile, bank_name, bank_account,
  31. bank_card_number, amount_money, audit_status, process , wrong_count, payment_date
  32. </sql>
  33. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  34. select
  35. <include refid="Base_Column_List" />
  36. from user_identity
  37. where id = #{id,jdbcType=VARCHAR}
  38. </select>
  39. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  40. delete from user_identity
  41. where id = #{id,jdbcType=VARCHAR}
  42. </delete>
  43. <insert id="insert" parameterType="com.goafanti.common.model.UserIdentity" >
  44. insert into user_identity (id, uid, username,
  45. sex, date_of_birth_year, date_of_birth_month,
  46. id_number, positive_id_url, opposite_id_url,
  47. aft_username, province, city,
  48. area, contact_mobile, bank_name,
  49. bank_account, bank_card_number, amount_money,
  50. audit_status, process, payment_date)
  51. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
  52. #{sex,jdbcType=VARCHAR}, #{dateOfBirthYear,jdbcType=VARCHAR}, #{dateOfBirthMonth,jdbcType=VARCHAR},
  53. #{idNumber,jdbcType=VARCHAR}, #{positiveIdUrl,jdbcType=VARCHAR}, #{oppositeIdUrl,jdbcType=VARCHAR},
  54. #{aftUsername,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
  55. #{area,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR},
  56. #{bankAccount,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR}, #{amountMoney,jdbcType=DECIMAL},
  57. #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, #{wrongCount,jdbcType=INTEGER}, #{paymentDate,jdbcType=TIMESTAMP})
  58. </insert>
  59. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserIdentity" >
  60. insert into user_identity
  61. <trim prefix="(" suffix=")" suffixOverrides="," >
  62. <if test="id != null" >
  63. id,
  64. </if>
  65. <if test="uid != null" >
  66. uid,
  67. </if>
  68. <if test="username != null" >
  69. username,
  70. </if>
  71. <if test="sex != null" >
  72. sex,
  73. </if>
  74. <if test="dateOfBirthYear != null" >
  75. date_of_birth_year,
  76. </if>
  77. <if test="dateOfBirthMonth != null" >
  78. date_of_birth_month,
  79. </if>
  80. <if test="idNumber != null" >
  81. id_number,
  82. </if>
  83. <if test="positiveIdUrl != null" >
  84. positive_id_url,
  85. </if>
  86. <if test="oppositeIdUrl != null" >
  87. opposite_id_url,
  88. </if>
  89. <if test="aftUsername != null" >
  90. aft_username,
  91. </if>
  92. <if test="province != null" >
  93. province,
  94. </if>
  95. <if test="city != null" >
  96. city,
  97. </if>
  98. <if test="area != null" >
  99. area,
  100. </if>
  101. <if test="contactMobile != null" >
  102. contact_mobile,
  103. </if>
  104. <if test="bankName != null" >
  105. bank_name,
  106. </if>
  107. <if test="bankAccount != null" >
  108. bank_account,
  109. </if>
  110. <if test="bankCardNumber != null" >
  111. bank_card_number,
  112. </if>
  113. <if test="amountMoney != null" >
  114. amount_money,
  115. </if>
  116. <if test="auditStatus != null" >
  117. audit_status,
  118. </if>
  119. <if test="process != null" >
  120. process,
  121. </if>
  122. <if test="wrongCount != null" >
  123. wrong_count,
  124. </if>
  125. <if test="paymentDate != null" >
  126. payment_date,
  127. </if>
  128. </trim>
  129. <trim prefix="values (" suffix=")" suffixOverrides="," >
  130. <if test="id != null" >
  131. #{id,jdbcType=VARCHAR},
  132. </if>
  133. <if test="uid != null" >
  134. #{uid,jdbcType=VARCHAR},
  135. </if>
  136. <if test="username != null" >
  137. #{username,jdbcType=VARCHAR},
  138. </if>
  139. <if test="sex != null" >
  140. #{sex,jdbcType=VARCHAR},
  141. </if>
  142. <if test="dateOfBirthYear != null" >
  143. #{dateOfBirthYear,jdbcType=VARCHAR},
  144. </if>
  145. <if test="dateOfBirthMonth != null" >
  146. #{dateOfBirthMonth,jdbcType=VARCHAR},
  147. </if>
  148. <if test="idNumber != null" >
  149. #{idNumber,jdbcType=VARCHAR},
  150. </if>
  151. <if test="positiveIdUrl != null" >
  152. #{positiveIdUrl,jdbcType=VARCHAR},
  153. </if>
  154. <if test="oppositeIdUrl != null" >
  155. #{oppositeIdUrl,jdbcType=VARCHAR},
  156. </if>
  157. <if test="aftUsername != null" >
  158. #{aftUsername,jdbcType=VARCHAR},
  159. </if>
  160. <if test="province != null" >
  161. #{province,jdbcType=VARCHAR},
  162. </if>
  163. <if test="city != null" >
  164. #{city,jdbcType=VARCHAR},
  165. </if>
  166. <if test="area != null" >
  167. #{area,jdbcType=VARCHAR},
  168. </if>
  169. <if test="contactMobile != null" >
  170. #{contactMobile,jdbcType=VARCHAR},
  171. </if>
  172. <if test="bankName != null" >
  173. #{bankName,jdbcType=VARCHAR},
  174. </if>
  175. <if test="bankAccount != null" >
  176. #{bankAccount,jdbcType=VARCHAR},
  177. </if>
  178. <if test="bankCardNumber != null" >
  179. #{bankCardNumber,jdbcType=VARCHAR},
  180. </if>
  181. <if test="amountMoney != null" >
  182. #{amountMoney,jdbcType=DECIMAL},
  183. </if>
  184. <if test="auditStatus != null" >
  185. #{auditStatus,jdbcType=INTEGER},
  186. </if>
  187. <if test="process != null" >
  188. #{process,jdbcType=INTEGER},
  189. </if>
  190. <if test="wrongCount != null" >
  191. #{wrongCount,jdbcType=INTEGER},
  192. </if>
  193. <if test="paymentDate != null" >
  194. #{paymentDate,jdbcType=TIMESTAMP},
  195. </if>
  196. </trim>
  197. </insert>
  198. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserIdentity" >
  199. update user_identity
  200. <set >
  201. <if test="uid != null" >
  202. uid = #{uid,jdbcType=VARCHAR},
  203. </if>
  204. <if test="username != null" >
  205. username = #{username,jdbcType=VARCHAR},
  206. </if>
  207. <if test="sex != null" >
  208. sex = #{sex,jdbcType=VARCHAR},
  209. </if>
  210. <if test="dateOfBirthYear != null" >
  211. date_of_birth_year = #{dateOfBirthYear,jdbcType=VARCHAR},
  212. </if>
  213. <if test="dateOfBirthMonth != null" >
  214. date_of_birth_month = #{dateOfBirthMonth,jdbcType=VARCHAR},
  215. </if>
  216. <if test="idNumber != null" >
  217. id_number = #{idNumber,jdbcType=VARCHAR},
  218. </if>
  219. <if test="positiveIdUrl != null" >
  220. positive_id_url = #{positiveIdUrl,jdbcType=VARCHAR},
  221. </if>
  222. <if test="oppositeIdUrl != null" >
  223. opposite_id_url = #{oppositeIdUrl,jdbcType=VARCHAR},
  224. </if>
  225. <if test="aftUsername != null" >
  226. aft_username = #{aftUsername,jdbcType=VARCHAR},
  227. </if>
  228. <if test="province != null" >
  229. province = #{province,jdbcType=VARCHAR},
  230. </if>
  231. <if test="city != null" >
  232. city = #{city,jdbcType=VARCHAR},
  233. </if>
  234. <if test="area != null" >
  235. area = #{area,jdbcType=VARCHAR},
  236. </if>
  237. <if test="contactMobile != null" >
  238. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  239. </if>
  240. <if test="bankName != null" >
  241. bank_name = #{bankName,jdbcType=VARCHAR},
  242. </if>
  243. <if test="bankAccount != null" >
  244. bank_account = #{bankAccount,jdbcType=VARCHAR},
  245. </if>
  246. <if test="bankCardNumber != null" >
  247. bank_card_number = #{bankCardNumber,jdbcType=VARCHAR},
  248. </if>
  249. <if test="amountMoney != null" >
  250. amount_money = #{amountMoney,jdbcType=DECIMAL},
  251. </if>
  252. <if test="auditStatus != null" >
  253. audit_status = #{auditStatus,jdbcType=INTEGER},
  254. </if>
  255. <if test="process != null" >
  256. process = #{process,jdbcType=INTEGER},
  257. </if>
  258. <if test="wrongCount != null" >
  259. wrong_count = #{wrongCount,jdbcType=INTEGER},
  260. </if>
  261. <if test="paymentDate != null" >
  262. payment_date = #{paymentDate,jdbcType=TIMESTAMP},
  263. </if>
  264. </set>
  265. where id = #{id,jdbcType=VARCHAR}
  266. </update>
  267. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserIdentity" >
  268. update user_identity
  269. set uid = #{uid,jdbcType=VARCHAR},
  270. username = #{username,jdbcType=VARCHAR},
  271. sex = #{sex,jdbcType=VARCHAR},
  272. date_of_birth_year = #{dateOfBirthYear,jdbcType=VARCHAR},
  273. date_of_birth_month = #{dateOfBirthMonth,jdbcType=VARCHAR},
  274. id_number = #{idNumber,jdbcType=VARCHAR},
  275. positive_id_url = #{positiveIdUrl,jdbcType=VARCHAR},
  276. opposite_id_url = #{oppositeIdUrl,jdbcType=VARCHAR},
  277. aft_username = #{aftUsername,jdbcType=VARCHAR},
  278. province = #{province,jdbcType=VARCHAR},
  279. city = #{city,jdbcType=VARCHAR},
  280. area = #{area,jdbcType=VARCHAR},
  281. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  282. bank_name = #{bankName,jdbcType=VARCHAR},
  283. bank_account = #{bankAccount,jdbcType=VARCHAR},
  284. bank_card_number = #{bankCardNumber,jdbcType=VARCHAR},
  285. amount_money = #{amountMoney,jdbcType=DECIMAL},
  286. audit_status = #{auditStatus,jdbcType=INTEGER},
  287. process = #{process,jdbcType=INTEGER},
  288. wrong_count = #{wrongCount,jdbcType=INTEGER},
  289. payment_date = #{paymentDate,jdbcType=TIMESTAMP}
  290. where id = #{id,jdbcType=VARCHAR}
  291. </update>
  292. <select id="selectUserIdentityByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  293. select
  294. <include refid="Base_Column_List" />
  295. from user_identity
  296. where uid = #{uid,jdbcType=VARCHAR}
  297. </select>
  298. <select id="selectUserIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserIdentityBo">
  299. select t.id, t.uid, t.username, t.sex, t.date_of_birth_year as dateOfBirthYear,
  300. t.date_of_birth_month as dateOfBirthMonth, t.id_number as idNumber, t.audit_status as auditStatus,
  301. u.mobile, u.number from user u left JOIN user_identity t
  302. on t.uid = u.id where t.uid=#{uid,jdbcType=VARCHAR}
  303. </select>
  304. </mapper>