CustomercontactMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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.usoftchina.saas.document.mapper.CustomercontactMapper">
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Customercontact">
  5. <id column="cc_id" jdbcType="INTEGER" property="id" />
  6. <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
  7. <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
  8. <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
  9. <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
  10. <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
  11. <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
  12. <result column="companyid" jdbcType="INTEGER" property="companyId" />
  13. <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
  14. <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="cc_text1" jdbcType="VARCHAR" property="cc_text1" />
  16. <result column="cc_text2" jdbcType="VARCHAR" property="cc_text2" />
  17. <result column="cc_text3" jdbcType="VARCHAR" property="cc_text3" />
  18. <result column="cc_text4" jdbcType="VARCHAR" property="cc_text4" />
  19. <result column="cc_text5" jdbcType="VARCHAR" property="cc_text5" />
  20. <result column="cc_default" jdbcType="INTEGER" property="cc_default" />
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. cc_id, cc_cuid, cc_detno, cc_name, cc_tel, cc_qq, cc_email, companyid, updaterid,
  24. updatetime, cc_text1, cc_text2, cc_text3, cc_text4, cc_text5,cc_default
  25. </sql>
  26. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  27. select
  28. <include refid="Base_Column_List" />
  29. from customercontact
  30. where cc_id = #{cc_id,jdbcType=INTEGER}
  31. </select>
  32. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  33. delete from customercontact
  34. where cc_id = #{cc_id,jdbcType=INTEGER}
  35. </delete>
  36. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Customercontact">
  37. <selectKey resultType="java.lang.Long" keyProperty="id">
  38. SELECT LAST_INSERT_ID() AS ID
  39. </selectKey>
  40. insert into customercontact
  41. <trim prefix="(" suffix=")" suffixOverrides=",">
  42. <if test="cc_cuid != null">
  43. cc_cuid,
  44. </if>
  45. <if test="cc_detno != null">
  46. cc_detno,
  47. </if>
  48. <if test="cc_name != null">
  49. cc_name,
  50. </if>
  51. <if test="cc_tel != null">
  52. cc_tel,
  53. </if>
  54. <if test="cc_qq != null">
  55. cc_qq,
  56. </if>
  57. <if test="cc_email != null">
  58. cc_email,
  59. </if>
  60. <if test="companyId != null">
  61. companyid,
  62. </if>
  63. <if test="updaterId != null">
  64. updaterid,
  65. </if>
  66. <if test="updateTime != null">
  67. updatetime,
  68. </if>
  69. <if test="cc_text1 != null">
  70. cc_text1,
  71. </if>
  72. <if test="cc_text2 != null">
  73. cc_text2,
  74. </if>
  75. <if test="cc_text3 != null">
  76. cc_text3,
  77. </if>
  78. <if test="cc_text4 != null">
  79. cc_text4,
  80. </if>
  81. <if test="cc_text5 != null">
  82. cc_text5,
  83. </if>
  84. <if test="cc_default != null">
  85. cc_default,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="cc_cuid != null">
  90. #{cc_cuid,jdbcType=INTEGER},
  91. </if>
  92. <if test="cc_detno != null">
  93. #{cc_detno,jdbcType=INTEGER},
  94. </if>
  95. <if test="cc_name != null">
  96. #{cc_name,jdbcType=VARCHAR},
  97. </if>
  98. <if test="cc_tel != null">
  99. #{cc_tel,jdbcType=INTEGER},
  100. </if>
  101. <if test="cc_qq != null">
  102. #{cc_qq,jdbcType=VARCHAR},
  103. </if>
  104. <if test="cc_email != null">
  105. #{cc_email,jdbcType=VARCHAR},
  106. </if>
  107. <if test="companyId != null">
  108. #{companyId,jdbcType=INTEGER},
  109. </if>
  110. <if test="updaterId != null">
  111. #{updaterId,jdbcType=INTEGER},
  112. </if>
  113. <if test="updateTime != null">
  114. #{updateTime,jdbcType=TIMESTAMP},
  115. </if>
  116. <if test="cc_text1 != null">
  117. #{cc_text1,jdbcType=VARCHAR},
  118. </if>
  119. <if test="cc_text2 != null">
  120. #{cc_text2,jdbcType=VARCHAR},
  121. </if>
  122. <if test="cc_text3 != null">
  123. #{cc_text3,jdbcType=VARCHAR},
  124. </if>
  125. <if test="cc_text4 != null">
  126. #{cc_text4,jdbcType=VARCHAR},
  127. </if>
  128. <if test="cc_text5 != null">
  129. #{cc_text5,jdbcType=VARCHAR},
  130. </if>
  131. <if test="cc_default != null">
  132. #{cc_default,jdbcType=INTEGER},
  133. </if>
  134. </trim>
  135. </insert>
  136. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customercontact">
  137. update customercontact
  138. <set>
  139. <if test="cc_cuid != null">
  140. cc_cuid = #{cc_cuid,jdbcType=INTEGER},
  141. </if>
  142. <if test="cc_detno != null">
  143. cc_detno = #{cc_detno,jdbcType=INTEGER},
  144. </if>
  145. <if test="cc_name != null">
  146. cc_name = #{cc_name,jdbcType=VARCHAR},
  147. </if>
  148. <if test="cc_tel != null">
  149. cc_tel = #{cc_tel,jdbcType=INTEGER},
  150. </if>
  151. <if test="cc_qq != null">
  152. cc_qq = #{cc_qq,jdbcType=VARCHAR},
  153. </if>
  154. <if test="cc_email != null">
  155. cc_email = #{cc_email,jdbcType=VARCHAR},
  156. </if>
  157. <if test="companyId != null">
  158. companyid = #{companyId,jdbcType=INTEGER},
  159. </if>
  160. <if test="updaterId != null">
  161. updaterid = #{updaterId,jdbcType=INTEGER},
  162. </if>
  163. <if test="updateTime != null">
  164. updatetime = #{updateTime,jdbcType=TIMESTAMP},
  165. </if>
  166. <if test="cc_text1 != null">
  167. cc_text1 = #{cc_text1,jdbcType=VARCHAR},
  168. </if>
  169. <if test="cc_text2 != null">
  170. cc_text2 = #{cc_text2,jdbcType=VARCHAR},
  171. </if>
  172. <if test="cc_text3 != null">
  173. cc_text3 = #{cc_text3,jdbcType=VARCHAR},
  174. </if>
  175. <if test="cc_text4 != null">
  176. cc_text4 = #{cc_text4,jdbcType=VARCHAR},
  177. </if>
  178. <if test="cc_text5 != null">
  179. cc_text5 = #{cc_text5,jdbcType=VARCHAR},
  180. </if>
  181. <if test="cc_default != null">
  182. cc_default = #{cc_default,jdbcType=INTEGER},
  183. </if>
  184. </set>
  185. where cc_id = #{id,jdbcType=INTEGER}
  186. </update>
  187. <select id="selectByFK" parameterType="java.lang.Long" resultMap="BaseResultMap">
  188. select
  189. <include refid="Base_Column_List" />
  190. from customercontact
  191. where cc_cuid = #{fk_i,jdbcType=INTEGER} order by cc_detno
  192. </select>
  193. <insert id="batchInsert" parameterType="java.util.List" >
  194. <foreach collection="list" item="item" index="index" open="" close="" separator=",">
  195. insert into customercontact
  196. <trim prefix="(" suffix=")" suffixOverrides=",">
  197. <if test="item.cc_cuid != null">
  198. cc_cuid,
  199. </if>
  200. <if test="item.cc_detno != null">
  201. cc_detno,
  202. </if>
  203. <if test="item.cc_name != null">
  204. cc_name,
  205. </if>
  206. <if test="item.cc_tel != null">
  207. cc_tel,
  208. </if>
  209. <if test="item.cc_qq != null">
  210. cc_qq,
  211. </if>
  212. <if test="item.cc_email != null">
  213. cc_email,
  214. </if>
  215. <if test="item.companyId != null">
  216. companyid,
  217. </if>
  218. <if test="item.updaterId != null">
  219. updaterid,
  220. </if>
  221. <if test="item.updateTime != null">
  222. updatetime,
  223. </if>
  224. <if test="item.cc_default != null">
  225. cc_default,
  226. </if>
  227. </trim>
  228. <trim prefix="values (" suffix=")" suffixOverrides=",">
  229. <if test="item.cc_cuid != null">
  230. #{item.cc_cuid,jdbcType=INTEGER},
  231. </if>
  232. <if test="item.cc_detno != null">
  233. #{item.cc_detno,jdbcType=INTEGER},
  234. </if>
  235. <if test="item.cc_name != null">
  236. #{item.cc_name,jdbcType=VARCHAR},
  237. </if>
  238. <if test="item.cc_tel != null">
  239. #{item.cc_tel,jdbcType=INTEGER},
  240. </if>
  241. <if test="item.cc_qq != null">
  242. #{item.cc_qq,jdbcType=VARCHAR},
  243. </if>
  244. <if test="item.cc_email != null">
  245. #{item.cc_email,jdbcType=VARCHAR},
  246. </if>
  247. <if test="item.companyId != null">
  248. #{item.companyId,jdbcType=INTEGER},
  249. </if>
  250. <if test="item.updaterId != null">
  251. #{item.updaterId,jdbcType=INTEGER},
  252. </if>
  253. <if test="item.updateTime != null">
  254. #{item.updateTime,jdbcType=TIMESTAMP},
  255. </if>
  256. <if test="item.cc_default != null">
  257. #{item.cc_default,jdbcType=INTEGER},
  258. </if>
  259. </trim>
  260. </foreach>
  261. </insert>
  262. <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.Customercontact" >
  263. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  264. update customercontact
  265. <set>
  266. <if test="item.cc_cuid != null">
  267. cc_cuid = #{item.cc_cuid,jdbcType=INTEGER},
  268. </if>
  269. <if test="item.cc_detno != null">
  270. cc_detno = #{item.cc_detno,jdbcType=INTEGER},
  271. </if>
  272. <if test="item.cc_name != null">
  273. cc_name = #{item.cc_name,jdbcType=VARCHAR},
  274. </if>
  275. <if test="item.cc_tel != null">
  276. cc_tel = #{item.cc_tel,jdbcType=INTEGER},
  277. </if>
  278. <if test="item.cc_qq != null">
  279. cc_qq = #{item.cc_qq,jdbcType=VARCHAR},
  280. </if>
  281. <if test="item.cc_email != null">
  282. cc_email = #{item.cc_email,jdbcType=VARCHAR},
  283. </if>
  284. <if test="item.companyId != null">
  285. companyid = #{item.companyId,jdbcType=INTEGER},
  286. </if>
  287. <if test="item.updaterId != null">
  288. updaterid = #{item.updaterId,jdbcType=INTEGER},
  289. </if>
  290. <if test="item.updateTime != null">
  291. updatetime = #{item.updateTime,jdbcType=TIMESTAMP},
  292. </if>
  293. <if test="item.cc_text1 != null">
  294. cc_text1 = #{item.cc_text1,jdbcType=VARCHAR},
  295. </if>
  296. <if test="item.cc_text2 != null">
  297. cc_text2 = #{item.cc_text2,jdbcType=VARCHAR},
  298. </if>
  299. <if test="item.cc_text3 != null">
  300. cc_text3 = #{item.cc_text3,jdbcType=VARCHAR},
  301. </if>
  302. <if test="item.cc_text4 != null">
  303. cc_text4 = #{item.cc_text4,jdbcType=VARCHAR},
  304. </if>
  305. <if test="item.cc_text5 != null">
  306. cc_text5 = #{item.cc_text5,jdbcType=VARCHAR},
  307. </if>
  308. <if test="item.cc_default != null">
  309. cc_default = #{item.cc_default,jdbcType=INTEGER},
  310. </if>
  311. </set>
  312. where cc_id = #{item.id,jdbcType=INTEGER}
  313. </foreach>
  314. </update>
  315. <delete id="deleteByFK" parameterType="java.lang.Long">
  316. delete from customercontact
  317. where cc_cuid = #{id,jdbcType=INTEGER}
  318. </delete>
  319. </mapper>