OrganizationContactBookMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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.OrganizationContactBookMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrganizationContactBook">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="uid" jdbcType="VARCHAR" property="uid" />
  12. <result column="name" jdbcType="VARCHAR" property="name" />
  13. <result column="sex" jdbcType="CHAR" property="sex" />
  14. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  15. <result column="email" jdbcType="VARCHAR" property="email" />
  16. <result column="qq" jdbcType="VARCHAR" property="qq" />
  17. <result column="wechat" jdbcType="VARCHAR" property="wechat" />
  18. <result column="department" jdbcType="VARCHAR" property="department" />
  19. <result column="position" jdbcType="VARCHAR" property="position" />
  20. <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
  21. <result column="major" jdbcType="INTEGER" property="major" />
  22. <result column="aid" jdbcType="VARCHAR" property="aid" />
  23. <result column="fixed_tel" jdbcType="VARCHAR" property="fixedTel" />
  24. <result column="aname" jdbcType="VARCHAR" property="aname" />
  25. </resultMap>
  26. <sql id="Example_Where_Clause">
  27. <!--
  28. WARNING - @mbg.generated
  29. This element is automatically generated by MyBatis Generator, do not modify.
  30. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  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 - @mbg.generated
  63. This element is automatically generated by MyBatis Generator, do not modify.
  64. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  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 - @mbg.generated
  97. This element is automatically generated by MyBatis Generator, do not modify.
  98. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  99. -->
  100. id, uid, name, sex, mobile, email, qq, wechat, department, position, tel_num, major,
  101. aid, fixed_tel, aname
  102. </sql>
  103. <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationContactBookExample" resultMap="BaseResultMap">
  104. <!--
  105. WARNING - @mbg.generated
  106. This element is automatically generated by MyBatis Generator, do not modify.
  107. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  108. -->
  109. select
  110. <if test="distinct">
  111. distinct
  112. </if>
  113. <include refid="Base_Column_List" />
  114. from organization_contact_book
  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.String" resultMap="BaseResultMap">
  123. <!--
  124. WARNING - @mbg.generated
  125. This element is automatically generated by MyBatis Generator, do not modify.
  126. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  127. -->
  128. select
  129. <include refid="Base_Column_List" />
  130. from organization_contact_book
  131. where id = #{id,jdbcType=VARCHAR}
  132. </select>
  133. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  134. <!--
  135. WARNING - @mbg.generated
  136. This element is automatically generated by MyBatis Generator, do not modify.
  137. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  138. -->
  139. delete from organization_contact_book
  140. where id = #{id,jdbcType=VARCHAR}
  141. </delete>
  142. <delete id="deleteByExample" parameterType="com.goafanti.common.model.OrganizationContactBookExample">
  143. <!--
  144. WARNING - @mbg.generated
  145. This element is automatically generated by MyBatis Generator, do not modify.
  146. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  147. -->
  148. delete from organization_contact_book
  149. <if test="_parameter != null">
  150. <include refid="Example_Where_Clause" />
  151. </if>
  152. </delete>
  153. <insert id="insert" parameterType="com.goafanti.common.model.OrganizationContactBook">
  154. <!--
  155. WARNING - @mbg.generated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  158. -->
  159. insert into organization_contact_book (id, uid, name,
  160. sex, mobile, email, qq,
  161. wechat, department, position,
  162. tel_num, major, aid,
  163. fixed_tel, aname)
  164. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  165. #{sex,jdbcType=CHAR}, #{mobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR},
  166. #{wechat,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
  167. #{telNum,jdbcType=VARCHAR}, #{major,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR},
  168. #{fixedTel,jdbcType=VARCHAR}, #{aname,jdbcType=VARCHAR})
  169. </insert>
  170. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationContactBook">
  171. <!--
  172. WARNING - @mbg.generated
  173. This element is automatically generated by MyBatis Generator, do not modify.
  174. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  175. -->
  176. insert into organization_contact_book
  177. <trim prefix="(" suffix=")" suffixOverrides=",">
  178. <if test="id != null">
  179. id,
  180. </if>
  181. <if test="uid != null">
  182. uid,
  183. </if>
  184. <if test="name != null">
  185. name,
  186. </if>
  187. <if test="sex != null">
  188. sex,
  189. </if>
  190. <if test="mobile != null">
  191. mobile,
  192. </if>
  193. <if test="email != null">
  194. email,
  195. </if>
  196. <if test="qq != null">
  197. qq,
  198. </if>
  199. <if test="wechat != null">
  200. wechat,
  201. </if>
  202. <if test="department != null">
  203. department,
  204. </if>
  205. <if test="position != null">
  206. position,
  207. </if>
  208. <if test="telNum != null">
  209. tel_num,
  210. </if>
  211. <if test="major != null">
  212. major,
  213. </if>
  214. <if test="aid != null">
  215. aid,
  216. </if>
  217. <if test="fixedTel != null">
  218. fixed_tel,
  219. </if>
  220. <if test="aname != null">
  221. aname,
  222. </if>
  223. </trim>
  224. <trim prefix="values (" suffix=")" suffixOverrides=",">
  225. <if test="id != null">
  226. #{id,jdbcType=VARCHAR},
  227. </if>
  228. <if test="uid != null">
  229. #{uid,jdbcType=VARCHAR},
  230. </if>
  231. <if test="name != null">
  232. #{name,jdbcType=VARCHAR},
  233. </if>
  234. <if test="sex != null">
  235. #{sex,jdbcType=CHAR},
  236. </if>
  237. <if test="mobile != null">
  238. #{mobile,jdbcType=VARCHAR},
  239. </if>
  240. <if test="email != null">
  241. #{email,jdbcType=VARCHAR},
  242. </if>
  243. <if test="qq != null">
  244. #{qq,jdbcType=VARCHAR},
  245. </if>
  246. <if test="wechat != null">
  247. #{wechat,jdbcType=VARCHAR},
  248. </if>
  249. <if test="department != null">
  250. #{department,jdbcType=VARCHAR},
  251. </if>
  252. <if test="position != null">
  253. #{position,jdbcType=VARCHAR},
  254. </if>
  255. <if test="telNum != null">
  256. #{telNum,jdbcType=VARCHAR},
  257. </if>
  258. <if test="major != null">
  259. #{major,jdbcType=INTEGER},
  260. </if>
  261. <if test="aid != null">
  262. #{aid,jdbcType=VARCHAR},
  263. </if>
  264. <if test="fixedTel != null">
  265. #{fixedTel,jdbcType=VARCHAR},
  266. </if>
  267. <if test="aname != null">
  268. #{aname,jdbcType=VARCHAR},
  269. </if>
  270. </trim>
  271. </insert>
  272. <select id="countByExample" parameterType="com.goafanti.common.model.OrganizationContactBookExample" resultType="java.lang.Long">
  273. <!--
  274. WARNING - @mbg.generated
  275. This element is automatically generated by MyBatis Generator, do not modify.
  276. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  277. -->
  278. select count(*) from organization_contact_book
  279. <if test="_parameter != null">
  280. <include refid="Example_Where_Clause" />
  281. </if>
  282. </select>
  283. <update id="updateByExampleSelective" parameterType="map">
  284. <!--
  285. WARNING - @mbg.generated
  286. This element is automatically generated by MyBatis Generator, do not modify.
  287. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  288. -->
  289. update organization_contact_book
  290. <set>
  291. <if test="record.id != null">
  292. id = #{record.id,jdbcType=VARCHAR},
  293. </if>
  294. <if test="record.uid != null">
  295. uid = #{record.uid,jdbcType=VARCHAR},
  296. </if>
  297. <if test="record.name != null">
  298. name = #{record.name,jdbcType=VARCHAR},
  299. </if>
  300. <if test="record.sex != null">
  301. sex = #{record.sex,jdbcType=CHAR},
  302. </if>
  303. <if test="record.mobile != null">
  304. mobile = #{record.mobile,jdbcType=VARCHAR},
  305. </if>
  306. <if test="record.email != null">
  307. email = #{record.email,jdbcType=VARCHAR},
  308. </if>
  309. <if test="record.qq != null">
  310. qq = #{record.qq,jdbcType=VARCHAR},
  311. </if>
  312. <if test="record.wechat != null">
  313. wechat = #{record.wechat,jdbcType=VARCHAR},
  314. </if>
  315. <if test="record.department != null">
  316. department = #{record.department,jdbcType=VARCHAR},
  317. </if>
  318. <if test="record.position != null">
  319. position = #{record.position,jdbcType=VARCHAR},
  320. </if>
  321. <if test="record.telNum != null">
  322. tel_num = #{record.telNum,jdbcType=VARCHAR},
  323. </if>
  324. <if test="record.major != null">
  325. major = #{record.major,jdbcType=INTEGER},
  326. </if>
  327. <if test="record.aid != null">
  328. aid = #{record.aid,jdbcType=VARCHAR},
  329. </if>
  330. <if test="record.fixedTel != null">
  331. fixed_tel = #{record.fixedTel,jdbcType=VARCHAR},
  332. </if>
  333. <if test="record.aname != null">
  334. aname = #{record.aname,jdbcType=VARCHAR},
  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 - @mbg.generated
  344. This element is automatically generated by MyBatis Generator, do not modify.
  345. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  346. -->
  347. update organization_contact_book
  348. set id = #{record.id,jdbcType=VARCHAR},
  349. uid = #{record.uid,jdbcType=VARCHAR},
  350. name = #{record.name,jdbcType=VARCHAR},
  351. sex = #{record.sex,jdbcType=CHAR},
  352. mobile = #{record.mobile,jdbcType=VARCHAR},
  353. email = #{record.email,jdbcType=VARCHAR},
  354. qq = #{record.qq,jdbcType=VARCHAR},
  355. wechat = #{record.wechat,jdbcType=VARCHAR},
  356. department = #{record.department,jdbcType=VARCHAR},
  357. position = #{record.position,jdbcType=VARCHAR},
  358. tel_num = #{record.telNum,jdbcType=VARCHAR},
  359. major = #{record.major,jdbcType=INTEGER},
  360. aid = #{record.aid,jdbcType=VARCHAR},
  361. fixed_tel = #{record.fixedTel,jdbcType=VARCHAR},
  362. aname = #{record.aname,jdbcType=VARCHAR}
  363. <if test="_parameter != null">
  364. <include refid="Update_By_Example_Where_Clause" />
  365. </if>
  366. </update>
  367. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationContactBook">
  368. <!--
  369. WARNING - @mbg.generated
  370. This element is automatically generated by MyBatis Generator, do not modify.
  371. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  372. -->
  373. update organization_contact_book
  374. <set>
  375. <if test="uid != null">
  376. uid = #{uid,jdbcType=VARCHAR},
  377. </if>
  378. <if test="name != null">
  379. name = #{name,jdbcType=VARCHAR},
  380. </if>
  381. <if test="sex != null">
  382. sex = #{sex,jdbcType=CHAR},
  383. </if>
  384. <if test="mobile != null">
  385. mobile = #{mobile,jdbcType=VARCHAR},
  386. </if>
  387. <if test="email != null">
  388. email = #{email,jdbcType=VARCHAR},
  389. </if>
  390. <if test="qq != null">
  391. qq = #{qq,jdbcType=VARCHAR},
  392. </if>
  393. <if test="wechat != null">
  394. wechat = #{wechat,jdbcType=VARCHAR},
  395. </if>
  396. <if test="department != null">
  397. department = #{department,jdbcType=VARCHAR},
  398. </if>
  399. <if test="position != null">
  400. position = #{position,jdbcType=VARCHAR},
  401. </if>
  402. <if test="telNum != null">
  403. tel_num = #{telNum,jdbcType=VARCHAR},
  404. </if>
  405. <if test="major != null">
  406. major = #{major,jdbcType=INTEGER},
  407. </if>
  408. <if test="aid != null">
  409. aid = #{aid,jdbcType=VARCHAR},
  410. </if>
  411. <if test="fixedTel != null">
  412. fixed_tel = #{fixedTel,jdbcType=VARCHAR},
  413. </if>
  414. <if test="aname != null">
  415. aname = #{aname,jdbcType=VARCHAR},
  416. </if>
  417. </set>
  418. where id = #{id,jdbcType=VARCHAR}
  419. </update>
  420. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrganizationContactBook">
  421. <!--
  422. WARNING - @mbg.generated
  423. This element is automatically generated by MyBatis Generator, do not modify.
  424. This element was generated on Fri Jun 05 08:58:43 CST 2020.
  425. -->
  426. update organization_contact_book
  427. set uid = #{uid,jdbcType=VARCHAR},
  428. name = #{name,jdbcType=VARCHAR},
  429. sex = #{sex,jdbcType=CHAR},
  430. mobile = #{mobile,jdbcType=VARCHAR},
  431. email = #{email,jdbcType=VARCHAR},
  432. qq = #{qq,jdbcType=VARCHAR},
  433. wechat = #{wechat,jdbcType=VARCHAR},
  434. department = #{department,jdbcType=VARCHAR},
  435. position = #{position,jdbcType=VARCHAR},
  436. tel_num = #{telNum,jdbcType=VARCHAR},
  437. major = #{major,jdbcType=INTEGER},
  438. aid = #{aid,jdbcType=VARCHAR},
  439. fixed_tel = #{fixedTel,jdbcType=VARCHAR},
  440. aname = #{aname,jdbcType=VARCHAR}
  441. where id = #{id,jdbcType=VARCHAR}
  442. </update>
  443. <select id="checkContacts" resultType="java.lang.Integer">
  444. select
  445. count( 0 )
  446. from
  447. organization_contact_book
  448. where
  449. aid = #{aid,jdbcType=VARCHAR}
  450. and uid = #{uid,jdbcType=VARCHAR}
  451. and mobile = #{mobile,jdbcType=VARCHAR}
  452. </select>
  453. <update id="updateSubContact">
  454. update organization_contact_book set major = 0 where uid = #{uid,jdbcType=VARCHAR}
  455. </update>
  456. <update id="updateMainContact">
  457. update organization_contact_book set major = 1 where id = #{ocbId,jdbcType=VARCHAR}
  458. </update>
  459. <update id="updateDimissionTransfer">
  460. update organization_contact_book
  461. set aid=#{transferId,jdbcType=VARCHAR}
  462. where aid=#{aid,jdbcType=VARCHAR}
  463. </update>
  464. <update id="updateAdmin">
  465. update organization_contact_book set aid = #{aid,jdbcType=VARCHAR} where uid = #{uid,jdbcType=VARCHAR}
  466. </update>
  467. <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
  468. INSERT INTO organization_contact_book
  469. (id, uid, name, mobile,major)VALUES
  470. <foreach item="item" index="index" collection="list" separator=",">
  471. (UUID(), #{item.uid,jdbcType=VARCHAR}, #{item.userName,jdbcType=VARCHAR},
  472. #{item.contactMobile,jdbcType=VARCHAR},1)
  473. </foreach>
  474. </insert>
  475. <update id="updateByUids">
  476. update organization_contact_book
  477. set aid= #{aid}
  478. where uid in(
  479. <foreach item="item" index="index" collection="list" separator=",">
  480. #{item}
  481. </foreach>
  482. )
  483. </update>
  484. <select id="getMajor" resultType="com.goafanti.common.model.OrganizationContactBook">
  485. select
  486. <include refid="Base_Column_List" />
  487. from organization_contact_book
  488. where uid = #{uid} and aid= #{aid}
  489. </select>
  490. </mapper>