UserDOMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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.cdu.lys.graduation.repository.dao.UserDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.UserDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="username" jdbcType="VARCHAR" javaType="java.lang.String" />
  8. <arg column="password" jdbcType="VARCHAR" javaType="java.lang.String" />
  9. <arg column="nickname" jdbcType="VARCHAR" javaType="java.lang.String" />
  10. <arg column="gender" jdbcType="INTEGER" javaType="java.lang.Integer" />
  11. <arg column="city" jdbcType="VARCHAR" javaType="java.lang.String" />
  12. <arg column="province" jdbcType="VARCHAR" javaType="java.lang.String" />
  13. <arg column="country" jdbcType="VARCHAR" javaType="java.lang.String" />
  14. <arg column="avatar_url" jdbcType="VARCHAR" javaType="java.lang.String" />
  15. <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
  16. <arg column="open_id" jdbcType="VARCHAR" javaType="java.lang.String" />
  17. <arg column="type" jdbcType="INTEGER" javaType="java.lang.Integer" />
  18. <arg column="salt" jdbcType="VARCHAR" javaType="java.lang.String" />
  19. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  20. <arg column="update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  21. <arg column="is_delete" jdbcType="CHAR" javaType="java.lang.String" />
  22. </constructor>
  23. </resultMap>
  24. <sql id="Example_Where_Clause" >
  25. <where >
  26. <foreach collection="oredCriteria" item="criteria" separator="or" >
  27. <if test="criteria.valid" >
  28. <trim prefix="(" suffix=")" prefixOverrides="and" >
  29. <foreach collection="criteria.criteria" item="criterion" >
  30. <choose >
  31. <when test="criterion.noValue" >
  32. and ${criterion.condition}
  33. </when>
  34. <when test="criterion.singleValue" >
  35. and ${criterion.condition} #{criterion.value}
  36. </when>
  37. <when test="criterion.betweenValue" >
  38. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  39. </when>
  40. <when test="criterion.listValue" >
  41. and ${criterion.condition}
  42. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  43. #{listItem}
  44. </foreach>
  45. </when>
  46. </choose>
  47. </foreach>
  48. </trim>
  49. </if>
  50. </foreach>
  51. </where>
  52. </sql>
  53. <sql id="Update_By_Example_Where_Clause" >
  54. <where >
  55. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  56. <if test="criteria.valid" >
  57. <trim prefix="(" suffix=")" prefixOverrides="and" >
  58. <foreach collection="criteria.criteria" item="criterion" >
  59. <choose >
  60. <when test="criterion.noValue" >
  61. and ${criterion.condition}
  62. </when>
  63. <when test="criterion.singleValue" >
  64. and ${criterion.condition} #{criterion.value}
  65. </when>
  66. <when test="criterion.betweenValue" >
  67. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  68. </when>
  69. <when test="criterion.listValue" >
  70. and ${criterion.condition}
  71. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  72. #{listItem}
  73. </foreach>
  74. </when>
  75. </choose>
  76. </foreach>
  77. </trim>
  78. </if>
  79. </foreach>
  80. </where>
  81. </sql>
  82. <sql id="Base_Column_List" >
  83. id, username, password, nickname, gender, city, province, country, avatar_url, phone,
  84. open_id, type, salt, create_time, update_time, is_delete
  85. </sql>
  86. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.UserDOExample" >
  87. select
  88. <if test="distinct" >
  89. distinct
  90. </if>
  91. 'true' as QUERYID,
  92. <include refid="Base_Column_List" />
  93. from tb_user
  94. <if test="_parameter != null" >
  95. <include refid="Example_Where_Clause" />
  96. </if>
  97. <if test="orderByClause != null" >
  98. order by ${orderByClause}
  99. </if>
  100. </select>
  101. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  102. select
  103. <include refid="Base_Column_List" />
  104. from tb_user
  105. where id = #{id,jdbcType=INTEGER}
  106. </select>
  107. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  108. delete from tb_user
  109. where id = #{id,jdbcType=INTEGER}
  110. </delete>
  111. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.UserDOExample" >
  112. delete from tb_user
  113. <if test="_parameter != null" >
  114. <include refid="Example_Where_Clause" />
  115. </if>
  116. </delete>
  117. <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.UserDO" >
  118. insert into tb_user (id, username, password,
  119. nickname, gender, city,
  120. province, country, avatar_url,
  121. phone, open_id, type,
  122. salt, create_time, update_time,
  123. is_delete)
  124. values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  125. #{nickname,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{city,jdbcType=VARCHAR},
  126. #{province,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{avatarUrl,jdbcType=VARCHAR},
  127. #{phone,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  128. #{salt,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
  129. #{isDelete,jdbcType=CHAR})
  130. </insert>
  131. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.UserDO" >
  132. insert into tb_user
  133. <trim prefix="(" suffix=")" suffixOverrides="," >
  134. <if test="id != null" >
  135. id,
  136. </if>
  137. <if test="username != null" >
  138. username,
  139. </if>
  140. <if test="password != null" >
  141. password,
  142. </if>
  143. <if test="nickname != null" >
  144. nickname,
  145. </if>
  146. <if test="gender != null" >
  147. gender,
  148. </if>
  149. <if test="city != null" >
  150. city,
  151. </if>
  152. <if test="province != null" >
  153. province,
  154. </if>
  155. <if test="country != null" >
  156. country,
  157. </if>
  158. <if test="avatarUrl != null" >
  159. avatar_url,
  160. </if>
  161. <if test="phone != null" >
  162. phone,
  163. </if>
  164. <if test="openId != null" >
  165. open_id,
  166. </if>
  167. <if test="type != null" >
  168. type,
  169. </if>
  170. <if test="salt != null" >
  171. salt,
  172. </if>
  173. <if test="createTime != null" >
  174. create_time,
  175. </if>
  176. <if test="updateTime != null" >
  177. update_time,
  178. </if>
  179. <if test="isDelete != null" >
  180. is_delete,
  181. </if>
  182. </trim>
  183. <trim prefix="values (" suffix=")" suffixOverrides="," >
  184. <if test="id != null" >
  185. #{id,jdbcType=INTEGER},
  186. </if>
  187. <if test="username != null" >
  188. #{username,jdbcType=VARCHAR},
  189. </if>
  190. <if test="password != null" >
  191. #{password,jdbcType=VARCHAR},
  192. </if>
  193. <if test="nickname != null" >
  194. #{nickname,jdbcType=VARCHAR},
  195. </if>
  196. <if test="gender != null" >
  197. #{gender,jdbcType=INTEGER},
  198. </if>
  199. <if test="city != null" >
  200. #{city,jdbcType=VARCHAR},
  201. </if>
  202. <if test="province != null" >
  203. #{province,jdbcType=VARCHAR},
  204. </if>
  205. <if test="country != null" >
  206. #{country,jdbcType=VARCHAR},
  207. </if>
  208. <if test="avatarUrl != null" >
  209. #{avatarUrl,jdbcType=VARCHAR},
  210. </if>
  211. <if test="phone != null" >
  212. #{phone,jdbcType=VARCHAR},
  213. </if>
  214. <if test="openId != null" >
  215. #{openId,jdbcType=VARCHAR},
  216. </if>
  217. <if test="type != null" >
  218. #{type,jdbcType=INTEGER},
  219. </if>
  220. <if test="salt != null" >
  221. #{salt,jdbcType=VARCHAR},
  222. </if>
  223. <if test="createTime != null" >
  224. #{createTime,jdbcType=TIMESTAMP},
  225. </if>
  226. <if test="updateTime != null" >
  227. #{updateTime,jdbcType=TIMESTAMP},
  228. </if>
  229. <if test="isDelete != null" >
  230. #{isDelete,jdbcType=CHAR},
  231. </if>
  232. </trim>
  233. </insert>
  234. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.UserDOExample" resultType="java.lang.Integer" >
  235. select count(*) from tb_user
  236. <if test="_parameter != null" >
  237. <include refid="Example_Where_Clause" />
  238. </if>
  239. </select>
  240. <update id="updateByExampleSelective" parameterType="map" >
  241. update tb_user
  242. <set >
  243. <if test="record.id != null" >
  244. id = #{record.id,jdbcType=INTEGER},
  245. </if>
  246. <if test="record.username != null" >
  247. username = #{record.username,jdbcType=VARCHAR},
  248. </if>
  249. <if test="record.password != null" >
  250. password = #{record.password,jdbcType=VARCHAR},
  251. </if>
  252. <if test="record.nickname != null" >
  253. nickname = #{record.nickname,jdbcType=VARCHAR},
  254. </if>
  255. <if test="record.gender != null" >
  256. gender = #{record.gender,jdbcType=INTEGER},
  257. </if>
  258. <if test="record.city != null" >
  259. city = #{record.city,jdbcType=VARCHAR},
  260. </if>
  261. <if test="record.province != null" >
  262. province = #{record.province,jdbcType=VARCHAR},
  263. </if>
  264. <if test="record.country != null" >
  265. country = #{record.country,jdbcType=VARCHAR},
  266. </if>
  267. <if test="record.avatarUrl != null" >
  268. avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
  269. </if>
  270. <if test="record.phone != null" >
  271. phone = #{record.phone,jdbcType=VARCHAR},
  272. </if>
  273. <if test="record.openId != null" >
  274. open_id = #{record.openId,jdbcType=VARCHAR},
  275. </if>
  276. <if test="record.type != null" >
  277. type = #{record.type,jdbcType=INTEGER},
  278. </if>
  279. <if test="record.salt != null" >
  280. salt = #{record.salt,jdbcType=VARCHAR},
  281. </if>
  282. <if test="record.createTime != null" >
  283. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  284. </if>
  285. <if test="record.updateTime != null" >
  286. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="record.isDelete != null" >
  289. is_delete = #{record.isDelete,jdbcType=CHAR},
  290. </if>
  291. </set>
  292. <if test="_parameter != null" >
  293. <include refid="Update_By_Example_Where_Clause" />
  294. </if>
  295. </update>
  296. <update id="updateByExample" parameterType="map" >
  297. update tb_user
  298. set id = #{record.id,jdbcType=INTEGER},
  299. username = #{record.username,jdbcType=VARCHAR},
  300. password = #{record.password,jdbcType=VARCHAR},
  301. nickname = #{record.nickname,jdbcType=VARCHAR},
  302. gender = #{record.gender,jdbcType=INTEGER},
  303. city = #{record.city,jdbcType=VARCHAR},
  304. province = #{record.province,jdbcType=VARCHAR},
  305. country = #{record.country,jdbcType=VARCHAR},
  306. avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
  307. phone = #{record.phone,jdbcType=VARCHAR},
  308. open_id = #{record.openId,jdbcType=VARCHAR},
  309. type = #{record.type,jdbcType=INTEGER},
  310. salt = #{record.salt,jdbcType=VARCHAR},
  311. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  312. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  313. is_delete = #{record.isDelete,jdbcType=CHAR}
  314. <if test="_parameter != null" >
  315. <include refid="Update_By_Example_Where_Clause" />
  316. </if>
  317. </update>
  318. <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.UserDO" >
  319. update tb_user
  320. <set >
  321. <if test="username != null" >
  322. username = #{username,jdbcType=VARCHAR},
  323. </if>
  324. <if test="password != null" >
  325. password = #{password,jdbcType=VARCHAR},
  326. </if>
  327. <if test="nickname != null" >
  328. nickname = #{nickname,jdbcType=VARCHAR},
  329. </if>
  330. <if test="gender != null" >
  331. gender = #{gender,jdbcType=INTEGER},
  332. </if>
  333. <if test="city != null" >
  334. city = #{city,jdbcType=VARCHAR},
  335. </if>
  336. <if test="province != null" >
  337. province = #{province,jdbcType=VARCHAR},
  338. </if>
  339. <if test="country != null" >
  340. country = #{country,jdbcType=VARCHAR},
  341. </if>
  342. <if test="avatarUrl != null" >
  343. avatar_url = #{avatarUrl,jdbcType=VARCHAR},
  344. </if>
  345. <if test="phone != null" >
  346. phone = #{phone,jdbcType=VARCHAR},
  347. </if>
  348. <if test="openId != null" >
  349. open_id = #{openId,jdbcType=VARCHAR},
  350. </if>
  351. <if test="type != null" >
  352. type = #{type,jdbcType=INTEGER},
  353. </if>
  354. <if test="salt != null" >
  355. salt = #{salt,jdbcType=VARCHAR},
  356. </if>
  357. <if test="createTime != null" >
  358. create_time = #{createTime,jdbcType=TIMESTAMP},
  359. </if>
  360. <if test="updateTime != null" >
  361. update_time = #{updateTime,jdbcType=TIMESTAMP},
  362. </if>
  363. <if test="isDelete != null" >
  364. is_delete = #{isDelete,jdbcType=CHAR},
  365. </if>
  366. </set>
  367. where id = #{id,jdbcType=INTEGER}
  368. </update>
  369. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.UserDO" >
  370. update tb_user
  371. set username = #{username,jdbcType=VARCHAR},
  372. password = #{password,jdbcType=VARCHAR},
  373. nickname = #{nickname,jdbcType=VARCHAR},
  374. gender = #{gender,jdbcType=INTEGER},
  375. city = #{city,jdbcType=VARCHAR},
  376. province = #{province,jdbcType=VARCHAR},
  377. country = #{country,jdbcType=VARCHAR},
  378. avatar_url = #{avatarUrl,jdbcType=VARCHAR},
  379. phone = #{phone,jdbcType=VARCHAR},
  380. open_id = #{openId,jdbcType=VARCHAR},
  381. type = #{type,jdbcType=INTEGER},
  382. salt = #{salt,jdbcType=VARCHAR},
  383. create_time = #{createTime,jdbcType=TIMESTAMP},
  384. update_time = #{updateTime,jdbcType=TIMESTAMP},
  385. is_delete = #{isDelete,jdbcType=CHAR}
  386. where id = #{id,jdbcType=INTEGER}
  387. </update>
  388. </mapper>