CustomerContactMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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.lote.wms.user.customer.dao.CustomerContactMapper" >
  4. <resultMap id="BaseResultMap" type="com.lote.wms.user.customer.entity.CustomerContact" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="customer_id" property="customerId" jdbcType="VARCHAR" />
  7. <result column="customer_code" property="customerCode" jdbcType="VARCHAR" />
  8. <result column="name" property="name" jdbcType="VARCHAR" />
  9. <result column="address_line1" property="addressLine1" jdbcType="VARCHAR" />
  10. <result column="address_line2" property="addressLine2" jdbcType="VARCHAR" />
  11. <result column="province" property="province" jdbcType="VARCHAR" />
  12. <result column="city" property="city" jdbcType="VARCHAR" />
  13. <result column="county" property="county" jdbcType="VARCHAR" />
  14. <result column="postal_code" property="postalCode" jdbcType="VARCHAR" />
  15. <result column="country_code" property="countryCode" jdbcType="VARCHAR" />
  16. <result column="country_name" property="countryName" jdbcType="VARCHAR" />
  17. <result column="email" property="email" jdbcType="VARCHAR" />
  18. <result column="mobile_number" property="mobileNumber" jdbcType="VARCHAR" />
  19. <result column="phone_number" property="phoneNumber" jdbcType="VARCHAR" />
  20. <result column="identity_number" property="identityNumber" jdbcType="VARCHAR" />
  21. <result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
  22. <result column="created_by_user_id" property="createdByUserId" jdbcType="VARCHAR" />
  23. <result column="created_by_user_code" property="createdByUserCode" jdbcType="VARCHAR" />
  24. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  25. <result column="update_by_user_id" property="updateByUserId" jdbcType="VARCHAR" />
  26. <result column="update_by_user_code" property="updateByUserCode" jdbcType="VARCHAR" />
  27. <result column="extend1" property="extend1" jdbcType="VARCHAR" />
  28. <result column="extend2" property="extend2" jdbcType="VARCHAR" />
  29. <result column="attachment1_address" property="attachment1Address" jdbcType="VARCHAR" />
  30. <result column="attachment1_remark" property="attachment1Remark" jdbcType="VARCHAR" />
  31. <result column="attachment2_address" property="attachment2Address" jdbcType="VARCHAR" />
  32. <result column="attachment2_remark" property="attachment2Remark" jdbcType="VARCHAR" />
  33. <result column="attachment3_address" property="attachment3Address" jdbcType="VARCHAR" />
  34. <result column="attachment3_remark" property="attachment3Remark" jdbcType="VARCHAR" />
  35. </resultMap>
  36. <sql id="Condition_Where_Clause" >
  37. <where >
  38. <foreach collection="oredCriteria" item="criteria" separator="or" >
  39. <if test="criteria.valid" >
  40. <trim prefix="(" suffix=")" prefixOverrides="and" >
  41. <foreach collection="criteria.criteria" item="criterion" >
  42. <choose >
  43. <when test="criterion.noValue" >
  44. and ${criterion.condition}
  45. </when>
  46. <when test="criterion.singleValue" >
  47. and ${criterion.condition} #{criterion.value}
  48. </when>
  49. <when test="criterion.betweenValue" >
  50. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  51. </when>
  52. <when test="criterion.listValue" >
  53. and ${criterion.condition}
  54. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  55. #{listItem}
  56. </foreach>
  57. </when>
  58. </choose>
  59. </foreach>
  60. </trim>
  61. </if>
  62. </foreach>
  63. </where>
  64. </sql>
  65. <sql id="Base_Column_List" >
  66. id, customer_id, customer_code, name, address_line1, address_line2, province, city,
  67. county, postal_code, country_code, country_name, email, mobile_number, phone_number,
  68. identity_number, created_time, created_by_user_id, created_by_user_code, update_time,
  69. update_by_user_id, update_by_user_code, extend1, extend2, attachment1_address, attachment1_remark,
  70. attachment2_address, attachment2_remark, attachment3_address, attachment3_remark
  71. </sql>
  72. <select id="selectByConditionList" resultMap="BaseResultMap" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" >
  73. select
  74. <if test="distinct" >
  75. distinct
  76. </if>
  77. <include refid="Base_Column_List" />
  78. from u_customer_contact
  79. <if test="_parameter != null" >
  80. <include refid="Condition_Where_Clause" />
  81. </if>
  82. <if test="orderByClause != null" >
  83. order by ${orderByClause}
  84. </if>
  85. <if test="limit>0" >
  86. limit ${start} , ${limit}
  87. </if>
  88. </select>
  89. <select id="selectAll" resultMap="BaseResultMap">
  90. select
  91. <include refid="Base_Column_List" />
  92. from u_customer_contact
  93. </select>
  94. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  95. select
  96. <include refid="Base_Column_List" />
  97. from u_customer_contact
  98. where id = #{id,jdbcType=VARCHAR}
  99. </select>
  100. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  101. delete from u_customer_contact
  102. where id = #{id,jdbcType=VARCHAR}
  103. </delete>
  104. <delete id="deleteByCondition" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" >
  105. delete from u_customer_contact
  106. <if test="_parameter != null" >
  107. <include refid="Condition_Where_Clause" />
  108. </if>
  109. </delete>
  110. <insert id="insertSelective" parameterType="com.lote.wms.user.customer.entity.CustomerContact" >
  111. insert into u_customer_contact
  112. <trim prefix="(" suffix=")" suffixOverrides="," >
  113. <if test="id != null" >
  114. id,
  115. </if>
  116. <if test="customerId != null" >
  117. customer_id,
  118. </if>
  119. <if test="customerCode != null" >
  120. customer_code,
  121. </if>
  122. <if test="name != null" >
  123. name,
  124. </if>
  125. <if test="addressLine1 != null" >
  126. address_line1,
  127. </if>
  128. <if test="addressLine2 != null" >
  129. address_line2,
  130. </if>
  131. <if test="province != null" >
  132. province,
  133. </if>
  134. <if test="city != null" >
  135. city,
  136. </if>
  137. <if test="county != null" >
  138. county,
  139. </if>
  140. <if test="postalCode != null" >
  141. postal_code,
  142. </if>
  143. <if test="countryCode != null" >
  144. country_code,
  145. </if>
  146. <if test="countryName != null" >
  147. country_name,
  148. </if>
  149. <if test="email != null" >
  150. email,
  151. </if>
  152. <if test="mobileNumber != null" >
  153. mobile_number,
  154. </if>
  155. <if test="phoneNumber != null" >
  156. phone_number,
  157. </if>
  158. <if test="identityNumber != null" >
  159. identity_number,
  160. </if>
  161. <if test="createdTime != null" >
  162. created_time,
  163. </if>
  164. <if test="createdByUserId != null" >
  165. created_by_user_id,
  166. </if>
  167. <if test="createdByUserCode != null" >
  168. created_by_user_code,
  169. </if>
  170. <if test="updateTime != null" >
  171. update_time,
  172. </if>
  173. <if test="updateByUserId != null" >
  174. update_by_user_id,
  175. </if>
  176. <if test="updateByUserCode != null" >
  177. update_by_user_code,
  178. </if>
  179. <if test="extend1 != null" >
  180. extend1,
  181. </if>
  182. <if test="extend2 != null" >
  183. extend2,
  184. </if>
  185. <if test="attachment1Address != null" >
  186. attachment1_address,
  187. </if>
  188. <if test="attachment1Remark != null" >
  189. attachment1_remark,
  190. </if>
  191. <if test="attachment2Address != null" >
  192. attachment2_address,
  193. </if>
  194. <if test="attachment2Remark != null" >
  195. attachment2_remark,
  196. </if>
  197. <if test="attachment3Address != null" >
  198. attachment3_address,
  199. </if>
  200. <if test="attachment3Remark != null" >
  201. attachment3_remark,
  202. </if>
  203. </trim>
  204. <trim prefix="values (" suffix=")" suffixOverrides="," >
  205. <if test="id != null" >
  206. #{id,jdbcType=VARCHAR},
  207. </if>
  208. <if test="customerId != null" >
  209. #{customerId,jdbcType=VARCHAR},
  210. </if>
  211. <if test="customerCode != null" >
  212. #{customerCode,jdbcType=VARCHAR},
  213. </if>
  214. <if test="name != null" >
  215. #{name,jdbcType=VARCHAR},
  216. </if>
  217. <if test="addressLine1 != null" >
  218. #{addressLine1,jdbcType=VARCHAR},
  219. </if>
  220. <if test="addressLine2 != null" >
  221. #{addressLine2,jdbcType=VARCHAR},
  222. </if>
  223. <if test="province != null" >
  224. #{province,jdbcType=VARCHAR},
  225. </if>
  226. <if test="city != null" >
  227. #{city,jdbcType=VARCHAR},
  228. </if>
  229. <if test="county != null" >
  230. #{county,jdbcType=VARCHAR},
  231. </if>
  232. <if test="postalCode != null" >
  233. #{postalCode,jdbcType=VARCHAR},
  234. </if>
  235. <if test="countryCode != null" >
  236. #{countryCode,jdbcType=VARCHAR},
  237. </if>
  238. <if test="countryName != null" >
  239. #{countryName,jdbcType=VARCHAR},
  240. </if>
  241. <if test="email != null" >
  242. #{email,jdbcType=VARCHAR},
  243. </if>
  244. <if test="mobileNumber != null" >
  245. #{mobileNumber,jdbcType=VARCHAR},
  246. </if>
  247. <if test="phoneNumber != null" >
  248. #{phoneNumber,jdbcType=VARCHAR},
  249. </if>
  250. <if test="identityNumber != null" >
  251. #{identityNumber,jdbcType=VARCHAR},
  252. </if>
  253. <if test="createdTime != null" >
  254. #{createdTime,jdbcType=TIMESTAMP},
  255. </if>
  256. <if test="createdByUserId != null" >
  257. #{createdByUserId,jdbcType=VARCHAR},
  258. </if>
  259. <if test="createdByUserCode != null" >
  260. #{createdByUserCode,jdbcType=VARCHAR},
  261. </if>
  262. <if test="updateTime != null" >
  263. #{updateTime,jdbcType=TIMESTAMP},
  264. </if>
  265. <if test="updateByUserId != null" >
  266. #{updateByUserId,jdbcType=VARCHAR},
  267. </if>
  268. <if test="updateByUserCode != null" >
  269. #{updateByUserCode,jdbcType=VARCHAR},
  270. </if>
  271. <if test="extend1 != null" >
  272. #{extend1,jdbcType=VARCHAR},
  273. </if>
  274. <if test="extend2 != null" >
  275. #{extend2,jdbcType=VARCHAR},
  276. </if>
  277. <if test="attachment1Address != null" >
  278. #{attachment1Address,jdbcType=VARCHAR},
  279. </if>
  280. <if test="attachment1Remark != null" >
  281. #{attachment1Remark,jdbcType=VARCHAR},
  282. </if>
  283. <if test="attachment2Address != null" >
  284. #{attachment2Address,jdbcType=VARCHAR},
  285. </if>
  286. <if test="attachment2Remark != null" >
  287. #{attachment2Remark,jdbcType=VARCHAR},
  288. </if>
  289. <if test="attachment3Address != null" >
  290. #{attachment3Address,jdbcType=VARCHAR},
  291. </if>
  292. <if test="attachment3Remark != null" >
  293. #{attachment3Remark,jdbcType=VARCHAR},
  294. </if>
  295. </trim>
  296. </insert>
  297. <select id="countByCondition" parameterType="com.lote.wms.user.customer.entity.CustomerContactCriteria" resultType="java.lang.Integer" >
  298. select count(*) from u_customer_contact
  299. <if test="_parameter != null" >
  300. <include refid="Condition_Where_Clause" />
  301. </if>
  302. </select>
  303. <update id="updateByPrimaryKeySelective" parameterType="com.lote.wms.user.customer.entity.CustomerContact" >
  304. update u_customer_contact
  305. <set >
  306. <if test="customerId != null" >
  307. customer_id = #{customerId,jdbcType=VARCHAR},
  308. </if>
  309. <if test="customerCode != null" >
  310. customer_code = #{customerCode,jdbcType=VARCHAR},
  311. </if>
  312. <if test="name != null" >
  313. name = #{name,jdbcType=VARCHAR},
  314. </if>
  315. <if test="addressLine1 != null" >
  316. address_line1 = #{addressLine1,jdbcType=VARCHAR},
  317. </if>
  318. <if test="addressLine2 != null" >
  319. address_line2 = #{addressLine2,jdbcType=VARCHAR},
  320. </if>
  321. <if test="province != null" >
  322. province = #{province,jdbcType=VARCHAR},
  323. </if>
  324. <if test="city != null" >
  325. city = #{city,jdbcType=VARCHAR},
  326. </if>
  327. <if test="county != null" >
  328. county = #{county,jdbcType=VARCHAR},
  329. </if>
  330. <if test="postalCode != null" >
  331. postal_code = #{postalCode,jdbcType=VARCHAR},
  332. </if>
  333. <if test="countryCode != null" >
  334. country_code = #{countryCode,jdbcType=VARCHAR},
  335. </if>
  336. <if test="countryName != null" >
  337. country_name = #{countryName,jdbcType=VARCHAR},
  338. </if>
  339. <if test="email != null" >
  340. email = #{email,jdbcType=VARCHAR},
  341. </if>
  342. <if test="mobileNumber != null" >
  343. mobile_number = #{mobileNumber,jdbcType=VARCHAR},
  344. </if>
  345. <if test="phoneNumber != null" >
  346. phone_number = #{phoneNumber,jdbcType=VARCHAR},
  347. </if>
  348. <if test="identityNumber != null" >
  349. identity_number = #{identityNumber,jdbcType=VARCHAR},
  350. </if>
  351. <if test="createdTime != null" >
  352. created_time = #{createdTime,jdbcType=TIMESTAMP},
  353. </if>
  354. <if test="createdByUserId != null" >
  355. created_by_user_id = #{createdByUserId,jdbcType=VARCHAR},
  356. </if>
  357. <if test="createdByUserCode != null" >
  358. created_by_user_code = #{createdByUserCode,jdbcType=VARCHAR},
  359. </if>
  360. <if test="updateTime != null" >
  361. update_time = #{updateTime,jdbcType=TIMESTAMP},
  362. </if>
  363. <if test="updateByUserId != null" >
  364. update_by_user_id = #{updateByUserId,jdbcType=VARCHAR},
  365. </if>
  366. <if test="updateByUserCode != null" >
  367. update_by_user_code = #{updateByUserCode,jdbcType=VARCHAR},
  368. </if>
  369. <if test="extend1 != null" >
  370. extend1 = #{extend1,jdbcType=VARCHAR},
  371. </if>
  372. <if test="extend2 != null" >
  373. extend2 = #{extend2,jdbcType=VARCHAR},
  374. </if>
  375. <if test="attachment1Address != null" >
  376. attachment1_address = #{attachment1Address,jdbcType=VARCHAR},
  377. </if>
  378. <if test="attachment1Remark != null" >
  379. attachment1_remark = #{attachment1Remark,jdbcType=VARCHAR},
  380. </if>
  381. <if test="attachment2Address != null" >
  382. attachment2_address = #{attachment2Address,jdbcType=VARCHAR},
  383. </if>
  384. <if test="attachment2Remark != null" >
  385. attachment2_remark = #{attachment2Remark,jdbcType=VARCHAR},
  386. </if>
  387. <if test="attachment3Address != null" >
  388. attachment3_address = #{attachment3Address,jdbcType=VARCHAR},
  389. </if>
  390. <if test="attachment3Remark != null" >
  391. attachment3_remark = #{attachment3Remark,jdbcType=VARCHAR},
  392. </if>
  393. </set>
  394. where id = #{id,jdbcType=VARCHAR}
  395. </update>
  396. </mapper>