CustomerMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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.CustomerMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Customer">
  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 11 15:40:31 CST 2017.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="aid" jdbcType="VARCHAR" property="aid" />
  12. <result column="customer_typ" jdbcType="VARCHAR" property="customerTyp" />
  13. <result column="share_typ" jdbcType="INTEGER" property="shareTyp" />
  14. <result column="agent_id" jdbcType="VARCHAR" property="agentId" />
  15. <result column="company_intention" jdbcType="VARCHAR" property="companyIntention" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="follow_situation" jdbcType="VARCHAR" property="followSituation" />
  18. <result column="customer_statue" jdbcType="VARCHAR" property="customerStatue" />
  19. <result column="paid" jdbcType="VARCHAR" property="paid" />
  20. </resultMap>
  21. <sql id="Example_Where_Clause">
  22. <!--
  23. WARNING - @mbg.generated
  24. This element is automatically generated by MyBatis Generator, do not modify.
  25. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  26. -->
  27. <where>
  28. <foreach collection="oredCriteria" item="criteria" separator="or">
  29. <if test="criteria.valid">
  30. <trim prefix="(" prefixOverrides="and" suffix=")">
  31. <foreach collection="criteria.criteria" item="criterion">
  32. <choose>
  33. <when test="criterion.noValue">
  34. and ${criterion.condition}
  35. </when>
  36. <when test="criterion.singleValue">
  37. and ${criterion.condition} #{criterion.value}
  38. </when>
  39. <when test="criterion.betweenValue">
  40. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  41. </when>
  42. <when test="criterion.listValue">
  43. and ${criterion.condition}
  44. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  45. #{listItem}
  46. </foreach>
  47. </when>
  48. </choose>
  49. </foreach>
  50. </trim>
  51. </if>
  52. </foreach>
  53. </where>
  54. </sql>
  55. <sql id="Update_By_Example_Where_Clause">
  56. <!--
  57. WARNING - @mbg.generated
  58. This element is automatically generated by MyBatis Generator, do not modify.
  59. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  60. -->
  61. <where>
  62. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  63. <if test="criteria.valid">
  64. <trim prefix="(" prefixOverrides="and" suffix=")">
  65. <foreach collection="criteria.criteria" item="criterion">
  66. <choose>
  67. <when test="criterion.noValue">
  68. and ${criterion.condition}
  69. </when>
  70. <when test="criterion.singleValue">
  71. and ${criterion.condition} #{criterion.value}
  72. </when>
  73. <when test="criterion.betweenValue">
  74. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  75. </when>
  76. <when test="criterion.listValue">
  77. and ${criterion.condition}
  78. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  79. #{listItem}
  80. </foreach>
  81. </when>
  82. </choose>
  83. </foreach>
  84. </trim>
  85. </if>
  86. </foreach>
  87. </where>
  88. </sql>
  89. <sql id="Base_Column_List">
  90. <!--
  91. WARNING - @mbg.generated
  92. This element is automatically generated by MyBatis Generator, do not modify.
  93. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  94. -->
  95. id, aid, customer_typ, share_typ, agent_id, company_intention, create_time, follow_situation,
  96. customer_statue, paid
  97. </sql>
  98. <select id="selectByExample" parameterType="com.goafanti.common.model.CustomerExample" resultMap="BaseResultMap">
  99. <!--
  100. WARNING - @mbg.generated
  101. This element is automatically generated by MyBatis Generator, do not modify.
  102. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  103. -->
  104. select
  105. <if test="distinct">
  106. distinct
  107. </if>
  108. <include refid="Base_Column_List" />
  109. from customer
  110. <if test="_parameter != null">
  111. <include refid="Example_Where_Clause" />
  112. </if>
  113. <if test="orderByClause != null">
  114. order by ${orderByClause}
  115. </if>
  116. </select>
  117. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  118. <!--
  119. WARNING - @mbg.generated
  120. This element is automatically generated by MyBatis Generator, do not modify.
  121. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  122. -->
  123. select
  124. <include refid="Base_Column_List" />
  125. from customer
  126. where id = #{id,jdbcType=VARCHAR}
  127. </select>
  128. <delete id="deleteCustomerByPrimaryKey" parameterType="java.lang.String">
  129. <!--
  130. WARNING - @mbg.generated
  131. This element is automatically generated by MyBatis Generator, do not modify.
  132. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  133. -->
  134. delete from customer
  135. where id = #{id,jdbcType=VARCHAR}
  136. </delete>
  137. <delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerExample">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  142. -->
  143. delete from customer
  144. <if test="_parameter != null">
  145. <include refid="Example_Where_Clause" />
  146. </if>
  147. </delete>
  148. <insert id="insert" parameterType="com.goafanti.common.model.Customer">
  149. <!--
  150. WARNING - @mbg.generated
  151. This element is automatically generated by MyBatis Generator, do not modify.
  152. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  153. -->
  154. insert into customer (id, aid, customer_typ,
  155. share_typ, agent_id, company_intention,
  156. create_time, follow_situation, customer_statue,
  157. paid)
  158. values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{customerTyp,jdbcType=VARCHAR},
  159. #{shareTyp,jdbcType=INTEGER}, #{agentId,jdbcType=VARCHAR}, #{companyIntention,jdbcType=VARCHAR},
  160. #{createTime,jdbcType=TIMESTAMP}, #{followSituation,jdbcType=VARCHAR}, #{customerStatue,jdbcType=VARCHAR},
  161. #{paid,jdbcType=VARCHAR})
  162. </insert>
  163. <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
  164. <!--
  165. WARNING - @mbg.generated
  166. This element is automatically generated by MyBatis Generator, do not modify.
  167. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  168. -->
  169. insert into customer
  170. <trim prefix="(" suffix=")" suffixOverrides=",">
  171. <if test="id != null">
  172. id,
  173. </if>
  174. <if test="aid != null">
  175. aid,
  176. </if>
  177. <if test="customerTyp != null">
  178. customer_typ,
  179. </if>
  180. <if test="shareTyp != null">
  181. share_typ,
  182. </if>
  183. <if test="agentId != null">
  184. agent_id,
  185. </if>
  186. <if test="companyIntention != null">
  187. company_intention,
  188. </if>
  189. <if test="createTime != null">
  190. create_time,
  191. </if>
  192. <if test="followSituation != null">
  193. follow_situation,
  194. </if>
  195. <if test="customerStatue != null">
  196. customer_statue,
  197. </if>
  198. <if test="paid != null">
  199. paid,
  200. </if>
  201. </trim>
  202. <trim prefix="values (" suffix=")" suffixOverrides=",">
  203. <if test="id != null">
  204. #{id,jdbcType=VARCHAR},
  205. </if>
  206. <if test="aid != null">
  207. #{aid,jdbcType=VARCHAR},
  208. </if>
  209. <if test="customerTyp != null">
  210. #{customerTyp,jdbcType=VARCHAR},
  211. </if>
  212. <if test="shareTyp != null">
  213. #{shareTyp,jdbcType=INTEGER},
  214. </if>
  215. <if test="agentId != null">
  216. #{agentId,jdbcType=VARCHAR},
  217. </if>
  218. <if test="companyIntention != null">
  219. #{companyIntention,jdbcType=VARCHAR},
  220. </if>
  221. <if test="createTime != null">
  222. #{createTime,jdbcType=TIMESTAMP},
  223. </if>
  224. <if test="followSituation != null">
  225. #{followSituation,jdbcType=VARCHAR},
  226. </if>
  227. <if test="customerStatue != null">
  228. #{customerStatue,jdbcType=VARCHAR},
  229. </if>
  230. <if test="paid != null">
  231. #{paid,jdbcType=VARCHAR},
  232. </if>
  233. </trim>
  234. </insert>
  235. <select id="countByExample" parameterType="com.goafanti.common.model.CustomerExample" resultType="java.lang.Long">
  236. <!--
  237. WARNING - @mbg.generated
  238. This element is automatically generated by MyBatis Generator, do not modify.
  239. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  240. -->
  241. select count(*) from customer
  242. <if test="_parameter != null">
  243. <include refid="Example_Where_Clause" />
  244. </if>
  245. </select>
  246. <update id="updateByExampleSelective" parameterType="map">
  247. <!--
  248. WARNING - @mbg.generated
  249. This element is automatically generated by MyBatis Generator, do not modify.
  250. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  251. -->
  252. update customer
  253. <set>
  254. <if test="record.id != null">
  255. id = #{record.id,jdbcType=VARCHAR},
  256. </if>
  257. <if test="record.aid != null">
  258. aid = #{record.aid,jdbcType=VARCHAR},
  259. </if>
  260. <if test="record.customerTyp != null">
  261. customer_typ = #{record.customerTyp,jdbcType=VARCHAR},
  262. </if>
  263. <if test="record.shareTyp != null">
  264. share_typ = #{record.shareTyp,jdbcType=INTEGER},
  265. </if>
  266. <if test="record.agentId != null">
  267. agent_id = #{record.agentId,jdbcType=VARCHAR},
  268. </if>
  269. <if test="record.companyIntention != null">
  270. company_intention = #{record.companyIntention,jdbcType=VARCHAR},
  271. </if>
  272. <if test="record.createTime != null">
  273. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  274. </if>
  275. <if test="record.followSituation != null">
  276. follow_situation = #{record.followSituation,jdbcType=VARCHAR},
  277. </if>
  278. <if test="record.customerStatue != null">
  279. customer_statue = #{record.customerStatue,jdbcType=VARCHAR},
  280. </if>
  281. <if test="record.paid != null">
  282. paid = #{record.paid,jdbcType=VARCHAR},
  283. </if>
  284. </set>
  285. <if test="_parameter != null">
  286. <include refid="Update_By_Example_Where_Clause" />
  287. </if>
  288. </update>
  289. <update id="updateByExample" parameterType="map">
  290. <!--
  291. WARNING - @mbg.generated
  292. This element is automatically generated by MyBatis Generator, do not modify.
  293. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  294. -->
  295. update customer
  296. set id = #{record.id,jdbcType=VARCHAR},
  297. aid = #{record.aid,jdbcType=VARCHAR},
  298. customer_typ = #{record.customerTyp,jdbcType=VARCHAR},
  299. share_typ = #{record.shareTyp,jdbcType=INTEGER},
  300. agent_id = #{record.agentId,jdbcType=VARCHAR},
  301. company_intention = #{record.companyIntention,jdbcType=VARCHAR},
  302. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  303. follow_situation = #{record.followSituation,jdbcType=VARCHAR},
  304. customer_statue = #{record.customerStatue,jdbcType=VARCHAR},
  305. paid = #{record.paid,jdbcType=VARCHAR}
  306. <if test="_parameter != null">
  307. <include refid="Update_By_Example_Where_Clause" />
  308. </if>
  309. </update>
  310. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Customer">
  311. <!--
  312. WARNING - @mbg.generated
  313. This element is automatically generated by MyBatis Generator, do not modify.
  314. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  315. -->
  316. update customer
  317. <set>
  318. <if test="aid != null">
  319. aid = #{aid,jdbcType=VARCHAR},
  320. </if>
  321. <if test="customerTyp != null">
  322. customer_typ = #{customerTyp,jdbcType=VARCHAR},
  323. </if>
  324. <if test="shareTyp != null">
  325. share_typ = #{shareTyp,jdbcType=INTEGER},
  326. </if>
  327. <if test="agentId != null">
  328. agent_id = #{agentId,jdbcType=VARCHAR},
  329. </if>
  330. <if test="companyIntention != null">
  331. company_intention = #{companyIntention,jdbcType=VARCHAR},
  332. </if>
  333. <if test="createTime != null">
  334. create_time = #{createTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="followSituation != null">
  337. follow_situation = #{followSituation,jdbcType=VARCHAR},
  338. </if>
  339. <if test="customerStatue != null">
  340. customer_statue = #{customerStatue,jdbcType=VARCHAR},
  341. </if>
  342. <if test="paid != null">
  343. paid = #{paid,jdbcType=VARCHAR},
  344. </if>
  345. </set>
  346. where id = #{id,jdbcType=VARCHAR}
  347. </update>
  348. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
  349. <!--
  350. WARNING - @mbg.generated
  351. This element is automatically generated by MyBatis Generator, do not modify.
  352. This element was generated on Wed Oct 11 15:40:31 CST 2017.
  353. -->
  354. update customer
  355. set aid = #{aid,jdbcType=VARCHAR},
  356. customer_typ = #{customerTyp,jdbcType=VARCHAR},
  357. share_typ = #{shareTyp,jdbcType=INTEGER},
  358. agent_id = #{agentId,jdbcType=VARCHAR},
  359. company_intention = #{companyIntention,jdbcType=VARCHAR},
  360. create_time = #{createTime,jdbcType=TIMESTAMP},
  361. follow_situation = #{followSituation,jdbcType=VARCHAR},
  362. customer_statue = #{customerStatue,jdbcType=VARCHAR},
  363. paid = #{paid,jdbcType=VARCHAR}
  364. where id = #{id,jdbcType=VARCHAR}
  365. </update>
  366. </mapper>