DcIntroducerMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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.ygj.yuemum.dao.distributionchannel.DcIntroducerDao">
  4. <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  5. <result column="id" property="id" jdbcType="INTEGER"/>
  6. <result column="wv_phone" property="wv_phone" jdbcType="VARCHAR"/>
  7. <result column="wv_gradeid" property="wv_gradeid" jdbcType="INTEGER"/>
  8. <result column="wv_Introduction_total" property="wv_Introduction_total" jdbcType="DECIMAL"/>
  9. <result column="wv_withdraw_total" property="wv_withdraw_total" jdbcType="DECIMAL"/>
  10. <result column="wv_Introduction_count" property="wv_Introduction_count" jdbcType="INTEGER"/>
  11. <result column="wv_extract_count" property="wv_extract_count" jdbcType="INTEGER"/>
  12. <result column="wv_qrcode" property="wv_qrcode" jdbcType="VARCHAR"/>
  13. <result column="wv_people_count" property="wv_people_count" jdbcType="INTEGER"/>
  14. <result column="wv_register_count" property="wv_register_count" jdbcType="INTEGER"/>
  15. <result column="wv_contract_count" property="wv_contract_count" jdbcType="INTEGER"/>
  16. <result column="wv_finish_count" property="wv_finish_count" jdbcType="INTEGER"/>
  17. <result column="wv_consultant" property="wv_consultant" jdbcType="VARCHAR"/>
  18. <result column="wv_account_number" property="wv_account_number" jdbcType="VARCHAR"/>
  19. <result column="wv_account_bank" property="wv_account_bank" jdbcType="VARCHAR"/>
  20. <result column="wv_account_number_path" property="wv_account_number_path" jdbcType="VARCHAR"/>
  21. </resultMap>
  22. <!--获取所有数据-->
  23. <select id="getDcIntroducers" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  24. select
  25. *
  26. from dc_introducer
  27. order by id desc
  28. </select>
  29. <select id="checkDcIntroducers" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer"
  30. parameterType="java.lang.String">
  31. select
  32. *
  33. from dc_introducer
  34. where wv_phone = #{wv_phone,jdbcType=VARCHAR}
  35. order by id desc
  36. </select>
  37. <select id="queryDcIntroducersByUser" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer"
  38. parameterType="java.lang.String">
  39. SELECT
  40. *
  41. FROM
  42. dc_introducer
  43. WHERE
  44. wv_phone IN (
  45. SELECT DISTINCT
  46. (xul_introducer_phone)
  47. FROM
  48. dc_introduce_log
  49. WHERE
  50. xul_phone = #{xul_phone,jdbcType=VARCHAR}
  51. AND xul_introducer_phone != ''
  52. )
  53. </select>
  54. <select id="queryDcIntroducers" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer"
  55. parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  56. select
  57. id,
  58. wv_phone,
  59. wv_gradeid,
  60. wv_Introduction_total,
  61. wv_withdraw_total,
  62. wv_Introduction_count,
  63. wv_extract_count,
  64. wv_qrcode,
  65. wv_people_count,
  66. wv_register_count,
  67. wv_contract_count,
  68. wv_finish_count,
  69. wv_consultant,
  70. wv_account_number,
  71. wv_account_bank,
  72. wv_account_number_path
  73. from dc_introducer
  74. where 1=1
  75. <if test="wv_phone != null and wv_phone != ''">
  76. and wv_phone = #{wv_phone,jdbcType=VARCHAR}
  77. </if>
  78. <if test="wv_gradeid != null and wv_gradeid != ''">
  79. and wv_gradeid = #{wv_gradeid,jdbcType=INTEGER}
  80. </if>
  81. <if test="wv_Introduction_total != null and wv_Introduction_total != ''">
  82. and wv_Introduction_total = #{wv_Introduction_total,jdbcType=DECIMAL}
  83. </if>
  84. <if test="wv_withdraw_total != null and wv_withdraw_total != ''">
  85. and wv_withdraw_total = #{wv_withdraw_total,jdbcType=DECIMAL}
  86. </if>
  87. <if test="wv_Introduction_count != null and wv_Introduction_count != ''">
  88. and wv_Introduction_count = #{wv_Introduction_count,jdbcType=INTEGER}
  89. </if>
  90. <if test="wv_qrcode != null and wv_qrcode != ''">
  91. and wv_qrcode = #{wv_qrcode,jdbcType=VARCHAR}
  92. </if>
  93. <if test="wv_people_count != null and wv_people_count != ''">
  94. and wv_people_count = #{wv_people_count,jdbcType=INTEGER}
  95. </if>
  96. <if test="wv_extract_count != null and wv_extract_count != ''">
  97. and wv_extract_count = #{wv_extract_count,jdbcType=INTEGER}
  98. </if>
  99. <if test="wv_register_count != null and wv_register_count != ''">
  100. and wv_register_count = #{wv_register_count,jdbcType=INTEGER}
  101. </if>
  102. <if test="wv_contract_count != null and wv_contract_count != ''">
  103. and wv_contract_count = #{wv_contract_count,jdbcType=INTEGER}
  104. </if>
  105. <if test="wv_finish_count != null and wv_finish_count != ''">
  106. and wv_finish_count = #{wv_finish_count,jdbcType=INTEGER}
  107. </if>
  108. <if test="wv_consultant != null and wv_consultant != ''">
  109. and wv_consultant = #{wv_consultant,jdbcType=INTEGER}
  110. </if>
  111. <if test="wv_account_number != null and wv_account_number != ''">
  112. and wv_account_number = #{wv_account_number,jdbcType=VARCHAR}
  113. </if>
  114. <if test="wv_account_bank != null and wv_account_bank != ''">
  115. and wv_account_bank = #{wv_account_bank,jdbcType=VARCHAR}
  116. </if>
  117. <if test="wv_account_number_path != null and wv_account_number_path != ''">
  118. and wv_account_number_path = #{wv_account_number_path,jdbcType=VARCHAR}
  119. </if>
  120. order by id desc
  121. </select>
  122. <update id="updateDcIntroducer" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  123. update dc_introducer
  124. <set>
  125. <if test="wv_phone != null">
  126. wv_phone = #{wv_phone,jdbcType=VARCHAR},
  127. </if>
  128. <if test="wv_gradeid != null">
  129. wv_gradeid = #{wv_gradeid,jdbcType=INTEGER},
  130. </if>
  131. <if test="wv_Introduction_total != null">
  132. wv_Introduction_total = #{wv_Introduction_total,jdbcType=DECIMAL},
  133. </if>
  134. <if test="wv_withdraw_total != null">
  135. wv_withdraw_total = #{wv_withdraw_total,jdbcType=DECIMAL},
  136. </if>
  137. <if test="wv_Introduction_count != null">
  138. wv_Introduction_count = #{wv_Introduction_count,jdbcType=INTEGER},
  139. </if>
  140. <if test="wv_extract_count != null">
  141. wv_extract_count = #{wv_extract_count,jdbcType=INTEGER},
  142. </if>
  143. <if test="wv_qrcode != null">
  144. wv_qrcode = #{wv_qrcode,jdbcType=VARCHAR},
  145. </if>
  146. <if test="wv_register_count != null">
  147. wv_register_count = #{wv_register_count,jdbcType=INTEGER},
  148. </if>
  149. <if test="wv_contract_count != null">
  150. wv_contract_count = #{wv_contract_count,jdbcType=INTEGER},
  151. </if>
  152. <if test="wv_finish_count != null">
  153. wv_finish_count = #{wv_finish_count,jdbcType=INTEGER},
  154. </if>
  155. <if test="wv_people_count != null">
  156. wv_people_count = #{wv_people_count,jdbcType=INTEGER},
  157. </if>
  158. <if test="wv_consultant != null">
  159. wv_consultant = #{wv_consultant,jdbcType=INTEGER},
  160. </if>
  161. <if test="wv_account_number_path != null">
  162. wv_account_number_path = #{wv_account_number_path,jdbcType=VARCHAR},
  163. </if>
  164. <if test="wv_account_bank != null">
  165. wv_account_bank = #{wv_account_bank,jdbcType=VARCHAR},
  166. </if>
  167. <if test="wv_account_number != null">
  168. wv_account_number = #{wv_account_number,jdbcType=VARCHAR}
  169. </if>
  170. </set>
  171. where id = #{id,jdbcType=INTEGER}
  172. </update>
  173. <update id="updateAccountNumber" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  174. update dc_introducer
  175. <set>
  176. <if test="wv_account_number != null" >
  177. wv_account_number = #{wv_account_number,jdbcType=VARCHAR},
  178. </if>
  179. <if test="wv_account_bank != null" >
  180. wv_account_bank = #{wv_account_bank,jdbcType=VARCHAR},
  181. </if>
  182. <if test="wv_account_number_path != null" >
  183. wv_account_number_path = #{wv_account_number_path,jdbcType=VARCHAR}
  184. </if>
  185. </set>
  186. where wv_phone = #{wv_phone,jdbcType=VARCHAR}
  187. </update>
  188. <insert id="insertDcIntroducer" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
  189. insert into dc_introducer
  190. <trim prefix="(" suffix=")" suffixOverrides=",">
  191. <if test="wv_phone != null">
  192. wv_phone,
  193. </if>
  194. <if test="wv_gradeid != null">
  195. wv_gradeid,
  196. </if>
  197. <if test="wv_Introduction_total != null">
  198. wv_Introduction_total,
  199. </if>
  200. <if test="wv_withdraw_total != null">
  201. wv_withdraw_total,
  202. </if>
  203. <if test="wv_Introduction_count != null">
  204. wv_Introduction_count,
  205. </if>
  206. <if test="wv_extract_count != null">
  207. wv_extract_count,
  208. </if>
  209. <if test="wv_qrcode != null">
  210. wv_qrcode,
  211. </if>
  212. <if test="wv_register_count != null">
  213. wv_register_count,
  214. </if>
  215. <if test="wv_contract_count != null">
  216. wv_contract_count,
  217. </if>
  218. <if test="wv_finish_count != null">
  219. wv_finish_count,
  220. </if>
  221. <if test="wv_people_count != null">
  222. wv_people_count,
  223. </if>
  224. <if test="wv_account_number != null">
  225. wv_account_number,
  226. </if>
  227. <if test="wv_account_bank != null">
  228. wv_account_bank,
  229. </if>
  230. <if test="wv_consultant != null">
  231. wv_consultant
  232. </if>
  233. </trim>
  234. <trim prefix="values (" suffix=")" suffixOverrides=",">
  235. <if test="wv_phone != null">
  236. #{wv_phone,jdbcType=VARCHAR},
  237. </if>
  238. <if test="wv_gradeid != null">
  239. #{wv_gradeid,jdbcType=INTEGER},
  240. </if>
  241. <if test="wv_Introduction_total != null">
  242. #{wv_Introduction_total,jdbcType=DECIMAL},
  243. </if>
  244. <if test="wv_withdraw_total != null">
  245. #{wv_withdraw_total,jdbcType=DECIMAL},
  246. </if>
  247. <if test="wv_extract_count != null">
  248. #{wv_extract_count,jdbcType=INTEGER},
  249. </if>
  250. <if test="wv_Introduction_count != null">
  251. #{wv_Introduction_count,jdbcType=INTEGER},
  252. </if>
  253. <if test="wv_qrcode != null">
  254. #{wv_qrcode,jdbcType=VARCHAR},
  255. </if>
  256. <if test="wv_register_count != null">
  257. #{wv_register_count,jdbcType=INTEGER},
  258. </if>
  259. <if test="wv_contract_count != null">
  260. #{wv_contract_count,jdbcType=INTEGER},
  261. </if>
  262. <if test="wv_finish_count != null">
  263. #{wv_finish_count,jdbcType=INTEGER},
  264. </if>
  265. <if test="wv_people_count != null">
  266. #{wv_people_count,jdbcType=INTEGER},
  267. </if>
  268. <if test="wv_account_number != null">
  269. #{wv_account_number,jdbcType=VARCHAR},
  270. </if>
  271. <if test="wv_account_bank != null">
  272. #{wv_account_bank,jdbcType=VARCHAR},
  273. </if>
  274. <if test="wv_consultant != null">
  275. #{wv_consultant,jdbcType=VARCHAR}
  276. </if>
  277. </trim>
  278. </insert>
  279. </mapper>