OrganizationContactBookMapper.xml 15 KB

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