ApcheckMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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.transfers.mapper.ApcheckMapper" >
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Apcheck" >
  5. <id column="ac_id" property="id" jdbcType="INTEGER" />
  6. <result column="ac_b2bid" property="ac_b2bid" jdbcType="INTEGER" />
  7. <result column="ac_code" property="ac_code" jdbcType="VARCHAR" />
  8. <result column="ac_date" property="ac_date" jdbcType="TIMESTAMP" />
  9. <result column="ac_apdate" property="ac_apdate" jdbcType="TIMESTAMP" />
  10. <result column="ac_fromdate" property="ac_fromdate" jdbcType="TIMESTAMP" />
  11. <result column="ac_todate" property="ac_todate" jdbcType="TIMESTAMP" />
  12. <result column="ac_venduu" property="ac_venduu" jdbcType="VARCHAR" />
  13. <result column="ac_vendid" property="ac_vendid" jdbcType="INTEGER" />
  14. <result column="ac_vendcode" property="ac_vendcode" jdbcType="VARCHAR" />
  15. <result column="ac_vendname" property="ac_vendname" jdbcType="VARCHAR" />
  16. <result column="ac_currency" property="ac_currency" jdbcType="VARCHAR" />
  17. <result column="ac_rate" property="ac_rate" jdbcType="DOUBLE" />
  18. <result column="ac_checkamount" property="ac_checkamount" jdbcType="DOUBLE" />
  19. <result column="ac_confirmstatus" property="ac_confirmstatus" jdbcType="VARCHAR" />
  20. <result column="ac_confirmstatuscode" property="ac_confirmstatuscode" jdbcType="VARCHAR" />
  21. <result column="ac_confirmdate" property="ac_confirmdate" jdbcType="TIMESTAMP" />
  22. <result column="ac_remark" property="ac_remark" jdbcType="VARCHAR" />
  23. <result column="ac_sendstatus" property="ac_sendstatus" jdbcType="VARCHAR" />
  24. <result column="ac_thisamount" property="ac_thisamount" jdbcType="DOUBLE" />
  25. <result column="ac_thisuncheck" property="ac_thisuncheck" jdbcType="DOUBLE" />
  26. <result column="ac_thispay" property="ac_thispay" jdbcType="DOUBLE" />
  27. <result column="ac_thissend" property="ac_thissend" jdbcType="DOUBLE" />
  28. <result column="ac_thischeck" property="ac_thischeck" jdbcType="DOUBLE" />
  29. <result column="ac_payamont" property="ac_payamont" jdbcType="DOUBLE" />
  30. <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
  31. <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
  32. <result column="companyId" property="companyId" jdbcType="BIGINT" />
  33. <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
  34. <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
  35. <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
  36. </resultMap>
  37. <resultMap id="detailMap" type="com.usoftchina.saas.money.po.ApcheckDetail">
  38. <id column="ad_id" property="id" jdbcType="INTEGER" />
  39. <result column="ad_acid" property="ad_acid" jdbcType="INTEGER" />
  40. <result column="ad_detno" property="ad_detno" jdbcType="INTEGER" />
  41. <result column="ad_inoutno" property="ad_inoutno" jdbcType="VARCHAR" />
  42. <result column="ad_pdno" property="ad_pdno" jdbcType="INTEGER" />
  43. <result column="ad_prodcode" property="ad_prodcode" jdbcType="VARCHAR" />
  44. <result column="ad_pucode" property="ad_pucode" jdbcType="VARCHAR" />
  45. <result column="ad_price" property="ad_price" jdbcType="DOUBLE" />
  46. <result column="ad_taxrate" property="ad_taxrate" jdbcType="DOUBLE" />
  47. <result column="ad_b2bqty" property="ad_b2bqty" jdbcType="DOUBLE" />
  48. <result column="companyId" property="companyId" jdbcType="BIGINT" />
  49. <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
  50. <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
  51. <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
  52. </resultMap>
  53. <sql id="Base_Column_List" >
  54. ac_id, ac_b2bid, ac_code, ac_date, ac_apdate, ac_fromdate, ac_todate, ac_venduu,
  55. ac_vendid, ac_vendcode, ac_vendname, ac_currency, ac_rate, ac_checkamount, ac_confirmstatus,
  56. ac_confirmstatuscode, ac_confirmdate, ac_remark, ac_sendstatus, ac_thisamount, ac_thisuncheck,
  57. ac_thispay, ac_thissend, ac_thischeck, ac_payamont, creatorId, creatorName, companyId,
  58. updaterId, updaterName, createTime
  59. </sql>
  60. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  61. select
  62. <include refid="Base_Column_List" />
  63. from apcheck
  64. where ac_id = #{ac_id,jdbcType=INTEGER}
  65. </select>
  66. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  67. delete from apcheck
  68. where ac_id = #{ac_id,jdbcType=INTEGER}
  69. </delete>
  70. <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Apcheck" >
  71. <selectKey resultType="java.lang.Long" keyProperty="id">
  72. SELECT LAST_INSERT_ID() AS ID
  73. </selectKey>
  74. insert into apcheck
  75. <trim prefix="(" suffix=")" suffixOverrides="," >
  76. <if test="ac_b2bid != null" >
  77. ac_b2bid,
  78. </if>
  79. <if test="ac_code != null" >
  80. ac_code,
  81. </if>
  82. <if test="ac_date != null" >
  83. ac_date,
  84. </if>
  85. <if test="ac_apdate != null" >
  86. ac_apdate,
  87. </if>
  88. <if test="ac_fromdate != null" >
  89. ac_fromdate,
  90. </if>
  91. <if test="ac_todate != null" >
  92. ac_todate,
  93. </if>
  94. <if test="ac_venduu != null" >
  95. ac_venduu,
  96. </if>
  97. <if test="ac_vendid != null" >
  98. ac_vendid,
  99. </if>
  100. <if test="ac_vendcode != null" >
  101. ac_vendcode,
  102. </if>
  103. <if test="ac_vendname != null" >
  104. ac_vendname,
  105. </if>
  106. <if test="ac_currency != null" >
  107. ac_currency,
  108. </if>
  109. <if test="ac_rate != null" >
  110. ac_rate,
  111. </if>
  112. <if test="ac_checkamount != null" >
  113. ac_checkamount,
  114. </if>
  115. <if test="ac_confirmstatus != null" >
  116. ac_confirmstatus,
  117. </if>
  118. <if test="ac_confirmstatuscode != null" >
  119. ac_confirmstatuscode,
  120. </if>
  121. <if test="ac_confirmdate != null" >
  122. ac_confirmdate,
  123. </if>
  124. <if test="ac_remark != null" >
  125. ac_remark,
  126. </if>
  127. <if test="ac_sendstatus != null" >
  128. ac_sendstatus,
  129. </if>
  130. <if test="ac_thisamount != null" >
  131. ac_thisamount,
  132. </if>
  133. <if test="ac_thisuncheck != null" >
  134. ac_thisuncheck,
  135. </if>
  136. <if test="ac_thispay != null" >
  137. ac_thispay,
  138. </if>
  139. <if test="ac_thissend != null" >
  140. ac_thissend,
  141. </if>
  142. <if test="ac_thischeck != null" >
  143. ac_thischeck,
  144. </if>
  145. <if test="ac_payamont != null" >
  146. ac_payamont,
  147. </if>
  148. <if test="creatorId != null" >
  149. creatorId,
  150. </if>
  151. <if test="creatorName != null" >
  152. creatorName,
  153. </if>
  154. <if test="companyId != null" >
  155. companyId,
  156. </if>
  157. <if test="updaterId != null" >
  158. updaterId,
  159. </if>
  160. <if test="updaterName != null" >
  161. updaterName,
  162. </if>
  163. <if test="createTime != null" >
  164. createTime,
  165. </if>
  166. </trim>
  167. <trim prefix="values (" suffix=")" suffixOverrides="," >
  168. <if test="ac_b2bid != null" >
  169. #{ac_b2bid,jdbcType=INTEGER},
  170. </if>
  171. <if test="ac_code != null" >
  172. #{ac_code,jdbcType=VARCHAR},
  173. </if>
  174. <if test="ac_date != null" >
  175. #{ac_date,jdbcType=TIMESTAMP},
  176. </if>
  177. <if test="ac_apdate != null" >
  178. #{ac_apdate,jdbcType=TIMESTAMP},
  179. </if>
  180. <if test="ac_fromdate != null" >
  181. #{ac_fromdate,jdbcType=TIMESTAMP},
  182. </if>
  183. <if test="ac_todate != null" >
  184. #{ac_todate,jdbcType=TIMESTAMP},
  185. </if>
  186. <if test="ac_venduu != null" >
  187. #{ac_venduu,jdbcType=VARCHAR},
  188. </if>
  189. <if test="ac_vendid != null" >
  190. #{ac_vendid,jdbcType=INTEGER},
  191. </if>
  192. <if test="ac_vendcode != null" >
  193. #{ac_vendcode,jdbcType=VARCHAR},
  194. </if>
  195. <if test="ac_vendname != null" >
  196. #{ac_vendname,jdbcType=VARCHAR},
  197. </if>
  198. <if test="ac_currency != null" >
  199. #{ac_currency,jdbcType=VARCHAR},
  200. </if>
  201. <if test="ac_rate != null" >
  202. #{ac_rate,jdbcType=DOUBLE},
  203. </if>
  204. <if test="ac_checkamount != null" >
  205. #{ac_checkamount,jdbcType=DOUBLE},
  206. </if>
  207. <if test="ac_confirmstatus != null" >
  208. #{ac_confirmstatus,jdbcType=VARCHAR},
  209. </if>
  210. <if test="ac_confirmstatuscode != null" >
  211. #{ac_confirmstatuscode,jdbcType=VARCHAR},
  212. </if>
  213. <if test="ac_confirmdate != null" >
  214. #{ac_confirmdate,jdbcType=TIMESTAMP},
  215. </if>
  216. <if test="ac_remark != null" >
  217. #{ac_remark,jdbcType=VARCHAR},
  218. </if>
  219. <if test="ac_sendstatus != null" >
  220. #{ac_sendstatus,jdbcType=VARCHAR},
  221. </if>
  222. <if test="ac_thisamount != null" >
  223. #{ac_thisamount,jdbcType=DOUBLE},
  224. </if>
  225. <if test="ac_thisuncheck != null" >
  226. #{ac_thisuncheck,jdbcType=DOUBLE},
  227. </if>
  228. <if test="ac_thispay != null" >
  229. #{ac_thispay,jdbcType=DOUBLE},
  230. </if>
  231. <if test="ac_thissend != null" >
  232. #{ac_thissend,jdbcType=DOUBLE},
  233. </if>
  234. <if test="ac_thischeck != null" >
  235. #{ac_thischeck,jdbcType=DOUBLE},
  236. </if>
  237. <if test="ac_payamont != null" >
  238. #{ac_payamont,jdbcType=DOUBLE},
  239. </if>
  240. <if test="creatorId != null" >
  241. #{creatorId,jdbcType=INTEGER},
  242. </if>
  243. <if test="creatorName != null" >
  244. #{creatorName,jdbcType=VARCHAR},
  245. </if>
  246. <if test="companyId != null" >
  247. #{companyId,jdbcType=BIGINT},
  248. </if>
  249. <if test="updaterId != null" >
  250. #{updaterId,jdbcType=INTEGER},
  251. </if>
  252. <if test="updaterName != null" >
  253. #{updaterName,jdbcType=VARCHAR},
  254. </if>
  255. <if test="createTime != null" >
  256. #{createTime,jdbcType=TIMESTAMP},
  257. </if>
  258. </trim>
  259. </insert>
  260. <insert id="batchInsert" parameterType="java.util.List" >
  261. insert into apcheckdetail (ad_acid, ad_detno,
  262. ad_inoutno, ad_pdno, ad_prodcode,
  263. ad_pucode, ad_price, ad_taxrate,
  264. ad_b2bqty, companyId, createTime,
  265. creatorId, creatorName)
  266. values
  267. <foreach collection="list" item="item" index="index" open="" close="" separator=",">
  268. (
  269. #{item.ad_acid}, #{item.ad_detno,jdbcType=INTEGER},
  270. #{item.ad_inoutno,jdbcType=VARCHAR}, #{item.ad_pdno,jdbcType=INTEGER}, #{item.ad_prodcode,jdbcType=VARCHAR},
  271. #{item.ad_pucode,jdbcType=VARCHAR}, #{item.ad_price,jdbcType=DOUBLE}, #{item.ad_taxrate,jdbcType=DOUBLE},
  272. #{item.ad_b2bqty,jdbcType=DOUBLE}, #{item.companyId,jdbcType=BIGINT}, #{item.createTime,jdbcType=TIMESTAMP},
  273. #{item.creatorId,jdbcType=INTEGER}, #{item.creatorName,jdbcType=VARCHAR}
  274. )
  275. </foreach>
  276. </insert>
  277. <resultMap id="vendorMap" type="com.usoftchina.saas.document.entities.Vendor">
  278. <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
  279. <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
  280. <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
  281. <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
  282. <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
  283. <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
  284. <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
  285. <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
  286. <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
  287. <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
  288. <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
  289. <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
  290. <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
  291. <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
  292. <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
  293. <result column="companyId" property="companyId" jdbcType="INTEGER" />
  294. <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
  295. <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
  296. <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
  297. <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
  298. <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
  299. <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
  300. <result column="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
  301. <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
  302. <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
  303. <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
  304. <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
  305. <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
  306. <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
  307. </resultMap>
  308. <select id="getVendorByuu" resultMap="vendorMap">
  309. select * from vendor where ve_uu=#{uu} and companyid=#{companyid}
  310. </select>
  311. <select id="count" parameterType="long" resultType="int">
  312. select count(1) from apcheck where ac_b2bid=#{id}
  313. </select>
  314. </mapper>