DepotHeadMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  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.jsh.erp.datasource.mappers.DepotHeadMapper">
  4. <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotHead">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="type" jdbcType="VARCHAR" property="type" />
  7. <result column="sub_type" jdbcType="VARCHAR" property="subType" />
  8. <result column="default_number" jdbcType="VARCHAR" property="defaultNumber" />
  9. <result column="number" jdbcType="VARCHAR" property="number" />
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  11. <result column="oper_time" jdbcType="TIMESTAMP" property="operTime" />
  12. <result column="organ_id" jdbcType="BIGINT" property="organId" />
  13. <result column="creator" jdbcType="BIGINT" property="creator" />
  14. <result column="account_id" jdbcType="BIGINT" property="accountId" />
  15. <result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
  16. <result column="back_amount" jdbcType="DECIMAL" property="backAmount" />
  17. <result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
  18. <result column="pay_type" jdbcType="VARCHAR" property="payType" />
  19. <result column="bill_type" jdbcType="VARCHAR" property="billType" />
  20. <result column="remark" jdbcType="VARCHAR" property="remark" />
  21. <result column="file_name" jdbcType="VARCHAR" property="fileName" />
  22. <result column="sales_man" jdbcType="VARCHAR" property="salesMan" />
  23. <result column="account_id_list" jdbcType="VARCHAR" property="accountIdList" />
  24. <result column="account_money_list" jdbcType="VARCHAR" property="accountMoneyList" />
  25. <result column="discount" jdbcType="DECIMAL" property="discount" />
  26. <result column="discount_money" jdbcType="DECIMAL" property="discountMoney" />
  27. <result column="discount_last_money" jdbcType="DECIMAL" property="discountLastMoney" />
  28. <result column="other_money" jdbcType="DECIMAL" property="otherMoney" />
  29. <result column="deposit" jdbcType="DECIMAL" property="deposit" />
  30. <result column="status" jdbcType="VARCHAR" property="status" />
  31. <result column="purchase_status" jdbcType="VARCHAR" property="purchaseStatus" />
  32. <result column="source" jdbcType="VARCHAR" property="source" />
  33. <result column="link_number" jdbcType="VARCHAR" property="linkNumber" />
  34. <result column="link_apply" jdbcType="VARCHAR" property="linkApply" />
  35. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  36. <result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
  37. <result column="voucher_picture" jdbcType="VARCHAR" property="voucherPicture" />
  38. </resultMap>
  39. <sql id="Example_Where_Clause">
  40. <where>
  41. <foreach collection="oredCriteria" item="criteria" separator="or">
  42. <if test="criteria.valid">
  43. <trim prefix="(" prefixOverrides="and" suffix=")">
  44. <foreach collection="criteria.criteria" item="criterion">
  45. <choose>
  46. <when test="criterion.noValue">
  47. and ${criterion.condition}
  48. </when>
  49. <when test="criterion.singleValue">
  50. and ${criterion.condition} #{criterion.value}
  51. </when>
  52. <when test="criterion.betweenValue">
  53. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  54. </when>
  55. <when test="criterion.listValue">
  56. and ${criterion.condition}
  57. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  58. #{listItem}
  59. </foreach>
  60. </when>
  61. </choose>
  62. </foreach>
  63. </trim>
  64. </if>
  65. </foreach>
  66. </where>
  67. </sql>
  68. <sql id="Update_By_Example_Where_Clause">
  69. <where>
  70. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  71. <if test="criteria.valid">
  72. <trim prefix="(" prefixOverrides="and" suffix=")">
  73. <foreach collection="criteria.criteria" item="criterion">
  74. <choose>
  75. <when test="criterion.noValue">
  76. and ${criterion.condition}
  77. </when>
  78. <when test="criterion.singleValue">
  79. and ${criterion.condition} #{criterion.value}
  80. </when>
  81. <when test="criterion.betweenValue">
  82. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  83. </when>
  84. <when test="criterion.listValue">
  85. and ${criterion.condition}
  86. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  87. #{listItem}
  88. </foreach>
  89. </when>
  90. </choose>
  91. </foreach>
  92. </trim>
  93. </if>
  94. </foreach>
  95. </where>
  96. </sql>
  97. <sql id="Base_Column_List">
  98. id, type, sub_type, default_number, number, create_time, oper_time, organ_id, creator,
  99. account_id, change_amount, back_amount, total_price, pay_type, bill_type, remark,
  100. file_name, sales_man, account_id_list, account_money_list, discount, discount_money,
  101. discount_last_money, other_money, deposit, status, purchase_status, source, link_number,
  102. link_apply, tenant_id, delete_flag,goods_quantity, goods_type_count, link_tesco, receiver_name, receiver_phone, receiver_address
  103. </sql>
  104. <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="BaseResultMap">
  105. select
  106. <if test="distinct">
  107. distinct
  108. </if>
  109. <include refid="Base_Column_List" />
  110. from jsh_depot_head
  111. <if test="_parameter != null">
  112. <include refid="Example_Where_Clause" />
  113. </if>
  114. <if test="orderByClause != null">
  115. order by ${orderByClause}
  116. </if>
  117. </select>
  118. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  119. select
  120. <include refid="Base_Column_List" />
  121. from jsh_depot_head
  122. where id = #{id,jdbcType=BIGINT}
  123. </select>
  124. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  125. delete from jsh_depot_head
  126. where id = #{id,jdbcType=BIGINT}
  127. </delete>
  128. <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample">
  129. delete from jsh_depot_head
  130. <if test="_parameter != null">
  131. <include refid="Example_Where_Clause" />
  132. </if>
  133. </delete>
  134. <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotHead">
  135. insert into jsh_depot_head (id, type, sub_type,
  136. default_number, number, create_time,
  137. oper_time, organ_id, creator,
  138. account_id, change_amount, back_amount,
  139. total_price, pay_type, bill_type,
  140. remark, file_name, sales_man,
  141. account_id_list, account_money_list, discount,
  142. discount_money, discount_last_money, other_money,
  143. deposit, status, purchase_status,
  144. source, link_number, link_apply,
  145. tenant_id, delete_flag,goods_quantity, goods_type_count, link_tesco, receiver_name, receiver_phone, receiver_address)
  146. values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR},
  147. #{defaultNumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  148. #{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT},
  149. #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, #{backAmount,jdbcType=DECIMAL},
  150. #{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR},
  151. #{remark,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{salesMan,jdbcType=VARCHAR},
  152. #{accountIdList,jdbcType=VARCHAR}, #{accountMoneyList,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
  153. #{discountMoney,jdbcType=DECIMAL}, #{discountLastMoney,jdbcType=DECIMAL}, #{otherMoney,jdbcType=DECIMAL},
  154. #{deposit,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{purchaseStatus,jdbcType=VARCHAR},
  155. #{source,jdbcType=VARCHAR}, #{linkNumber,jdbcType=VARCHAR}, #{linkApply,jdbcType=VARCHAR},
  156. #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},
  157. #{goodsTypeCount,jdbcType=INTEGER}, #{linkTesco,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR},
  158. #{receiverPhone,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR})
  159. </insert>
  160. <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead" useGeneratedKeys="true" keyProperty="id">
  161. insert into jsh_depot_head
  162. <trim prefix="(" suffix=")" suffixOverrides=",">
  163. <if test="id != null">
  164. id,
  165. </if>
  166. <if test="type != null">
  167. type,
  168. </if>
  169. <if test="subType != null">
  170. sub_type,
  171. </if>
  172. <if test="defaultNumber != null">
  173. default_number,
  174. </if>
  175. <if test="number != null">
  176. number,
  177. </if>
  178. <if test="createTime != null">
  179. create_time,
  180. </if>
  181. <if test="operTime != null">
  182. oper_time,
  183. </if>
  184. <if test="organId != null">
  185. organ_id,
  186. </if>
  187. <if test="creator != null">
  188. creator,
  189. </if>
  190. <if test="accountId != null">
  191. account_id,
  192. </if>
  193. <if test="changeAmount != null">
  194. change_amount,
  195. </if>
  196. <if test="backAmount != null">
  197. back_amount,
  198. </if>
  199. <if test="totalPrice != null">
  200. total_price,
  201. </if>
  202. <if test="payType != null">
  203. pay_type,
  204. </if>
  205. <if test="billType != null">
  206. bill_type,
  207. </if>
  208. <if test="remark != null">
  209. remark,
  210. </if>
  211. <if test="fileName != null">
  212. file_name,
  213. </if>
  214. <if test="salesMan != null">
  215. sales_man,
  216. </if>
  217. <if test="accountIdList != null">
  218. account_id_list,
  219. </if>
  220. <if test="accountMoneyList != null">
  221. account_money_list,
  222. </if>
  223. <if test="discount != null">
  224. discount,
  225. </if>
  226. <if test="discountMoney != null">
  227. discount_money,
  228. </if>
  229. <if test="discountLastMoney != null">
  230. discount_last_money,
  231. </if>
  232. <if test="otherMoney != null">
  233. other_money,
  234. </if>
  235. <if test="deposit != null">
  236. deposit,
  237. </if>
  238. <if test="status != null">
  239. status,
  240. </if>
  241. <if test="purchaseStatus != null">
  242. purchase_status,
  243. </if>
  244. <if test="source != null">
  245. source,
  246. </if>
  247. <if test="linkNumber != null">
  248. link_number,
  249. </if>
  250. <if test="linkApply != null">
  251. link_apply,
  252. </if>
  253. <if test="tenantId != null">
  254. tenant_id,
  255. </if>
  256. <if test="deleteFlag != null">
  257. delete_flag,
  258. </if>
  259. <if test="voucherPicture != null">
  260. voucher_picture,
  261. </if>
  262. <if test="goodsQuantity != null">
  263. goods_quantity,
  264. </if>
  265. <if test="goodsTypeCount != null">
  266. goods_type_count,
  267. </if>
  268. <if test="linkTesco != null">
  269. link_tesco,
  270. </if>
  271. <if test="receiverName != null">
  272. receiver_name,
  273. </if>
  274. <if test="receiverPhone != null">
  275. receiver_phone,
  276. </if>
  277. <if test="receiverAddress != null">
  278. receiver_address,
  279. </if>
  280. <if test="depotId != null">
  281. depot_id,
  282. </if>
  283. <if test="operId != null">
  284. oper_id
  285. </if>
  286. </trim>
  287. <trim prefix="values (" suffix=")" suffixOverrides=",">
  288. <if test="id != null">
  289. #{id,jdbcType=BIGINT},
  290. </if>
  291. <if test="type != null">
  292. #{type,jdbcType=VARCHAR},
  293. </if>
  294. <if test="subType != null">
  295. #{subType,jdbcType=VARCHAR},
  296. </if>
  297. <if test="defaultNumber != null">
  298. #{defaultNumber,jdbcType=VARCHAR},
  299. </if>
  300. <if test="number != null">
  301. #{number,jdbcType=VARCHAR},
  302. </if>
  303. <if test="createTime != null">
  304. #{createTime,jdbcType=TIMESTAMP},
  305. </if>
  306. <if test="operTime != null">
  307. #{operTime,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="organId != null">
  310. #{organId,jdbcType=BIGINT},
  311. </if>
  312. <if test="creator != null">
  313. #{creator,jdbcType=BIGINT},
  314. </if>
  315. <if test="accountId != null">
  316. #{accountId,jdbcType=BIGINT},
  317. </if>
  318. <if test="changeAmount != null">
  319. #{changeAmount,jdbcType=DECIMAL},
  320. </if>
  321. <if test="backAmount != null">
  322. #{backAmount,jdbcType=DECIMAL},
  323. </if>
  324. <if test="totalPrice != null">
  325. #{totalPrice,jdbcType=DECIMAL},
  326. </if>
  327. <if test="payType != null">
  328. #{payType,jdbcType=VARCHAR},
  329. </if>
  330. <if test="billType != null">
  331. #{billType,jdbcType=VARCHAR},
  332. </if>
  333. <if test="remark != null">
  334. #{remark,jdbcType=VARCHAR},
  335. </if>
  336. <if test="fileName != null">
  337. #{fileName,jdbcType=VARCHAR},
  338. </if>
  339. <if test="salesMan != null">
  340. #{salesMan,jdbcType=VARCHAR},
  341. </if>
  342. <if test="accountIdList != null">
  343. #{accountIdList,jdbcType=VARCHAR},
  344. </if>
  345. <if test="accountMoneyList != null">
  346. #{accountMoneyList,jdbcType=VARCHAR},
  347. </if>
  348. <if test="discount != null">
  349. #{discount,jdbcType=DECIMAL},
  350. </if>
  351. <if test="discountMoney != null">
  352. #{discountMoney,jdbcType=DECIMAL},
  353. </if>
  354. <if test="discountLastMoney != null">
  355. #{discountLastMoney,jdbcType=DECIMAL},
  356. </if>
  357. <if test="otherMoney != null">
  358. #{otherMoney,jdbcType=DECIMAL},
  359. </if>
  360. <if test="deposit != null">
  361. #{deposit,jdbcType=DECIMAL},
  362. </if>
  363. <if test="status != null">
  364. #{status,jdbcType=VARCHAR},
  365. </if>
  366. <if test="purchaseStatus != null">
  367. #{purchaseStatus,jdbcType=VARCHAR},
  368. </if>
  369. <if test="source != null">
  370. #{source,jdbcType=VARCHAR},
  371. </if>
  372. <if test="linkNumber != null">
  373. #{linkNumber,jdbcType=VARCHAR},
  374. </if>
  375. <if test="linkApply != null">
  376. #{linkApply,jdbcType=VARCHAR},
  377. </if>
  378. <if test="tenantId != null">
  379. #{tenantId,jdbcType=BIGINT},
  380. </if>
  381. <if test="deleteFlag != null">
  382. #{deleteFlag,jdbcType=VARCHAR},
  383. </if>
  384. <if test="voucherPicture != null">
  385. #{voucherPicture,jdbcType=VARCHAR},
  386. </if>
  387. <if test="goodsQuantity != null">
  388. #{goodsQuantity,jdbcType=INTEGER},
  389. </if>
  390. <if test="goodsTypeCount != null">
  391. #{goodsTypeCount,jdbcType=INTEGER},
  392. </if>
  393. <if test="linkTesco != null">
  394. #{linkTesco,jdbcType=VARCHAR},
  395. </if>
  396. <if test="receiverName != null">
  397. #{receiverName,jdbcType=VARCHAR},
  398. </if>
  399. <if test="receiverPhone != null">
  400. #{receiverPhone,jdbcType=VARCHAR},
  401. </if>
  402. <if test="receiverAddress != null">
  403. #{receiverAddress,jdbcType=VARCHAR},
  404. </if>
  405. <if test="depotId != null">
  406. #{depotId,jdbcType=INTEGER},
  407. </if>
  408. <if test="operId != null">
  409. #{operId,jdbcType=INTEGER}
  410. </if>
  411. </trim>
  412. </insert>
  413. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Long">
  414. select count(*) from jsh_depot_head
  415. <if test="_parameter != null">
  416. <include refid="Example_Where_Clause" />
  417. </if>
  418. </select>
  419. <update id="updateByExampleSelective" parameterType="map">
  420. update jsh_depot_head
  421. <set>
  422. <if test="record.id != null">
  423. id = #{record.id,jdbcType=BIGINT},
  424. </if>
  425. <if test="record.type != null">
  426. type = #{record.type,jdbcType=VARCHAR},
  427. </if>
  428. <if test="record.subType != null">
  429. sub_type = #{record.subType,jdbcType=VARCHAR},
  430. </if>
  431. <if test="record.defaultNumber != null">
  432. default_number = #{record.defaultNumber,jdbcType=VARCHAR},
  433. </if>
  434. <if test="record.number != null">
  435. number = #{record.number,jdbcType=VARCHAR},
  436. </if>
  437. <if test="record.createTime != null">
  438. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  439. </if>
  440. <if test="record.operTime != null">
  441. oper_time = #{record.operTime,jdbcType=TIMESTAMP},
  442. </if>
  443. <if test="record.organId != null">
  444. organ_id = #{record.organId,jdbcType=BIGINT},
  445. </if>
  446. <if test="record.creator != null">
  447. creator = #{record.creator,jdbcType=BIGINT},
  448. </if>
  449. <if test="record.accountId != null">
  450. account_id = #{record.accountId,jdbcType=BIGINT},
  451. </if>
  452. <if test="record.changeAmount != null">
  453. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  454. </if>
  455. <if test="record.backAmount != null">
  456. back_amount = #{record.backAmount,jdbcType=DECIMAL},
  457. </if>
  458. <if test="record.totalPrice != null">
  459. total_price = #{record.totalPrice,jdbcType=DECIMAL},
  460. </if>
  461. <if test="record.payType != null">
  462. pay_type = #{record.payType,jdbcType=VARCHAR},
  463. </if>
  464. <if test="record.billType != null">
  465. bill_type = #{record.billType,jdbcType=VARCHAR},
  466. </if>
  467. <if test="record.remark != null">
  468. remark = #{record.remark,jdbcType=VARCHAR},
  469. </if>
  470. <if test="record.fileName != null">
  471. file_name = #{record.fileName,jdbcType=VARCHAR},
  472. </if>
  473. <if test="record.salesMan != null">
  474. sales_man = #{record.salesMan,jdbcType=VARCHAR},
  475. </if>
  476. <if test="record.accountIdList != null">
  477. account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
  478. </if>
  479. <if test="record.accountMoneyList != null">
  480. account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
  481. </if>
  482. <if test="record.discount != null">
  483. discount = #{record.discount,jdbcType=DECIMAL},
  484. </if>
  485. <if test="record.discountMoney != null">
  486. discount_money = #{record.discountMoney,jdbcType=DECIMAL},
  487. </if>
  488. <if test="record.discountLastMoney != null">
  489. discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
  490. </if>
  491. <if test="record.otherMoney != null">
  492. other_money = #{record.otherMoney,jdbcType=DECIMAL},
  493. </if>
  494. <if test="record.deposit != null">
  495. deposit = #{record.deposit,jdbcType=DECIMAL},
  496. </if>
  497. <if test="record.status != null">
  498. status = #{record.status,jdbcType=VARCHAR},
  499. </if>
  500. <if test="record.purchaseStatus != null">
  501. purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR},
  502. </if>
  503. <if test="record.source != null">
  504. source = #{record.source,jdbcType=VARCHAR},
  505. </if>
  506. <if test="record.linkNumber != null">
  507. link_number = #{record.linkNumber,jdbcType=VARCHAR},
  508. </if>
  509. <if test="record.linkApply != null">
  510. link_apply = #{record.linkApply,jdbcType=VARCHAR},
  511. </if>
  512. <if test="record.tenantId != null">
  513. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  514. </if>
  515. <if test="record.deleteFlag != null">
  516. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
  517. </if>
  518. <if test="record.voucherPicture != null">
  519. voucher_picture = #{record.voucherPicture,jdbcType=VARCHAR},
  520. </if>
  521. <if test="record.goodsQuantity != null">
  522. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  523. </if>
  524. <if test="record.goodsTypeCount != null">
  525. goods_type_count = #{record.goodsTypeCount,jdbcType=INTEGER},
  526. </if>
  527. <if test="record.linkTesco != null">
  528. link_tesco = #{record.linkTesco,jdbcType=VARCHAR},
  529. </if>
  530. <if test="record.receiverName != null">
  531. receiver_name = #{record.receiverName,jdbcType=VARCHAR},
  532. </if>
  533. <if test="record.receiverPhone != null">
  534. receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
  535. </if>
  536. <if test="record.receiverAddress != null">
  537. receiver_address = #{record.receiverAddress,jdbcType=VARCHAR},
  538. </if>
  539. </set>
  540. <if test="_parameter != null">
  541. <include refid="Update_By_Example_Where_Clause" />
  542. </if>
  543. </update>
  544. <update id="updateByExample" parameterType="map">
  545. update jsh_depot_head
  546. set id = #{record.id,jdbcType=BIGINT},
  547. type = #{record.type,jdbcType=VARCHAR},
  548. sub_type = #{record.subType,jdbcType=VARCHAR},
  549. default_number = #{record.defaultNumber,jdbcType=VARCHAR},
  550. number = #{record.number,jdbcType=VARCHAR},
  551. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  552. oper_time = #{record.operTime,jdbcType=TIMESTAMP},
  553. organ_id = #{record.organId,jdbcType=BIGINT},
  554. creator = #{record.creator,jdbcType=BIGINT},
  555. account_id = #{record.accountId,jdbcType=BIGINT},
  556. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  557. back_amount = #{record.backAmount,jdbcType=DECIMAL},
  558. total_price = #{record.totalPrice,jdbcType=DECIMAL},
  559. pay_type = #{record.payType,jdbcType=VARCHAR},
  560. bill_type = #{record.billType,jdbcType=VARCHAR},
  561. remark = #{record.remark,jdbcType=VARCHAR},
  562. file_name = #{record.fileName,jdbcType=VARCHAR},
  563. sales_man = #{record.salesMan,jdbcType=VARCHAR},
  564. account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
  565. account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
  566. discount = #{record.discount,jdbcType=DECIMAL},
  567. discount_money = #{record.discountMoney,jdbcType=DECIMAL},
  568. discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
  569. other_money = #{record.otherMoney,jdbcType=DECIMAL},
  570. deposit = #{record.deposit,jdbcType=DECIMAL},
  571. status = #{record.status,jdbcType=VARCHAR},
  572. purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR},
  573. source = #{record.source,jdbcType=VARCHAR},
  574. link_number = #{record.linkNumber,jdbcType=VARCHAR},
  575. link_apply = #{record.linkApply,jdbcType=VARCHAR},
  576. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  577. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
  578. voucher_picture = #{record.voucherPicture,jdbcType=VARCHAR},
  579. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  580. goods_type_count = #{record.goodsTypeCount,jdbcType=INTEGER},
  581. link_tesco = #{record.linkTesco,jdbcType=VARCHAR},
  582. receiver_name = #{record.receiverName,jdbcType=VARCHAR},
  583. receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
  584. receiver_address = #{record.receiverAddress,jdbcType=VARCHAR}
  585. <if test="_parameter != null">
  586. <include refid="Update_By_Example_Where_Clause" />
  587. </if>
  588. </update>
  589. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
  590. update jsh_depot_head
  591. <set>
  592. <if test="type != null">
  593. type = #{type,jdbcType=VARCHAR},
  594. </if>
  595. <if test="subType != null">
  596. sub_type = #{subType,jdbcType=VARCHAR},
  597. </if>
  598. <if test="defaultNumber != null">
  599. default_number = #{defaultNumber,jdbcType=VARCHAR},
  600. </if>
  601. <if test="number != null">
  602. number = #{number,jdbcType=VARCHAR},
  603. </if>
  604. <if test="createTime != null">
  605. create_time = #{createTime,jdbcType=TIMESTAMP},
  606. </if>
  607. <if test="operTime != null">
  608. oper_time = #{operTime,jdbcType=TIMESTAMP},
  609. </if>
  610. <if test="organId != null">
  611. organ_id = #{organId,jdbcType=BIGINT},
  612. </if>
  613. <if test="creator != null">
  614. creator = #{creator,jdbcType=BIGINT},
  615. </if>
  616. <if test="accountId != null">
  617. account_id = #{accountId,jdbcType=BIGINT},
  618. </if>
  619. <if test="changeAmount != null">
  620. change_amount = #{changeAmount,jdbcType=DECIMAL},
  621. </if>
  622. <if test="backAmount != null">
  623. back_amount = #{backAmount,jdbcType=DECIMAL},
  624. </if>
  625. <if test="totalPrice != null">
  626. total_price = #{totalPrice,jdbcType=DECIMAL},
  627. </if>
  628. <if test="payType != null">
  629. pay_type = #{payType,jdbcType=VARCHAR},
  630. </if>
  631. <if test="billType != null">
  632. bill_type = #{billType,jdbcType=VARCHAR},
  633. </if>
  634. <if test="remark != null">
  635. remark = #{remark,jdbcType=VARCHAR},
  636. </if>
  637. <if test="fileName != null">
  638. file_name = #{fileName,jdbcType=VARCHAR},
  639. </if>
  640. <if test="salesMan != null">
  641. sales_man = #{salesMan,jdbcType=VARCHAR},
  642. </if>
  643. <if test="accountIdList != null">
  644. account_id_list = #{accountIdList,jdbcType=VARCHAR},
  645. </if>
  646. <if test="accountMoneyList != null">
  647. account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
  648. </if>
  649. <if test="discount != null">
  650. discount = #{discount,jdbcType=DECIMAL},
  651. </if>
  652. <if test="discountMoney != null">
  653. discount_money = #{discountMoney,jdbcType=DECIMAL},
  654. </if>
  655. <if test="discountLastMoney != null">
  656. discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
  657. </if>
  658. <if test="otherMoney != null">
  659. other_money = #{otherMoney,jdbcType=DECIMAL},
  660. </if>
  661. <if test="deposit != null">
  662. deposit = #{deposit,jdbcType=DECIMAL},
  663. </if>
  664. <if test="status != null">
  665. status = #{status,jdbcType=VARCHAR},
  666. </if>
  667. <if test="purchaseStatus != null">
  668. purchase_status = #{purchaseStatus,jdbcType=VARCHAR},
  669. </if>
  670. <if test="source != null">
  671. source = #{source,jdbcType=VARCHAR},
  672. </if>
  673. <if test="linkNumber != null">
  674. link_number = #{linkNumber,jdbcType=VARCHAR},
  675. </if>
  676. <if test="linkApply != null">
  677. link_apply = #{linkApply,jdbcType=VARCHAR},
  678. </if>
  679. <if test="tenantId != null">
  680. tenant_id = #{tenantId,jdbcType=BIGINT},
  681. </if>
  682. <if test="deleteFlag != null">
  683. delete_flag = #{deleteFlag,jdbcType=VARCHAR},
  684. </if>
  685. <if test="voucherPicture != null">
  686. voucher_picture = #{voucherPicture,jdbcType=VARCHAR},
  687. </if>
  688. <if test="goodsQuantity != null">
  689. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  690. </if>
  691. <if test="goodsTypeCount != null">
  692. goods_type_count = #{goodsTypeCount,jdbcType=INTEGER},
  693. </if>
  694. <if test="linkTesco != null">
  695. link_tesco =#{linkTesco,jdbcType=VARCHAR},
  696. </if>
  697. <if test="receiverName != null">
  698. receiver_name = #{receiverName,jdbcType=VARCHAR},
  699. </if>
  700. <if test="receiverPhone != null">
  701. receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
  702. </if>
  703. <if test="receiverAddress != null">
  704. receiver_address = #{receiverAddress,jdbcType=VARCHAR},
  705. </if>
  706. <if test="depotId != null">
  707. depot_id = #{receiverAddress,jdbcType=VARCHAR},
  708. </if>
  709. <if test="operId != null">
  710. oper_id = #{receiverAddress,jdbcType=VARCHAR}
  711. </if>
  712. </set>
  713. where id = #{id,jdbcType=BIGINT}
  714. </update>
  715. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotHead">
  716. update jsh_depot_head
  717. set type = #{type,jdbcType=VARCHAR},
  718. sub_type = #{subType,jdbcType=VARCHAR},
  719. default_number = #{defaultNumber,jdbcType=VARCHAR},
  720. number = #{number,jdbcType=VARCHAR},
  721. create_time = #{createTime,jdbcType=TIMESTAMP},
  722. oper_time = #{operTime,jdbcType=TIMESTAMP},
  723. organ_id = #{organId,jdbcType=BIGINT},
  724. creator = #{creator,jdbcType=BIGINT},
  725. account_id = #{accountId,jdbcType=BIGINT},
  726. change_amount = #{changeAmount,jdbcType=DECIMAL},
  727. back_amount = #{backAmount,jdbcType=DECIMAL},
  728. total_price = #{totalPrice,jdbcType=DECIMAL},
  729. pay_type = #{payType,jdbcType=VARCHAR},
  730. bill_type = #{billType,jdbcType=VARCHAR},
  731. remark = #{remark,jdbcType=VARCHAR},
  732. file_name = #{fileName,jdbcType=VARCHAR},
  733. sales_man = #{salesMan,jdbcType=VARCHAR},
  734. account_id_list = #{accountIdList,jdbcType=VARCHAR},
  735. account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
  736. discount = #{discount,jdbcType=DECIMAL},
  737. discount_money = #{discountMoney,jdbcType=DECIMAL},
  738. discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
  739. other_money = #{otherMoney,jdbcType=DECIMAL},
  740. deposit = #{deposit,jdbcType=DECIMAL},
  741. status = #{status,jdbcType=VARCHAR},
  742. purchase_status = #{purchaseStatus,jdbcType=VARCHAR},
  743. source = #{source,jdbcType=VARCHAR},
  744. link_number = #{linkNumber,jdbcType=VARCHAR},
  745. link_apply = #{linkApply,jdbcType=VARCHAR},
  746. tenant_id = #{tenantId,jdbcType=BIGINT},
  747. delete_flag = #{deleteFlag,jdbcType=VARCHAR},
  748. voucher_picture = #{voucherPicture,jdbcType=VARCHAR},
  749. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  750. goods_type_count = #{goodsTypeCount,jdbcType=INTEGER},
  751. link_tesco = #{linkTesco,jdbcType=VARCHAR},
  752. receiver_name = #{receiverName,jdbcType=VARCHAR},
  753. receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
  754. receiver_address = #{receiverAddress,jdbcType=VARCHAR}
  755. where id = #{id,jdbcType=BIGINT}
  756. </update>
  757. <select id="pdaList" parameterType="com.jsh.erp.datasource.pda.dto.PDADepotHeadDTO" resultType="com.jsh.erp.datasource.pda.vo.PDADepotHeadVO">
  758. SELECT
  759. dh.id,
  760. dh.number,
  761. dh.create_time,
  762. dh.goods_quantity,
  763. dh.goods_type_count,
  764. s.supplier AS supplier_name,
  765. dh.status
  766. FROM
  767. jsh_depot_head dh
  768. LEFT JOIN jsh_supplier s ON dh.organ_id = s.id
  769. <where>
  770. dh.sub_type = #{subType}
  771. AND dh.delete_flag = '0'
  772. AND ifnull(dh.status,'0') != '0'
  773. <if test="number != null and number != ''">
  774. AND dh.number = #{number}
  775. </if>
  776. <if test="status != null and status != ''">
  777. AND dh.status = #{status}
  778. </if>
  779. <if test="beginTime != null and beginTime != ''">
  780. AND dh.create_time between #{beginTime} and #{endTime}
  781. </if>
  782. </where>
  783. GROUP BY dh.id
  784. </select>
  785. <select id="getDepotLastByMaterialId" resultType="com.jsh.erp.datasource.entities.DepotHead">
  786. SELECT dh.* FROM jsh_depot_item di
  787. LEFT JOIN jsh_depot_head dh ON di.header_id = dh.id
  788. WHERE di.material_id = #{id}
  789. AND dh.type = '出库'
  790. AND ifnull(dh.delete_flag,'0') != '1'
  791. ORDER BY dh.oper_time DESC LIMIT 1
  792. </select>
  793. </mapper>