JpushEasemobAccountMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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.JpushEasemobAccountMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.JpushEasemobAccount">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="uuid" jdbcType="VARCHAR" property="uuid" />
  12. <result column="registration_id" jdbcType="VARCHAR" property="registrationId" />
  13. <result column="uid" jdbcType="VARCHAR" property="uid" />
  14. <result column="tag" jdbcType="VARCHAR" property="tag" />
  15. <result column="group_id" jdbcType="VARCHAR" property="groupId" />
  16. <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
  17. <result column="easemob_name" jdbcType="VARCHAR" property="easemobName" />
  18. <result column="easemob_pass" jdbcType="VARCHAR" property="easemobPass" />
  19. </resultMap>
  20. <sql id="Example_Where_Clause">
  21. <!--
  22. WARNING - @mbg.generated
  23. This element is automatically generated by MyBatis Generator, do not modify.
  24. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  25. -->
  26. <where>
  27. <foreach collection="oredCriteria" item="criteria" separator="or">
  28. <if test="criteria.valid">
  29. <trim prefix="(" prefixOverrides="and" suffix=")">
  30. <foreach collection="criteria.criteria" item="criterion">
  31. <choose>
  32. <when test="criterion.noValue">
  33. and ${criterion.condition}
  34. </when>
  35. <when test="criterion.singleValue">
  36. and ${criterion.condition} #{criterion.value}
  37. </when>
  38. <when test="criterion.betweenValue">
  39. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  40. </when>
  41. <when test="criterion.listValue">
  42. and ${criterion.condition}
  43. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  44. #{listItem}
  45. </foreach>
  46. </when>
  47. </choose>
  48. </foreach>
  49. </trim>
  50. </if>
  51. </foreach>
  52. </where>
  53. </sql>
  54. <sql id="Update_By_Example_Where_Clause">
  55. <!--
  56. WARNING - @mbg.generated
  57. This element is automatically generated by MyBatis Generator, do not modify.
  58. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  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. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  93. -->
  94. id, uuid, registration_id, uid, tag, group_id, last_login_time, easemob_name, easemob_pass
  95. </sql>
  96. <select id="selectByExample" parameterType="com.goafanti.common.model.JpushEasemobAccountExample" resultMap="BaseResultMap">
  97. <!--
  98. WARNING - @mbg.generated
  99. This element is automatically generated by MyBatis Generator, do not modify.
  100. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  101. -->
  102. select
  103. <if test="distinct">
  104. distinct
  105. </if>
  106. <include refid="Base_Column_List" />
  107. from jpush_easemob_account
  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.Integer" resultMap="BaseResultMap">
  116. <!--
  117. WARNING - @mbg.generated
  118. This element is automatically generated by MyBatis Generator, do not modify.
  119. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  120. -->
  121. select
  122. <include refid="Base_Column_List" />
  123. from jpush_easemob_account
  124. where id = #{id,jdbcType=INTEGER}
  125. </select>
  126. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  127. <!--
  128. WARNING - @mbg.generated
  129. This element is automatically generated by MyBatis Generator, do not modify.
  130. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  131. -->
  132. delete from jpush_easemob_account
  133. where id = #{id,jdbcType=INTEGER}
  134. </delete>
  135. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JpushEasemobAccountExample">
  136. <!--
  137. WARNING - @mbg.generated
  138. This element is automatically generated by MyBatis Generator, do not modify.
  139. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  140. -->
  141. delete from jpush_easemob_account
  142. <if test="_parameter != null">
  143. <include refid="Example_Where_Clause" />
  144. </if>
  145. </delete>
  146. <insert id="insert" parameterType="com.goafanti.common.model.JpushEasemobAccount">
  147. <!--
  148. WARNING - @mbg.generated
  149. This element is automatically generated by MyBatis Generator, do not modify.
  150. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  151. -->
  152. insert into jpush_easemob_account (id, uuid, registration_id,
  153. uid, tag, group_id,
  154. last_login_time, easemob_name, easemob_pass
  155. )
  156. values (#{id,jdbcType=INTEGER}, #{uuid,jdbcType=VARCHAR}, #{registrationId,jdbcType=VARCHAR},
  157. #{uid,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR},
  158. #{lastLoginTime,jdbcType=TIMESTAMP}, #{easemobName,jdbcType=VARCHAR}, #{easemobPass,jdbcType=VARCHAR}
  159. )
  160. </insert>
  161. <insert id="insertSelective" parameterType="com.goafanti.common.model.JpushEasemobAccount">
  162. <!--
  163. WARNING - @mbg.generated
  164. This element is automatically generated by MyBatis Generator, do not modify.
  165. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  166. -->
  167. insert into jpush_easemob_account
  168. <trim prefix="(" suffix=")" suffixOverrides=",">
  169. <if test="id != null">
  170. id,
  171. </if>
  172. <if test="uuid != null">
  173. uuid,
  174. </if>
  175. <if test="registrationId != null">
  176. registration_id,
  177. </if>
  178. <if test="uid != null">
  179. uid,
  180. </if>
  181. <if test="tag != null">
  182. tag,
  183. </if>
  184. <if test="groupId != null">
  185. group_id,
  186. </if>
  187. <if test="lastLoginTime != null">
  188. last_login_time,
  189. </if>
  190. <if test="easemobName != null">
  191. easemob_name,
  192. </if>
  193. <if test="easemobPass != null">
  194. easemob_pass,
  195. </if>
  196. </trim>
  197. <trim prefix="values (" suffix=")" suffixOverrides=",">
  198. <if test="id != null">
  199. #{id,jdbcType=INTEGER},
  200. </if>
  201. <if test="uuid != null">
  202. #{uuid,jdbcType=VARCHAR},
  203. </if>
  204. <if test="registrationId != null">
  205. #{registrationId,jdbcType=VARCHAR},
  206. </if>
  207. <if test="uid != null">
  208. #{uid,jdbcType=VARCHAR},
  209. </if>
  210. <if test="tag != null">
  211. #{tag,jdbcType=VARCHAR},
  212. </if>
  213. <if test="groupId != null">
  214. #{groupId,jdbcType=VARCHAR},
  215. </if>
  216. <if test="lastLoginTime != null">
  217. #{lastLoginTime,jdbcType=TIMESTAMP},
  218. </if>
  219. <if test="easemobName != null">
  220. #{easemobName,jdbcType=VARCHAR},
  221. </if>
  222. <if test="easemobPass != null">
  223. #{easemobPass,jdbcType=VARCHAR},
  224. </if>
  225. </trim>
  226. </insert>
  227. <select id="countByExample" parameterType="com.goafanti.common.model.JpushEasemobAccountExample" resultType="java.lang.Long">
  228. <!--
  229. WARNING - @mbg.generated
  230. This element is automatically generated by MyBatis Generator, do not modify.
  231. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  232. -->
  233. select count(*) from jpush_easemob_account
  234. <if test="_parameter != null">
  235. <include refid="Example_Where_Clause" />
  236. </if>
  237. </select>
  238. <update id="updateByExampleSelective" parameterType="map">
  239. <!--
  240. WARNING - @mbg.generated
  241. This element is automatically generated by MyBatis Generator, do not modify.
  242. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  243. -->
  244. update jpush_easemob_account
  245. <set>
  246. <if test="record.id != null">
  247. id = #{record.id,jdbcType=INTEGER},
  248. </if>
  249. <if test="record.uuid != null">
  250. uuid = #{record.uuid,jdbcType=VARCHAR},
  251. </if>
  252. <if test="record.registrationId != null">
  253. registration_id = #{record.registrationId,jdbcType=VARCHAR},
  254. </if>
  255. <if test="record.uid != null">
  256. uid = #{record.uid,jdbcType=VARCHAR},
  257. </if>
  258. <if test="record.tag != null">
  259. tag = #{record.tag,jdbcType=VARCHAR},
  260. </if>
  261. <if test="record.groupId != null">
  262. group_id = #{record.groupId,jdbcType=VARCHAR},
  263. </if>
  264. <if test="record.lastLoginTime != null">
  265. last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="record.easemobName != null">
  268. easemob_name = #{record.easemobName,jdbcType=VARCHAR},
  269. </if>
  270. <if test="record.easemobPass != null">
  271. easemob_pass = #{record.easemobPass,jdbcType=VARCHAR},
  272. </if>
  273. </set>
  274. <if test="_parameter != null">
  275. <include refid="Update_By_Example_Where_Clause" />
  276. </if>
  277. </update>
  278. <update id="updateByExample" parameterType="map">
  279. <!--
  280. WARNING - @mbg.generated
  281. This element is automatically generated by MyBatis Generator, do not modify.
  282. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  283. -->
  284. update jpush_easemob_account
  285. set id = #{record.id,jdbcType=INTEGER},
  286. uuid = #{record.uuid,jdbcType=VARCHAR},
  287. registration_id = #{record.registrationId,jdbcType=VARCHAR},
  288. uid = #{record.uid,jdbcType=VARCHAR},
  289. tag = #{record.tag,jdbcType=VARCHAR},
  290. group_id = #{record.groupId,jdbcType=VARCHAR},
  291. last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
  292. easemob_name = #{record.easemobName,jdbcType=VARCHAR},
  293. easemob_pass = #{record.easemobPass,jdbcType=VARCHAR}
  294. <if test="_parameter != null">
  295. <include refid="Update_By_Example_Where_Clause" />
  296. </if>
  297. </update>
  298. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JpushEasemobAccount">
  299. <!--
  300. WARNING - @mbg.generated
  301. This element is automatically generated by MyBatis Generator, do not modify.
  302. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  303. -->
  304. update jpush_easemob_account
  305. <set>
  306. <if test="uuid != null">
  307. uuid = #{uuid,jdbcType=VARCHAR},
  308. </if>
  309. <if test="registrationId != null">
  310. registration_id = #{registrationId,jdbcType=VARCHAR},
  311. </if>
  312. <if test="uid != null">
  313. uid = #{uid,jdbcType=VARCHAR},
  314. </if>
  315. <if test="tag != null">
  316. tag = #{tag,jdbcType=VARCHAR},
  317. </if>
  318. <if test="groupId != null">
  319. group_id = #{groupId,jdbcType=VARCHAR},
  320. </if>
  321. <if test="lastLoginTime != null">
  322. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="easemobName != null">
  325. easemob_name = #{easemobName,jdbcType=VARCHAR},
  326. </if>
  327. <if test="easemobPass != null">
  328. easemob_pass = #{easemobPass,jdbcType=VARCHAR},
  329. </if>
  330. </set>
  331. where id = #{id,jdbcType=INTEGER}
  332. </update>
  333. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JpushEasemobAccount">
  334. <!--
  335. WARNING - @mbg.generated
  336. This element is automatically generated by MyBatis Generator, do not modify.
  337. This element was generated on Mon Dec 25 14:46:37 CST 2017.
  338. -->
  339. update jpush_easemob_account
  340. set uuid = #{uuid,jdbcType=VARCHAR},
  341. registration_id = #{registrationId,jdbcType=VARCHAR},
  342. uid = #{uid,jdbcType=VARCHAR},
  343. tag = #{tag,jdbcType=VARCHAR},
  344. group_id = #{groupId,jdbcType=VARCHAR},
  345. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  346. easemob_name = #{easemobName,jdbcType=VARCHAR},
  347. easemob_pass = #{easemobPass,jdbcType=VARCHAR}
  348. where id = #{id,jdbcType=INTEGER}
  349. </update>
  350. <select id="selectSynAccByUid" parameterType="java.lang.String" resultMap="BaseResultMap">
  351. select
  352. <include refid="Base_Column_List" />
  353. from jpush_easemob_account
  354. where uid = #{uid,jdbcType=VARCHAR}
  355. </select>
  356. <select id="findJpushClientsByType" resultType="com.goafanti.user.bo.ClientListBo">
  357. select jea.uid,
  358. u.identify_name as name,u.society_tag as societyTag,u.create_time as createTime,c.contacts,c.contact_mobile as contactMobile,dg.name as provinceS,fg.name as industryS,
  359. <if test="clientType!=null and clientType==0">
  360. i.province as province,
  361. </if>
  362. <if test="clientType!=null and clientType==1">
  363. i.licence_province as province,
  364. </if>
  365. <if test="clientType!=null and clientType==0">
  366. i.industry as industry
  367. </if>
  368. <if test="clientType!=null and clientType==1">
  369. i.field as field
  370. </if>
  371. from jpush_easemob_account jea
  372. left join user u on u.id=jea.uid
  373. <if test="clientType!=null and clientType==0">
  374. left join user_identity i on i.uid =jea.uid
  375. </if>
  376. <if test="clientType!=null and clientType==1">
  377. left join organization_identity i on i.uid =jea.uid
  378. </if>
  379. left join contract c on c.uid=u.id
  380. <if test="clientType!=null and clientType==0">
  381. left join district_glossory dg on dg.id=i.province
  382. </if>
  383. <if test="clientType!=null and clientType==1">
  384. left join district_glossory dg on dg.id=i.licence_province
  385. </if>
  386. <if test="clientType!=null and clientType==0">
  387. left join field_glossory fg on fg.id=i.industry
  388. </if>
  389. <if test="clientType!=null and clientType==1">
  390. left join field_glossory fg on fg.id=i.field
  391. </if>
  392. where i.uid=jea.uid
  393. <if test="page_sql!=null">
  394. ${page_sql}
  395. </if>
  396. </select>
  397. <select id="findJpushClientsCountByType" resultType="java.lang.Integer">
  398. select count(0)
  399. from jpush_easemob_account jea
  400. left join user u on u.id=jea.uid
  401. <if test="clientType!=null and clientType==0">
  402. left join user_identity i on i.uid =jea.uid
  403. </if>
  404. <if test="clientType!=null and clientType==1">
  405. left join organization_identity i on i.uid =jea.uid
  406. </if>
  407. left join contract c on c.uid=u.id
  408. where i.uid=jea.uid
  409. </select>
  410. </mapper>