UserMapper.xml 14 KB

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