AppUserInfoMapper.xml 15 KB

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