VendorMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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.document.mapper.VendorMapper">
  4. <resultMap id="VendorResultMapper" type="com.usoftchina.saas.document.entities.Vendor">
  5. <id column="ve_id" property="id" jdbcType="INTEGER" />
  6. <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
  7. <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
  8. <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
  9. <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
  10. <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
  11. <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
  12. <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
  13. <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
  14. <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
  15. <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
  16. <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
  17. <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
  18. <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
  19. <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
  20. <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
  21. <result column="companyId" property="companyId" jdbcType="INTEGER" />
  22. <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
  23. <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
  24. <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
  25. <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
  26. <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
  27. <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
  28. <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
  29. <result column="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
  30. <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
  31. <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
  32. <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
  33. <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
  34. <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
  35. <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
  36. </resultMap>
  37. <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
  38. <id column="ve_id" property="id" jdbcType="INTEGER" />
  39. <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
  40. <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
  41. <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
  42. <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
  43. <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
  44. <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
  45. <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
  46. </resultMap>
  47. <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper">
  48. SELECT * FROM VENDOR
  49. <where>
  50. <if test="condition!=null">
  51. ${condition}
  52. </if>
  53. <if test="companyId!=null">
  54. AND companyId = #{companyId}
  55. </if>
  56. </where>
  57. ORDER BY VE_ID DESC
  58. </select>
  59. <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">
  60. <id column="ve_id" property="id" jdbcType="INTEGER" />
  61. <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
  62. <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
  63. <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
  64. <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
  65. <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
  66. <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
  67. <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
  68. <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
  69. <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
  70. <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
  71. <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
  72. <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
  73. <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
  74. <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
  75. <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
  76. <result column="ve_leftamount" property="ve_leftamount" jdbcType="INTEGER" />
  77. <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
  78. <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
  79. <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
  80. <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
  81. <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
  82. <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
  83. <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
  84. <result column="ve_buyerid" property="ve_buyerid" jdbcType="INTEGER" />
  85. <result column="ve_buyercode" property="ve_buyercode" jdbcType="VARCHAR" />
  86. <result column="ve_buyername" property="ve_buyername" jdbcType="VARCHAR" />
  87. <result column="vc_veid" property="vc_veid" jdbcType="INTEGER" />
  88. <result column="vc_detno" property="vc_detno" jdbcType="INTEGER" />
  89. <result column="vc_name" property="vc_name" jdbcType="VARCHAR" />
  90. <result column="vc_tel" property="vc_tel" jdbcType="VARCHAR" />
  91. <result column="vc_qq" property="vc_qq" jdbcType="VARCHAR" />
  92. <result column="vc_email" property="vc_email" jdbcType="VARCHAR" />
  93. <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
  94. <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
  95. <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
  96. <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
  97. <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
  98. <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
  99. <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
  100. <result column="cr_rate" property="cr_rate" jdbcType="DOUBLE" />
  101. </resultMap>
  102. <select id="getListDataByCondition" resultMap="VendorListResultMapper">
  103. SELECT * FROM VENDOR
  104. LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID and vc_default = 1
  105. left join currencys on cr_name = ve_currency and currencys.companyid = VENDOR.companyid
  106. <where>
  107. <if test="condition!=null">
  108. ${condition}
  109. </if>
  110. AND VENDOR.COMPANYID = #{companyId}
  111. </where>
  112. order by VE_ID DESC
  113. </select>
  114. <sql id="Base_Column_List" >
  115. ve_id, ve_code, ve_shortname,ve_name, ve_uu, ve_type, ve_begindate, ve_beginapamount, ve_beginprepayamount,
  116. ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
  117. vendor.companyId companyId, vendor.updaterId updaterId, vendor.updateTime updateTime, ve_text1,
  118. ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym, ve_preamount,ve_remark,
  119. ve_buyerid,ve_buyercode,ve_buyername,ve_address,ve_currency,cr_rate
  120. </sql>
  121. <select id="selectByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
  122. select
  123. <include refid="Base_Column_List" />
  124. from vendor left join currencys on cr_name = ve_currency and vendor.companyId = currencys.companyId
  125. where ve_id = #{id}
  126. </select>
  127. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  128. delete from vendor
  129. where ve_id = #{id}
  130. </delete>
  131. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
  132. <selectKey resultType="java.lang.Long" keyProperty="id">
  133. SELECT LAST_INSERT_ID() AS ID
  134. </selectKey>
  135. insert into vendor
  136. <trim prefix="(" suffix=")" suffixOverrides="," >
  137. <if test="ve_code != null" >
  138. ve_code,
  139. </if>
  140. <if test="ve_shortname !=null">
  141. ve_shortname,
  142. </if>
  143. <if test="ve_name != null" >
  144. ve_name,
  145. </if>
  146. <if test="ve_uu != null" >
  147. ve_uu,
  148. </if>
  149. <if test="ve_type != null" >
  150. ve_type,
  151. </if>
  152. <if test="ve_begindate != null" >
  153. ve_begindate,
  154. </if>
  155. <if test="ve_beginapamount != null" >
  156. ve_beginapamount,
  157. </if>
  158. <if test="ve_beginprepayamount != null" >
  159. ve_beginprepayamount,
  160. </if>
  161. <if test="ve_promisedays != null" >
  162. ve_promisedays,
  163. </if>
  164. <if test="ve_taxrate != null" >
  165. ve_taxrate,
  166. </if>
  167. <if test="ve_nsrzh != null" >
  168. ve_nsrzh,
  169. </if>
  170. <if test="ve_bankaccount != null" >
  171. ve_bankaccount,
  172. </if>
  173. <if test="ve_bankcode != null" >
  174. ve_bankcode,
  175. </if>
  176. <if test="ve_status != null" >
  177. ve_status,
  178. </if>
  179. <if test="ve_statuscode != null" >
  180. ve_statuscode,
  181. </if>
  182. <if test="companyId != null" >
  183. companyId,
  184. </if>
  185. <if test="updaterId != null" >
  186. updaterId,
  187. </if>
  188. <if test="updateTime != null" >
  189. updateTime,
  190. </if>
  191. <if test="ve_text1 != null" >
  192. ve_text1,
  193. </if>
  194. <if test="ve_text2 != null" >
  195. ve_text2,
  196. </if>
  197. <if test="ve_text3 != null" >
  198. ve_text3,
  199. </if>
  200. <if test="ve_text4 != null" >
  201. ve_text4,
  202. </if>
  203. <if test="ve_text5 != null" >
  204. ve_text5,
  205. </if>
  206. <if test="ve_payamount != null" >
  207. ve_payamount,
  208. </if>
  209. <if test="ve_leftamount != null" >
  210. ve_leftamount,
  211. </if>
  212. <if test="ve_beginym != null" >
  213. ve_beginym,
  214. </if>
  215. <if test="ve_preamount !=null" >
  216. ve_preamount,
  217. </if>
  218. <if test="creatorId != null" >
  219. creatorId,
  220. </if>
  221. <if test="createTime != null" >
  222. createTime,
  223. </if>
  224. <if test="creatorName != null" >
  225. creatorName,
  226. </if>
  227. <if test="ve_remark!=null">
  228. ve_remark,
  229. </if>
  230. <if test="ve_buyerid!=null">
  231. ve_buyerid,
  232. </if>
  233. <if test="ve_buyercode!=null">
  234. ve_buyercode,
  235. </if>
  236. <if test="ve_buyername!=null">
  237. ve_buyername,
  238. </if>
  239. <if test="ve_address!=null">
  240. ve_address,
  241. </if>
  242. <if test="ve_currency!=null">
  243. ve_currency,
  244. </if>
  245. </trim>
  246. <trim prefix="values (" suffix=")" suffixOverrides="," >
  247. <if test="ve_code != null" >
  248. #{ve_code,jdbcType=VARCHAR},
  249. </if>
  250. <if test="ve_shortname !=null">
  251. #{ve_shortname,jdbcType=VARCHAR},
  252. </if>
  253. <if test="ve_name != null" >
  254. #{ve_name,jdbcType=VARCHAR},
  255. </if>
  256. <if test="ve_uu != null" >
  257. #{ve_uu,jdbcType=VARCHAR},
  258. </if>
  259. <if test="ve_type != null" >
  260. #{ve_type,jdbcType=VARCHAR},
  261. </if>
  262. <if test="ve_begindate != null" >
  263. #{ve_begindate,jdbcType=TIMESTAMP},
  264. </if>
  265. <if test="ve_beginapamount != null" >
  266. #{ve_beginapamount,jdbcType=DOUBLE},
  267. </if>
  268. <if test="ve_beginprepayamount != null" >
  269. #{ve_beginprepayamount,jdbcType=DOUBLE},
  270. </if>
  271. <if test="ve_promisedays != null" >
  272. #{ve_promisedays,jdbcType=DECIMAL},
  273. </if>
  274. <if test="ve_taxrate != null" >
  275. #{ve_taxrate,jdbcType=DOUBLE},
  276. </if>
  277. <if test="ve_nsrzh != null" >
  278. #{ve_nsrzh,jdbcType=VARCHAR},
  279. </if>
  280. <if test="ve_bankaccount != null" >
  281. #{ve_bankaccount,jdbcType=VARCHAR},
  282. </if>
  283. <if test="ve_bankcode != null" >
  284. #{ve_bankcode,jdbcType=VARCHAR},
  285. </if>
  286. <if test="ve_status != null" >
  287. #{ve_status,jdbcType=VARCHAR},
  288. </if>
  289. <if test="ve_statuscode != null" >
  290. #{ve_statuscode,jdbcType=VARCHAR},
  291. </if>
  292. <if test="companyId != null" >
  293. #{companyId,jdbcType=DECIMAL},
  294. </if>
  295. <if test="updaterId != null" >
  296. #{updaterId,jdbcType=DECIMAL},
  297. </if>
  298. <if test="updateTime != null" >
  299. #{updateTime,jdbcType=TIMESTAMP},
  300. </if>
  301. <if test="ve_text1 != null" >
  302. #{ve_text1,jdbcType=VARCHAR},
  303. </if>
  304. <if test="ve_text2 != null" >
  305. #{ve_text2,jdbcType=VARCHAR},
  306. </if>
  307. <if test="ve_text3 != null" >
  308. #{ve_text3,jdbcType=VARCHAR},
  309. </if>
  310. <if test="ve_text4 != null" >
  311. #{ve_text4,jdbcType=VARCHAR},
  312. </if>
  313. <if test="ve_text5 != null" >
  314. #{ve_text5,jdbcType=VARCHAR},
  315. </if>
  316. <if test="ve_payamount != null" >
  317. #{ve_payamount,jdbcType=DOUBLE},
  318. </if>
  319. <if test="ve_leftamount != null" >
  320. #{ve_leftamount,jdbcType=DOUBLE},
  321. </if>
  322. <if test="ve_beginym != null" >
  323. #{ve_beginym,jdbcType=INTEGER},
  324. </if>
  325. <if test="ve_preamount !=null" >
  326. #{ve_preamount,jdbcType=DOUBLE},
  327. </if>
  328. <if test="creatorId != null" >
  329. #{creatorId,jdbcType=INTEGER},
  330. </if>
  331. <if test="createTime != null" >
  332. #{createTime,jdbcType=TIMESTAMP},
  333. </if>
  334. <if test="creatorName != null" >
  335. #{creatorName,jdbcType=VARCHAR},
  336. </if>
  337. <if test="ve_remark != null">
  338. #{ve_remark,jdbcType=VARCHAR},
  339. </if>
  340. <if test="ve_buyerid != null">
  341. #{ve_buyerid,jdbcType=INTEGER},
  342. </if>
  343. <if test="ve_buyercode != null">
  344. #{ve_buyercode,jdbcType=VARCHAR},
  345. </if>
  346. <if test="ve_buyername != null">
  347. #{ve_buyername,jdbcType=VARCHAR},
  348. </if>
  349. <if test="ve_address != null">
  350. #{ve_address,jdbcType=VARCHAR},
  351. </if>
  352. <if test="ve_currency != null">
  353. #{ve_currency,jdbcType=VARCHAR},
  354. </if>
  355. </trim>
  356. </insert>
  357. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
  358. update vendor
  359. <set >
  360. <if test="ve_code != null" >
  361. ve_code = #{ve_code,jdbcType=VARCHAR},
  362. </if>
  363. <if test="ve_shortname !=null">
  364. ve_shortname = #{ve_shortname,jdbcType=VARCHAR},
  365. </if>
  366. <if test="ve_name != null" >
  367. ve_name = #{ve_name,jdbcType=VARCHAR},
  368. </if>
  369. <if test="ve_uu != null" >
  370. ve_uu = #{ve_uu,jdbcType=VARCHAR},
  371. </if>
  372. <if test="ve_type != null" >
  373. ve_type = #{ve_type,jdbcType=VARCHAR},
  374. </if>
  375. <if test="ve_begindate != null" >
  376. ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="ve_beginapamount != null" >
  379. ve_beginapamount = #{ve_beginapamount,jdbcType=DOUBLE},
  380. </if>
  381. <if test="ve_beginprepayamount != null" >
  382. ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DOUBLE},
  383. </if>
  384. <if test="ve_promisedays != null" >
  385. ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
  386. </if>
  387. <if test="ve_taxrate != null" >
  388. ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
  389. </if>
  390. <if test="ve_nsrzh != null" >
  391. ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
  392. </if>
  393. <if test="ve_bankaccount != null" >
  394. ve_bankaccount = #{ve_bankaccount,jdbcType=VARCHAR},
  395. </if>
  396. <if test="ve_bankcode != null" >
  397. ve_bankcode = #{ve_bankcode,jdbcType=VARCHAR},
  398. </if>
  399. <if test="ve_status != null" >
  400. ve_status = #{ve_status,jdbcType=VARCHAR},
  401. </if>
  402. <if test="ve_statuscode != null" >
  403. ve_statuscode = #{ve_statuscode,jdbcType=VARCHAR},
  404. </if>
  405. <if test="companyId != null" >
  406. companyId = #{companyId,jdbcType=DECIMAL},
  407. </if>
  408. <if test="updaterId != null" >
  409. updaterId = #{updaterId,jdbcType=DECIMAL},
  410. </if>
  411. <if test="updateTime != null" >
  412. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  413. </if>
  414. <if test="ve_text1 != null" >
  415. ve_text1 = #{ve_text1,jdbcType=VARCHAR},
  416. </if>
  417. <if test="ve_text2 != null" >
  418. ve_text2 = #{ve_text2,jdbcType=VARCHAR},
  419. </if>
  420. <if test="ve_text3 != null" >
  421. ve_text3 = #{ve_text3,jdbcType=VARCHAR},
  422. </if>
  423. <if test="ve_text4 != null" >
  424. ve_text4 = #{ve_text4,jdbcType=VARCHAR},
  425. </if>
  426. <if test="ve_text5 != null" >
  427. ve_text5 = #{ve_text5,jdbcType=VARCHAR},
  428. </if>
  429. <if test="ve_payamount != null" >
  430. ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
  431. </if>
  432. <if test="ve_leftamount != null" >
  433. ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
  434. </if>
  435. <if test="ve_beginym != null" >
  436. ve_beginym = #{ve_beginym,jdbcType=INTEGER},
  437. </if>
  438. <if test="ve_preamount !=null" >
  439. #{ve_preamount,jdbcType=DOUBLE},
  440. </if>
  441. <if test="ve_remark != null" >
  442. ve_remark = #{ve_remark,jdbcType=VARCHAR},
  443. </if>
  444. <if test="ve_buyerid != null" >
  445. ve_buyerid = #{ve_buyerid,jdbcType=INTEGER},
  446. </if>
  447. <if test="ve_buyercode != null" >
  448. ve_buyercode = #{ve_buyercode,jdbcType=VARCHAR},
  449. </if>
  450. <if test="ve_buyername != null" >
  451. ve_buyername = #{ve_buyername,jdbcType=VARCHAR},
  452. </if>
  453. <if test="ve_address != null">
  454. ve_address = #{ve_address,jdbcType=VARCHAR},
  455. </if>
  456. <if test="ve_currency != null">
  457. ve_currency = #{ve_currency,jdbcType=VARCHAR},
  458. </if>
  459. </set>
  460. where ve_id = #{id}
  461. </update>
  462. <select id="validateCodeWhenInsert" resultType="int">
  463. select count(*) from VENDOR where VE_CODE = #{code} and companyId =#{companyId}
  464. </select>
  465. <select id="validateCodeWhenUpdate" resultType="int" >
  466. select count(*) from VENDOR where VE_CODE = #{code} and VE_ID != #{id} and companyId =#{companyId}
  467. </select>
  468. <select id="getCodeById" resultType="string">
  469. SELECT VE_CODE FROM VENDOR WHERE VE_ID = #{id} and COMPANYID = #{companyId}
  470. </select>
  471. <select id="getCountByCode" resultType="int">
  472. SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_CODE=#{code}
  473. </select>
  474. <select id="getCountByName" resultType="int">
  475. SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_NAME=#{name}
  476. </select>
  477. <select id="validFinish" parameterType="long" resultType="int">
  478. select count(1) from periodsdetail where pd_status=99 and pd_detno=(select DATE_FORMAT(ve_begindate,'%Y%m') from vendor where ve_id =#{id})
  479. and companyId =#{companyId};
  480. </select>
  481. <select id="check" parameterMap="checkParamMap" statementType="CALLABLE">
  482. CALL SP_LIMITBASE(?, ?, ?, ?,?)
  483. </select>
  484. <parameterMap id="checkParamMap" type="java.util.Map">
  485. <parameter property="v_type" jdbcType="VARCHAR" mode="IN" />
  486. <parameter property="v_id" jdbcType="INTEGER" mode="IN" />
  487. <parameter property="v_code" jdbcType="VARCHAR" mode="IN" />
  488. <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
  489. <parameter property="v_res" jdbcType="VARCHAR" mode="OUT" />
  490. </parameterMap>
  491. <select id="selectIdByCode" resultType="long">
  492. select ve_id from VENDOR where ve_code=#{code} and companyId=#{companyId}
  493. </select>
  494. <select id="selectByUU" parameterType="java.lang.Long" resultType="com.usoftchina.saas.document.dto.VendorDTO">
  495. select * from vendor where ve_uu = #{uu}
  496. </select>
  497. </mapper>