UserMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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.js.kbt.mapper.UserMapper">
  4. <resultMap id="BaseResultMap" type="com.js.kbt.model.User">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  12. <result column="avatar" jdbcType="VARCHAR" property="avatar" />
  13. <result column="nickname" jdbcType="VARCHAR" property="nickname" />
  14. <result column="token" jdbcType="VARCHAR" property="token" />
  15. <result column="money" jdbcType="INTEGER" property="money" />
  16. <result column="indate" jdbcType="TIMESTAMP" property="indate" />
  17. <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
  18. <result column="address" jdbcType="VARCHAR" property="address" />
  19. <result column="income" jdbcType="INTEGER" property="income" />
  20. <result column="car_no" jdbcType="VARCHAR" property="carNo" />
  21. <result column="com_id" jdbcType="INTEGER" property="comId" />
  22. <result column="count" jdbcType="VARCHAR" property="count" />
  23. <result column="qr_code" jdbcType="VARCHAR" property="qrCode" />
  24. <result column="is_owner" jdbcType="INTEGER" property="isOwner" />
  25. </resultMap>
  26. <sql id="Example_Where_Clause">
  27. <!--
  28. WARNING - @mbggenerated
  29. This element is automatically generated by MyBatis Generator, do not modify.
  30. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  31. -->
  32. <where>
  33. <foreach collection="oredCriteria" item="criteria" separator="or">
  34. <if test="criteria.valid">
  35. <trim prefix="(" prefixOverrides="and" suffix=")">
  36. <foreach collection="criteria.criteria" item="criterion">
  37. <choose>
  38. <when test="criterion.noValue">
  39. and ${criterion.condition}
  40. </when>
  41. <when test="criterion.singleValue">
  42. and ${criterion.condition} #{criterion.value}
  43. </when>
  44. <when test="criterion.betweenValue">
  45. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  46. </when>
  47. <when test="criterion.listValue">
  48. and ${criterion.condition}
  49. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  50. #{listItem}
  51. </foreach>
  52. </when>
  53. </choose>
  54. </foreach>
  55. </trim>
  56. </if>
  57. </foreach>
  58. </where>
  59. </sql>
  60. <sql id="Update_By_Example_Where_Clause">
  61. <!--
  62. WARNING - @mbggenerated
  63. This element is automatically generated by MyBatis Generator, do not modify.
  64. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  65. -->
  66. <where>
  67. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  68. <if test="criteria.valid">
  69. <trim prefix="(" prefixOverrides="and" suffix=")">
  70. <foreach collection="criteria.criteria" item="criterion">
  71. <choose>
  72. <when test="criterion.noValue">
  73. and ${criterion.condition}
  74. </when>
  75. <when test="criterion.singleValue">
  76. and ${criterion.condition} #{criterion.value}
  77. </when>
  78. <when test="criterion.betweenValue">
  79. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  80. </when>
  81. <when test="criterion.listValue">
  82. and ${criterion.condition}
  83. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  84. #{listItem}
  85. </foreach>
  86. </when>
  87. </choose>
  88. </foreach>
  89. </trim>
  90. </if>
  91. </foreach>
  92. </where>
  93. </sql>
  94. <sql id="Base_Column_List">
  95. <!--
  96. WARNING - @mbggenerated
  97. This element is automatically generated by MyBatis Generator, do not modify.
  98. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  99. -->
  100. id, mobile, avatar, nickname, token, money, indate, device_id, address, income, car_no,
  101. com_id, count, qr_code, is_owner
  102. </sql>
  103. <select id="selectByExample" parameterType="com.js.kbt.model.UserExample" resultMap="BaseResultMap">
  104. <!--
  105. WARNING - @mbggenerated
  106. This element is automatically generated by MyBatis Generator, do not modify.
  107. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  108. -->
  109. select
  110. <if test="distinct">
  111. distinct
  112. </if>
  113. <include refid="Base_Column_List" />
  114. from user
  115. <if test="_parameter != null">
  116. <include refid="Example_Where_Clause" />
  117. </if>
  118. <if test="orderByClause != null">
  119. order by ${orderByClause}
  120. </if>
  121. </select>
  122. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  123. <!--
  124. WARNING - @mbggenerated
  125. This element is automatically generated by MyBatis Generator, do not modify.
  126. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  127. -->
  128. select
  129. <include refid="Base_Column_List" />
  130. from user
  131. where id = #{id,jdbcType=INTEGER}
  132. </select>
  133. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  134. <!--
  135. WARNING - @mbggenerated
  136. This element is automatically generated by MyBatis Generator, do not modify.
  137. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  138. -->
  139. delete from user
  140. where id = #{id,jdbcType=INTEGER}
  141. </delete>
  142. <delete id="deleteByExample" parameterType="com.js.kbt.model.UserExample">
  143. <!--
  144. WARNING - @mbggenerated
  145. This element is automatically generated by MyBatis Generator, do not modify.
  146. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  147. -->
  148. delete from user
  149. <if test="_parameter != null">
  150. <include refid="Example_Where_Clause" />
  151. </if>
  152. </delete>
  153. <insert id="insert" parameterType="com.js.kbt.model.User">
  154. <!--
  155. WARNING - @mbggenerated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  158. -->
  159. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  160. SELECT LAST_INSERT_ID()
  161. </selectKey>
  162. insert into user (mobile, avatar, nickname,
  163. token, money, indate,
  164. device_id, address, income,
  165. car_no, com_id, count,
  166. qr_code, is_owner)
  167. values (#{mobile,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR},
  168. #{token,jdbcType=VARCHAR}, #{money,jdbcType=INTEGER}, #{indate,jdbcType=TIMESTAMP},
  169. #{deviceId,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{income,jdbcType=INTEGER},
  170. #{carNo,jdbcType=VARCHAR}, #{comId,jdbcType=INTEGER}, #{count,jdbcType=VARCHAR},
  171. #{qrCode,jdbcType=VARCHAR}, #{isOwner,jdbcType=INTEGER})
  172. </insert>
  173. <insert id="insertSelective" parameterType="com.js.kbt.model.User">
  174. <!--
  175. WARNING - @mbggenerated
  176. This element is automatically generated by MyBatis Generator, do not modify.
  177. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  178. -->
  179. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  180. SELECT LAST_INSERT_ID()
  181. </selectKey>
  182. insert into user
  183. <trim prefix="(" suffix=")" suffixOverrides=",">
  184. <if test="mobile != null">
  185. mobile,
  186. </if>
  187. <if test="avatar != null">
  188. avatar,
  189. </if>
  190. <if test="nickname != null">
  191. nickname,
  192. </if>
  193. <if test="token != null">
  194. token,
  195. </if>
  196. <if test="money != null">
  197. money,
  198. </if>
  199. <if test="indate != null">
  200. indate,
  201. </if>
  202. <if test="deviceId != null">
  203. device_id,
  204. </if>
  205. <if test="address != null">
  206. address,
  207. </if>
  208. <if test="income != null">
  209. income,
  210. </if>
  211. <if test="carNo != null">
  212. car_no,
  213. </if>
  214. <if test="comId != null">
  215. com_id,
  216. </if>
  217. <if test="count != null">
  218. count,
  219. </if>
  220. <if test="qrCode != null">
  221. qr_code,
  222. </if>
  223. <if test="isOwner != null">
  224. is_owner,
  225. </if>
  226. </trim>
  227. <trim prefix="values (" suffix=")" suffixOverrides=",">
  228. <if test="mobile != null">
  229. #{mobile,jdbcType=VARCHAR},
  230. </if>
  231. <if test="avatar != null">
  232. #{avatar,jdbcType=VARCHAR},
  233. </if>
  234. <if test="nickname != null">
  235. #{nickname,jdbcType=VARCHAR},
  236. </if>
  237. <if test="token != null">
  238. #{token,jdbcType=VARCHAR},
  239. </if>
  240. <if test="money != null">
  241. #{money,jdbcType=INTEGER},
  242. </if>
  243. <if test="indate != null">
  244. #{indate,jdbcType=TIMESTAMP},
  245. </if>
  246. <if test="deviceId != null">
  247. #{deviceId,jdbcType=VARCHAR},
  248. </if>
  249. <if test="address != null">
  250. #{address,jdbcType=VARCHAR},
  251. </if>
  252. <if test="income != null">
  253. #{income,jdbcType=INTEGER},
  254. </if>
  255. <if test="carNo != null">
  256. #{carNo,jdbcType=VARCHAR},
  257. </if>
  258. <if test="comId != null">
  259. #{comId,jdbcType=INTEGER},
  260. </if>
  261. <if test="count != null">
  262. #{count,jdbcType=VARCHAR},
  263. </if>
  264. <if test="qrCode != null">
  265. #{qrCode,jdbcType=VARCHAR},
  266. </if>
  267. <if test="isOwner != null">
  268. #{isOwner,jdbcType=INTEGER},
  269. </if>
  270. </trim>
  271. </insert>
  272. <select id="countByExample" parameterType="com.js.kbt.model.UserExample" resultType="java.lang.Integer">
  273. <!--
  274. WARNING - @mbggenerated
  275. This element is automatically generated by MyBatis Generator, do not modify.
  276. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  277. -->
  278. select count(*) from user
  279. <if test="_parameter != null">
  280. <include refid="Example_Where_Clause" />
  281. </if>
  282. </select>
  283. <update id="updateByExampleSelective" parameterType="map">
  284. <!--
  285. WARNING - @mbggenerated
  286. This element is automatically generated by MyBatis Generator, do not modify.
  287. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  288. -->
  289. update user
  290. <set>
  291. <if test="record.id != null">
  292. id = #{record.id,jdbcType=INTEGER},
  293. </if>
  294. <if test="record.mobile != null">
  295. mobile = #{record.mobile,jdbcType=VARCHAR},
  296. </if>
  297. <if test="record.avatar != null">
  298. avatar = #{record.avatar,jdbcType=VARCHAR},
  299. </if>
  300. <if test="record.nickname != null">
  301. nickname = #{record.nickname,jdbcType=VARCHAR},
  302. </if>
  303. <if test="record.token != null">
  304. token = #{record.token,jdbcType=VARCHAR},
  305. </if>
  306. <if test="record.money != null">
  307. money = #{record.money,jdbcType=INTEGER},
  308. </if>
  309. <if test="record.indate != null">
  310. indate = #{record.indate,jdbcType=TIMESTAMP},
  311. </if>
  312. <if test="record.deviceId != null">
  313. device_id = #{record.deviceId,jdbcType=VARCHAR},
  314. </if>
  315. <if test="record.address != null">
  316. address = #{record.address,jdbcType=VARCHAR},
  317. </if>
  318. <if test="record.income != null">
  319. income = #{record.income,jdbcType=INTEGER},
  320. </if>
  321. <if test="record.carNo != null">
  322. car_no = #{record.carNo,jdbcType=VARCHAR},
  323. </if>
  324. <if test="record.comId != null">
  325. com_id = #{record.comId,jdbcType=INTEGER},
  326. </if>
  327. <if test="record.count != null">
  328. count = #{record.count,jdbcType=VARCHAR},
  329. </if>
  330. <if test="record.qrCode != null">
  331. qr_code = #{record.qrCode,jdbcType=VARCHAR},
  332. </if>
  333. <if test="record.isOwner != null">
  334. is_owner = #{record.isOwner,jdbcType=INTEGER},
  335. </if>
  336. </set>
  337. <if test="_parameter != null">
  338. <include refid="Update_By_Example_Where_Clause" />
  339. </if>
  340. </update>
  341. <update id="updateByExample" parameterType="map">
  342. <!--
  343. WARNING - @mbggenerated
  344. This element is automatically generated by MyBatis Generator, do not modify.
  345. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  346. -->
  347. update user
  348. set id = #{record.id,jdbcType=INTEGER},
  349. mobile = #{record.mobile,jdbcType=VARCHAR},
  350. avatar = #{record.avatar,jdbcType=VARCHAR},
  351. nickname = #{record.nickname,jdbcType=VARCHAR},
  352. token = #{record.token,jdbcType=VARCHAR},
  353. money = #{record.money,jdbcType=INTEGER},
  354. indate = #{record.indate,jdbcType=TIMESTAMP},
  355. device_id = #{record.deviceId,jdbcType=VARCHAR},
  356. address = #{record.address,jdbcType=VARCHAR},
  357. income = #{record.income,jdbcType=INTEGER},
  358. car_no = #{record.carNo,jdbcType=VARCHAR},
  359. com_id = #{record.comId,jdbcType=INTEGER},
  360. count = #{record.count,jdbcType=VARCHAR},
  361. qr_code = #{record.qrCode,jdbcType=VARCHAR},
  362. is_owner = #{record.isOwner,jdbcType=INTEGER}
  363. <if test="_parameter != null">
  364. <include refid="Update_By_Example_Where_Clause" />
  365. </if>
  366. </update>
  367. <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.User">
  368. <!--
  369. WARNING - @mbggenerated
  370. This element is automatically generated by MyBatis Generator, do not modify.
  371. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  372. -->
  373. update user
  374. <set>
  375. <if test="mobile != null">
  376. mobile = #{mobile,jdbcType=VARCHAR},
  377. </if>
  378. <if test="avatar != null">
  379. avatar = #{avatar,jdbcType=VARCHAR},
  380. </if>
  381. <if test="nickname != null">
  382. nickname = #{nickname,jdbcType=VARCHAR},
  383. </if>
  384. <if test="token != null">
  385. token = #{token,jdbcType=VARCHAR},
  386. </if>
  387. <if test="money != null">
  388. money = #{money,jdbcType=INTEGER},
  389. </if>
  390. <if test="indate != null">
  391. indate = #{indate,jdbcType=TIMESTAMP},
  392. </if>
  393. <if test="deviceId != null">
  394. device_id = #{deviceId,jdbcType=VARCHAR},
  395. </if>
  396. <if test="address != null">
  397. address = #{address,jdbcType=VARCHAR},
  398. </if>
  399. <if test="income != null">
  400. income = #{income,jdbcType=INTEGER},
  401. </if>
  402. <if test="carNo != null">
  403. car_no = #{carNo,jdbcType=VARCHAR},
  404. </if>
  405. <if test="comId != null">
  406. com_id = #{comId,jdbcType=INTEGER},
  407. </if>
  408. <if test="count != null">
  409. count = #{count,jdbcType=VARCHAR},
  410. </if>
  411. <if test="qrCode != null">
  412. qr_code = #{qrCode,jdbcType=VARCHAR},
  413. </if>
  414. <if test="isOwner != null">
  415. is_owner = #{isOwner,jdbcType=INTEGER},
  416. </if>
  417. </set>
  418. where id = #{id,jdbcType=INTEGER}
  419. </update>
  420. <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.User">
  421. <!--
  422. WARNING - @mbggenerated
  423. This element is automatically generated by MyBatis Generator, do not modify.
  424. This element was generated on Mon Nov 06 13:39:10 CST 2017.
  425. -->
  426. update user
  427. set mobile = #{mobile,jdbcType=VARCHAR},
  428. avatar = #{avatar,jdbcType=VARCHAR},
  429. nickname = #{nickname,jdbcType=VARCHAR},
  430. token = #{token,jdbcType=VARCHAR},
  431. money = #{money,jdbcType=INTEGER},
  432. indate = #{indate,jdbcType=TIMESTAMP},
  433. device_id = #{deviceId,jdbcType=VARCHAR},
  434. address = #{address,jdbcType=VARCHAR},
  435. income = #{income,jdbcType=INTEGER},
  436. car_no = #{carNo,jdbcType=VARCHAR},
  437. com_id = #{comId,jdbcType=INTEGER},
  438. count = #{count,jdbcType=VARCHAR},
  439. qr_code = #{qrCode,jdbcType=VARCHAR},
  440. is_owner = #{isOwner,jdbcType=INTEGER}
  441. where id = #{id,jdbcType=INTEGER}
  442. </update>
  443. </mapper>