CustomerOrganizationInfoMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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.CustomerOrganizationInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.CustomerOrganizationInfo">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="cid" jdbcType="VARCHAR" property="cid" />
  12. <result column="company_name" jdbcType="VARCHAR" property="companyName" />
  13. <result column="location_province" jdbcType="CHAR" property="locationProvince" />
  14. <result column="location_city" jdbcType="VARCHAR" property="locationCity" />
  15. <result column="location_area" jdbcType="VARCHAR" property="locationArea" />
  16. <result column="adress" jdbcType="VARCHAR" property="adress" />
  17. <result column="company_industry" jdbcType="VARCHAR" property="companyIndustry" />
  18. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  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 Wed Oct 25 09:39:54 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 Wed Oct 25 09:39:54 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 Wed Oct 25 09:39:54 CST 2017.
  93. -->
  94. id, cid, company_name, location_province, location_city, location_area, adress, company_industry,
  95. remarks
  96. </sql>
  97. <select id="selectByExample" parameterType="com.goafanti.common.model.CustomerOrganizationInfoExample" resultMap="BaseResultMap">
  98. <!--
  99. WARNING - @mbg.generated
  100. This element is automatically generated by MyBatis Generator, do not modify.
  101. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  102. -->
  103. select
  104. <if test="distinct">
  105. distinct
  106. </if>
  107. <include refid="Base_Column_List" />
  108. from customer_organization_info
  109. <if test="_parameter != null">
  110. <include refid="Example_Where_Clause" />
  111. </if>
  112. <if test="orderByClause != null">
  113. order by ${orderByClause}
  114. </if>
  115. </select>
  116. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  117. <!--
  118. WARNING - @mbg.generated
  119. This element is automatically generated by MyBatis Generator, do not modify.
  120. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  121. -->
  122. select
  123. <include refid="Base_Column_List" />
  124. from customer_organization_info
  125. where id = #{id,jdbcType=VARCHAR}
  126. </select>
  127. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  128. <!--
  129. WARNING - @mbg.generated
  130. This element is automatically generated by MyBatis Generator, do not modify.
  131. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  132. -->
  133. delete from customer_organization_info
  134. where id = #{id,jdbcType=VARCHAR}
  135. </delete>
  136. <delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerOrganizationInfoExample">
  137. <!--
  138. WARNING - @mbg.generated
  139. This element is automatically generated by MyBatis Generator, do not modify.
  140. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  141. -->
  142. delete from customer_organization_info
  143. <if test="_parameter != null">
  144. <include refid="Example_Where_Clause" />
  145. </if>
  146. </delete>
  147. <insert id="insert" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  152. -->
  153. insert into customer_organization_info (id, cid, company_name,
  154. location_province, location_city, location_area,
  155. adress, company_industry, remarks
  156. )
  157. values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
  158. #{locationProvince,jdbcType=CHAR}, #{locationCity,jdbcType=VARCHAR}, #{locationArea,jdbcType=VARCHAR},
  159. #{adress,jdbcType=VARCHAR}, #{companyIndustry,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}
  160. )
  161. </insert>
  162. <insert id="insertSelective" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
  163. <!--
  164. WARNING - @mbg.generated
  165. This element is automatically generated by MyBatis Generator, do not modify.
  166. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  167. -->
  168. insert into customer_organization_info
  169. <trim prefix="(" suffix=")" suffixOverrides=",">
  170. <if test="id != null">
  171. id,
  172. </if>
  173. <if test="cid != null">
  174. cid,
  175. </if>
  176. <if test="companyName != null">
  177. company_name,
  178. </if>
  179. <if test="locationProvince != null">
  180. location_province,
  181. </if>
  182. <if test="locationCity != null">
  183. location_city,
  184. </if>
  185. <if test="locationArea != null">
  186. location_area,
  187. </if>
  188. <if test="adress != null">
  189. adress,
  190. </if>
  191. <if test="companyIndustry != null">
  192. company_industry,
  193. </if>
  194. <if test="remarks != null">
  195. remarks,
  196. </if>
  197. </trim>
  198. <trim prefix="values (" suffix=")" suffixOverrides=",">
  199. <if test="id != null">
  200. #{id,jdbcType=VARCHAR},
  201. </if>
  202. <if test="cid != null">
  203. #{cid,jdbcType=VARCHAR},
  204. </if>
  205. <if test="companyName != null">
  206. #{companyName,jdbcType=VARCHAR},
  207. </if>
  208. <if test="locationProvince != null">
  209. #{locationProvince,jdbcType=CHAR},
  210. </if>
  211. <if test="locationCity != null">
  212. #{locationCity,jdbcType=VARCHAR},
  213. </if>
  214. <if test="locationArea != null">
  215. #{locationArea,jdbcType=VARCHAR},
  216. </if>
  217. <if test="adress != null">
  218. #{adress,jdbcType=VARCHAR},
  219. </if>
  220. <if test="companyIndustry != null">
  221. #{companyIndustry,jdbcType=VARCHAR},
  222. </if>
  223. <if test="remarks != null">
  224. #{remarks,jdbcType=VARCHAR},
  225. </if>
  226. </trim>
  227. </insert>
  228. <select id="countByExample" parameterType="com.goafanti.common.model.CustomerOrganizationInfoExample" resultType="java.lang.Long">
  229. <!--
  230. WARNING - @mbg.generated
  231. This element is automatically generated by MyBatis Generator, do not modify.
  232. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  233. -->
  234. select count(*) from customer_organization_info
  235. <if test="_parameter != null">
  236. <include refid="Example_Where_Clause" />
  237. </if>
  238. </select>
  239. <update id="updateByExampleSelective" parameterType="map">
  240. <!--
  241. WARNING - @mbg.generated
  242. This element is automatically generated by MyBatis Generator, do not modify.
  243. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  244. -->
  245. update customer_organization_info
  246. <set>
  247. <if test="record.id != null">
  248. id = #{record.id,jdbcType=VARCHAR},
  249. </if>
  250. <if test="record.cid != null">
  251. cid = #{record.cid,jdbcType=VARCHAR},
  252. </if>
  253. <if test="record.companyName != null">
  254. company_name = #{record.companyName,jdbcType=VARCHAR},
  255. </if>
  256. <if test="record.locationProvince != null">
  257. location_province = #{record.locationProvince,jdbcType=CHAR},
  258. </if>
  259. <if test="record.locationCity != null">
  260. location_city = #{record.locationCity,jdbcType=VARCHAR},
  261. </if>
  262. <if test="record.locationArea != null">
  263. location_area = #{record.locationArea,jdbcType=VARCHAR},
  264. </if>
  265. <if test="record.adress != null">
  266. adress = #{record.adress,jdbcType=VARCHAR},
  267. </if>
  268. <if test="record.companyIndustry != null">
  269. company_industry = #{record.companyIndustry,jdbcType=VARCHAR},
  270. </if>
  271. <if test="record.remarks != null">
  272. remarks = #{record.remarks,jdbcType=VARCHAR},
  273. </if>
  274. </set>
  275. <if test="_parameter != null">
  276. <include refid="Update_By_Example_Where_Clause" />
  277. </if>
  278. </update>
  279. <update id="updateByExample" parameterType="map">
  280. <!--
  281. WARNING - @mbg.generated
  282. This element is automatically generated by MyBatis Generator, do not modify.
  283. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  284. -->
  285. update customer_organization_info
  286. set id = #{record.id,jdbcType=VARCHAR},
  287. cid = #{record.cid,jdbcType=VARCHAR},
  288. company_name = #{record.companyName,jdbcType=VARCHAR},
  289. location_province = #{record.locationProvince,jdbcType=CHAR},
  290. location_city = #{record.locationCity,jdbcType=VARCHAR},
  291. location_area = #{record.locationArea,jdbcType=VARCHAR},
  292. adress = #{record.adress,jdbcType=VARCHAR},
  293. company_industry = #{record.companyIndustry,jdbcType=VARCHAR},
  294. remarks = #{record.remarks,jdbcType=VARCHAR}
  295. <if test="_parameter != null">
  296. <include refid="Update_By_Example_Where_Clause" />
  297. </if>
  298. </update>
  299. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
  300. <!--
  301. WARNING - @mbg.generated
  302. This element is automatically generated by MyBatis Generator, do not modify.
  303. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  304. -->
  305. update customer_organization_info
  306. <set>
  307. <if test="cid != null">
  308. cid = #{cid,jdbcType=VARCHAR},
  309. </if>
  310. <if test="companyName != null">
  311. company_name = #{companyName,jdbcType=VARCHAR},
  312. </if>
  313. <if test="locationProvince != null">
  314. location_province = #{locationProvince,jdbcType=CHAR},
  315. </if>
  316. <if test="locationCity != null">
  317. location_city = #{locationCity,jdbcType=VARCHAR},
  318. </if>
  319. <if test="locationArea != null">
  320. location_area = #{locationArea,jdbcType=VARCHAR},
  321. </if>
  322. <if test="adress != null">
  323. adress = #{adress,jdbcType=VARCHAR},
  324. </if>
  325. <if test="companyIndustry != null">
  326. company_industry = #{companyIndustry,jdbcType=VARCHAR},
  327. </if>
  328. <if test="remarks != null">
  329. remarks = #{remarks,jdbcType=VARCHAR},
  330. </if>
  331. </set>
  332. where id = #{id,jdbcType=VARCHAR}
  333. </update>
  334. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
  335. <!--
  336. WARNING - @mbg.generated
  337. This element is automatically generated by MyBatis Generator, do not modify.
  338. This element was generated on Wed Oct 25 09:39:54 CST 2017.
  339. -->
  340. update customer_organization_info
  341. set cid = #{cid,jdbcType=VARCHAR},
  342. company_name = #{companyName,jdbcType=VARCHAR},
  343. location_province = #{locationProvince,jdbcType=CHAR},
  344. location_city = #{locationCity,jdbcType=VARCHAR},
  345. location_area = #{locationArea,jdbcType=VARCHAR},
  346. adress = #{adress,jdbcType=VARCHAR},
  347. company_industry = #{companyIndustry,jdbcType=VARCHAR},
  348. remarks = #{remarks,jdbcType=VARCHAR}
  349. where id = #{id,jdbcType=VARCHAR}
  350. </update>
  351. <update id="updateCustomerOrganizationByCid" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
  352. update customer_organization_info
  353. <set>
  354. <if test="companyName != null">
  355. company_name = #{companyName,jdbcType=VARCHAR},
  356. </if>
  357. <if test="locationProvince != null">
  358. location_province = #{locationProvince,jdbcType=CHAR},
  359. </if>
  360. <if test="locationCity != null">
  361. location_city = #{locationCity,jdbcType=VARCHAR},
  362. </if>
  363. <if test="locationArea != null">
  364. location_area = #{locationArea,jdbcType=VARCHAR},
  365. </if>
  366. <if test="adress != null">
  367. adress = #{adress,jdbcType=VARCHAR},
  368. </if>
  369. <if test="companyIndustry != null">
  370. company_industry = #{companyIndustry,jdbcType=VARCHAR},
  371. </if>
  372. <if test="remarks != null">
  373. remarks = #{remarks,jdbcType=VARCHAR},
  374. </if>
  375. </set>
  376. where cid = #{cid,jdbcType=VARCHAR}
  377. </update>
  378. <select id="findCustomerOrganizationByName" parameterType="java.lang.String" resultType="java.lang.Integer">
  379. select count(0) from customer_organization_info where company_name = #{companyName,jdbcType=VARCHAR}
  380. </select>
  381. </mapper>