DepotHeadMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  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="operId != null">
  281. oper_id
  282. </if>
  283. </trim>
  284. <trim prefix="values (" suffix=")" suffixOverrides=",">
  285. <if test="id != null">
  286. #{id,jdbcType=BIGINT},
  287. </if>
  288. <if test="type != null">
  289. #{type,jdbcType=VARCHAR},
  290. </if>
  291. <if test="subType != null">
  292. #{subType,jdbcType=VARCHAR},
  293. </if>
  294. <if test="defaultNumber != null">
  295. #{defaultNumber,jdbcType=VARCHAR},
  296. </if>
  297. <if test="number != null">
  298. #{number,jdbcType=VARCHAR},
  299. </if>
  300. <if test="createTime != null">
  301. #{createTime,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="operTime != null">
  304. #{operTime,jdbcType=TIMESTAMP},
  305. </if>
  306. <if test="organId != null">
  307. #{organId,jdbcType=BIGINT},
  308. </if>
  309. <if test="creator != null">
  310. #{creator,jdbcType=BIGINT},
  311. </if>
  312. <if test="accountId != null">
  313. #{accountId,jdbcType=BIGINT},
  314. </if>
  315. <if test="changeAmount != null">
  316. #{changeAmount,jdbcType=DECIMAL},
  317. </if>
  318. <if test="backAmount != null">
  319. #{backAmount,jdbcType=DECIMAL},
  320. </if>
  321. <if test="totalPrice != null">
  322. #{totalPrice,jdbcType=DECIMAL},
  323. </if>
  324. <if test="payType != null">
  325. #{payType,jdbcType=VARCHAR},
  326. </if>
  327. <if test="billType != null">
  328. #{billType,jdbcType=VARCHAR},
  329. </if>
  330. <if test="remark != null">
  331. #{remark,jdbcType=VARCHAR},
  332. </if>
  333. <if test="fileName != null">
  334. #{fileName,jdbcType=VARCHAR},
  335. </if>
  336. <if test="salesMan != null">
  337. #{salesMan,jdbcType=VARCHAR},
  338. </if>
  339. <if test="accountIdList != null">
  340. #{accountIdList,jdbcType=VARCHAR},
  341. </if>
  342. <if test="accountMoneyList != null">
  343. #{accountMoneyList,jdbcType=VARCHAR},
  344. </if>
  345. <if test="discount != null">
  346. #{discount,jdbcType=DECIMAL},
  347. </if>
  348. <if test="discountMoney != null">
  349. #{discountMoney,jdbcType=DECIMAL},
  350. </if>
  351. <if test="discountLastMoney != null">
  352. #{discountLastMoney,jdbcType=DECIMAL},
  353. </if>
  354. <if test="otherMoney != null">
  355. #{otherMoney,jdbcType=DECIMAL},
  356. </if>
  357. <if test="deposit != null">
  358. #{deposit,jdbcType=DECIMAL},
  359. </if>
  360. <if test="status != null">
  361. #{status,jdbcType=VARCHAR},
  362. </if>
  363. <if test="purchaseStatus != null">
  364. #{purchaseStatus,jdbcType=VARCHAR},
  365. </if>
  366. <if test="source != null">
  367. #{source,jdbcType=VARCHAR},
  368. </if>
  369. <if test="linkNumber != null">
  370. #{linkNumber,jdbcType=VARCHAR},
  371. </if>
  372. <if test="linkApply != null">
  373. #{linkApply,jdbcType=VARCHAR},
  374. </if>
  375. <if test="tenantId != null">
  376. #{tenantId,jdbcType=BIGINT},
  377. </if>
  378. <if test="deleteFlag != null">
  379. #{deleteFlag,jdbcType=VARCHAR},
  380. </if>
  381. <if test="voucherPicture != null">
  382. #{voucherPicture,jdbcType=VARCHAR},
  383. </if>
  384. <if test="goodsQuantity != null">
  385. #{goodsQuantity,jdbcType=INTEGER},
  386. </if>
  387. <if test="goodsTypeCount != null">
  388. #{goodsTypeCount,jdbcType=INTEGER},
  389. </if>
  390. <if test="linkTesco != null">
  391. #{linkTesco,jdbcType=VARCHAR},
  392. </if>
  393. <if test="receiverName != null">
  394. #{receiverName,jdbcType=VARCHAR},
  395. </if>
  396. <if test="receiverPhone != null">
  397. #{receiverPhone,jdbcType=VARCHAR},
  398. </if>
  399. <if test="receiverAddress != null">
  400. #{receiverAddress,jdbcType=VARCHAR},
  401. </if>
  402. <if test="operId != null">
  403. #{operId,jdbcType=INTEGER}
  404. </if>
  405. </trim>
  406. </insert>
  407. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Long">
  408. select count(*) from jsh_depot_head
  409. <if test="_parameter != null">
  410. <include refid="Example_Where_Clause" />
  411. </if>
  412. </select>
  413. <update id="updateByExampleSelective" parameterType="map">
  414. update jsh_depot_head
  415. <set>
  416. <if test="record.id != null">
  417. id = #{record.id,jdbcType=BIGINT},
  418. </if>
  419. <if test="record.type != null">
  420. type = #{record.type,jdbcType=VARCHAR},
  421. </if>
  422. <if test="record.subType != null">
  423. sub_type = #{record.subType,jdbcType=VARCHAR},
  424. </if>
  425. <if test="record.defaultNumber != null">
  426. default_number = #{record.defaultNumber,jdbcType=VARCHAR},
  427. </if>
  428. <if test="record.number != null">
  429. number = #{record.number,jdbcType=VARCHAR},
  430. </if>
  431. <if test="record.createTime != null">
  432. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  433. </if>
  434. <if test="record.operTime != null">
  435. oper_time = #{record.operTime,jdbcType=TIMESTAMP},
  436. </if>
  437. <if test="record.organId != null">
  438. organ_id = #{record.organId,jdbcType=BIGINT},
  439. </if>
  440. <if test="record.creator != null">
  441. creator = #{record.creator,jdbcType=BIGINT},
  442. </if>
  443. <if test="record.accountId != null">
  444. account_id = #{record.accountId,jdbcType=BIGINT},
  445. </if>
  446. <if test="record.changeAmount != null">
  447. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  448. </if>
  449. <if test="record.backAmount != null">
  450. back_amount = #{record.backAmount,jdbcType=DECIMAL},
  451. </if>
  452. <if test="record.totalPrice != null">
  453. total_price = #{record.totalPrice,jdbcType=DECIMAL},
  454. </if>
  455. <if test="record.payType != null">
  456. pay_type = #{record.payType,jdbcType=VARCHAR},
  457. </if>
  458. <if test="record.billType != null">
  459. bill_type = #{record.billType,jdbcType=VARCHAR},
  460. </if>
  461. <if test="record.remark != null">
  462. remark = #{record.remark,jdbcType=VARCHAR},
  463. </if>
  464. <if test="record.fileName != null">
  465. file_name = #{record.fileName,jdbcType=VARCHAR},
  466. </if>
  467. <if test="record.salesMan != null">
  468. sales_man = #{record.salesMan,jdbcType=VARCHAR},
  469. </if>
  470. <if test="record.accountIdList != null">
  471. account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
  472. </if>
  473. <if test="record.accountMoneyList != null">
  474. account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
  475. </if>
  476. <if test="record.discount != null">
  477. discount = #{record.discount,jdbcType=DECIMAL},
  478. </if>
  479. <if test="record.discountMoney != null">
  480. discount_money = #{record.discountMoney,jdbcType=DECIMAL},
  481. </if>
  482. <if test="record.discountLastMoney != null">
  483. discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
  484. </if>
  485. <if test="record.otherMoney != null">
  486. other_money = #{record.otherMoney,jdbcType=DECIMAL},
  487. </if>
  488. <if test="record.deposit != null">
  489. deposit = #{record.deposit,jdbcType=DECIMAL},
  490. </if>
  491. <if test="record.status != null">
  492. status = #{record.status,jdbcType=VARCHAR},
  493. </if>
  494. <if test="record.purchaseStatus != null">
  495. purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR},
  496. </if>
  497. <if test="record.source != null">
  498. source = #{record.source,jdbcType=VARCHAR},
  499. </if>
  500. <if test="record.linkNumber != null">
  501. link_number = #{record.linkNumber,jdbcType=VARCHAR},
  502. </if>
  503. <if test="record.linkApply != null">
  504. link_apply = #{record.linkApply,jdbcType=VARCHAR},
  505. </if>
  506. <if test="record.tenantId != null">
  507. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  508. </if>
  509. <if test="record.deleteFlag != null">
  510. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
  511. </if>
  512. <if test="record.voucherPicture != null">
  513. voucher_picture = #{record.voucherPicture,jdbcType=VARCHAR},
  514. </if>
  515. <if test="record.goodsQuantity != null and record.goodsQuantity != 0">
  516. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  517. </if>
  518. <if test="record.goodsTypeCount != null and record.goodsTypeCount != 0">
  519. goods_type_count = #{record.goodsTypeCount,jdbcType=INTEGER},
  520. </if>
  521. <if test="record.linkTesco != null">
  522. link_tesco = #{record.linkTesco,jdbcType=VARCHAR},
  523. </if>
  524. <if test="record.receiverName != null">
  525. receiver_name = #{record.receiverName,jdbcType=VARCHAR},
  526. </if>
  527. <if test="record.receiverPhone != null">
  528. receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
  529. </if>
  530. <if test="record.receiverAddress != null">
  531. receiver_address = #{record.receiverAddress,jdbcType=VARCHAR},
  532. </if>
  533. </set>
  534. <if test="_parameter != null">
  535. <include refid="Update_By_Example_Where_Clause" />
  536. </if>
  537. </update>
  538. <update id="updateByExample" parameterType="map">
  539. update jsh_depot_head
  540. set id = #{record.id,jdbcType=BIGINT},
  541. type = #{record.type,jdbcType=VARCHAR},
  542. sub_type = #{record.subType,jdbcType=VARCHAR},
  543. default_number = #{record.defaultNumber,jdbcType=VARCHAR},
  544. number = #{record.number,jdbcType=VARCHAR},
  545. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  546. oper_time = #{record.operTime,jdbcType=TIMESTAMP},
  547. organ_id = #{record.organId,jdbcType=BIGINT},
  548. creator = #{record.creator,jdbcType=BIGINT},
  549. account_id = #{record.accountId,jdbcType=BIGINT},
  550. change_amount = #{record.changeAmount,jdbcType=DECIMAL},
  551. back_amount = #{record.backAmount,jdbcType=DECIMAL},
  552. total_price = #{record.totalPrice,jdbcType=DECIMAL},
  553. pay_type = #{record.payType,jdbcType=VARCHAR},
  554. bill_type = #{record.billType,jdbcType=VARCHAR},
  555. remark = #{record.remark,jdbcType=VARCHAR},
  556. file_name = #{record.fileName,jdbcType=VARCHAR},
  557. sales_man = #{record.salesMan,jdbcType=VARCHAR},
  558. account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
  559. account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
  560. discount = #{record.discount,jdbcType=DECIMAL},
  561. discount_money = #{record.discountMoney,jdbcType=DECIMAL},
  562. discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
  563. other_money = #{record.otherMoney,jdbcType=DECIMAL},
  564. deposit = #{record.deposit,jdbcType=DECIMAL},
  565. status = #{record.status,jdbcType=VARCHAR},
  566. purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR},
  567. source = #{record.source,jdbcType=VARCHAR},
  568. link_number = #{record.linkNumber,jdbcType=VARCHAR},
  569. link_apply = #{record.linkApply,jdbcType=VARCHAR},
  570. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  571. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
  572. voucher_picture = #{record.voucherPicture,jdbcType=VARCHAR},
  573. goods_quantity = #{record.goodsQuantity,jdbcType=INTEGER},
  574. goods_type_count = #{record.goodsTypeCount,jdbcType=INTEGER},
  575. link_tesco = #{record.linkTesco,jdbcType=VARCHAR},
  576. receiver_name = #{record.receiverName,jdbcType=VARCHAR},
  577. receiver_phone = #{record.receiverPhone,jdbcType=VARCHAR},
  578. receiver_address = #{record.receiverAddress,jdbcType=VARCHAR}
  579. <if test="_parameter != null">
  580. <include refid="Update_By_Example_Where_Clause" />
  581. </if>
  582. </update>
  583. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
  584. update jsh_depot_head
  585. <set>
  586. <if test="type != null">
  587. type = #{type,jdbcType=VARCHAR},
  588. </if>
  589. <if test="subType != null">
  590. sub_type = #{subType,jdbcType=VARCHAR},
  591. </if>
  592. <if test="defaultNumber != null">
  593. default_number = #{defaultNumber,jdbcType=VARCHAR},
  594. </if>
  595. <if test="number != null">
  596. number = #{number,jdbcType=VARCHAR},
  597. </if>
  598. <if test="createTime != null">
  599. create_time = #{createTime,jdbcType=TIMESTAMP},
  600. </if>
  601. <if test="operTime != null">
  602. oper_time = #{operTime,jdbcType=TIMESTAMP},
  603. </if>
  604. <if test="organId != null">
  605. organ_id = #{organId,jdbcType=BIGINT},
  606. </if>
  607. <if test="creator != null">
  608. creator = #{creator,jdbcType=BIGINT},
  609. </if>
  610. <if test="accountId != null">
  611. account_id = #{accountId,jdbcType=BIGINT},
  612. </if>
  613. <if test="changeAmount != null">
  614. change_amount = #{changeAmount,jdbcType=DECIMAL},
  615. </if>
  616. <if test="backAmount != null">
  617. back_amount = #{backAmount,jdbcType=DECIMAL},
  618. </if>
  619. <if test="totalPrice != null">
  620. total_price = #{totalPrice,jdbcType=DECIMAL},
  621. </if>
  622. <if test="payType != null">
  623. pay_type = #{payType,jdbcType=VARCHAR},
  624. </if>
  625. <if test="billType != null">
  626. bill_type = #{billType,jdbcType=VARCHAR},
  627. </if>
  628. <if test="remark != null">
  629. remark = #{remark,jdbcType=VARCHAR},
  630. </if>
  631. <if test="fileName != null">
  632. file_name = #{fileName,jdbcType=VARCHAR},
  633. </if>
  634. <if test="salesMan != null">
  635. sales_man = #{salesMan,jdbcType=VARCHAR},
  636. </if>
  637. <if test="accountIdList != null">
  638. account_id_list = #{accountIdList,jdbcType=VARCHAR},
  639. </if>
  640. <if test="accountMoneyList != null">
  641. account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
  642. </if>
  643. <if test="discount != null">
  644. discount = #{discount,jdbcType=DECIMAL},
  645. </if>
  646. <if test="discountMoney != null">
  647. discount_money = #{discountMoney,jdbcType=DECIMAL},
  648. </if>
  649. <if test="discountLastMoney != null">
  650. discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
  651. </if>
  652. <if test="otherMoney != null">
  653. other_money = #{otherMoney,jdbcType=DECIMAL},
  654. </if>
  655. <if test="deposit != null">
  656. deposit = #{deposit,jdbcType=DECIMAL},
  657. </if>
  658. <if test="status != null">
  659. status = #{status,jdbcType=VARCHAR},
  660. </if>
  661. <if test="purchaseStatus != null">
  662. purchase_status = #{purchaseStatus,jdbcType=VARCHAR},
  663. </if>
  664. <if test="source != null">
  665. source = #{source,jdbcType=VARCHAR},
  666. </if>
  667. <if test="linkNumber != null">
  668. link_number = #{linkNumber,jdbcType=VARCHAR},
  669. </if>
  670. <if test="linkApply != null">
  671. link_apply = #{linkApply,jdbcType=VARCHAR},
  672. </if>
  673. <if test="tenantId != null">
  674. tenant_id = #{tenantId,jdbcType=BIGINT},
  675. </if>
  676. <if test="deleteFlag != null">
  677. delete_flag = #{deleteFlag,jdbcType=VARCHAR},
  678. </if>
  679. <if test="voucherPicture != null">
  680. voucher_picture = #{voucherPicture,jdbcType=VARCHAR},
  681. </if>
  682. <if test="goodsQuantity != null">
  683. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  684. </if>
  685. <if test="goodsTypeCount != null">
  686. goods_type_count = #{goodsTypeCount,jdbcType=INTEGER},
  687. </if>
  688. <if test="linkTesco != null">
  689. link_tesco =#{linkTesco,jdbcType=VARCHAR},
  690. </if>
  691. <if test="receiverName != null">
  692. receiver_name = #{receiverName,jdbcType=VARCHAR},
  693. </if>
  694. <if test="receiverPhone != null">
  695. receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
  696. </if>
  697. <if test="receiverAddress != null">
  698. receiver_address = #{receiverAddress,jdbcType=VARCHAR},
  699. </if>
  700. <if test="depotId != null">
  701. depot_id = #{depotId,jdbcType=BIGINT},
  702. </if>
  703. <if test="operId != null">
  704. oper_id = #{operId,jdbcType=BIGINT}
  705. </if>
  706. </set>
  707. where id = #{id,jdbcType=BIGINT}
  708. </update>
  709. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotHead">
  710. update jsh_depot_head
  711. set type = #{type,jdbcType=VARCHAR},
  712. sub_type = #{subType,jdbcType=VARCHAR},
  713. default_number = #{defaultNumber,jdbcType=VARCHAR},
  714. number = #{number,jdbcType=VARCHAR},
  715. create_time = #{createTime,jdbcType=TIMESTAMP},
  716. oper_time = #{operTime,jdbcType=TIMESTAMP},
  717. organ_id = #{organId,jdbcType=BIGINT},
  718. creator = #{creator,jdbcType=BIGINT},
  719. account_id = #{accountId,jdbcType=BIGINT},
  720. change_amount = #{changeAmount,jdbcType=DECIMAL},
  721. back_amount = #{backAmount,jdbcType=DECIMAL},
  722. total_price = #{totalPrice,jdbcType=DECIMAL},
  723. pay_type = #{payType,jdbcType=VARCHAR},
  724. bill_type = #{billType,jdbcType=VARCHAR},
  725. remark = #{remark,jdbcType=VARCHAR},
  726. file_name = #{fileName,jdbcType=VARCHAR},
  727. sales_man = #{salesMan,jdbcType=VARCHAR},
  728. account_id_list = #{accountIdList,jdbcType=VARCHAR},
  729. account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
  730. discount = #{discount,jdbcType=DECIMAL},
  731. discount_money = #{discountMoney,jdbcType=DECIMAL},
  732. discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
  733. other_money = #{otherMoney,jdbcType=DECIMAL},
  734. deposit = #{deposit,jdbcType=DECIMAL},
  735. status = #{status,jdbcType=VARCHAR},
  736. purchase_status = #{purchaseStatus,jdbcType=VARCHAR},
  737. source = #{source,jdbcType=VARCHAR},
  738. link_number = #{linkNumber,jdbcType=VARCHAR},
  739. link_apply = #{linkApply,jdbcType=VARCHAR},
  740. tenant_id = #{tenantId,jdbcType=BIGINT},
  741. delete_flag = #{deleteFlag,jdbcType=VARCHAR},
  742. voucher_picture = #{voucherPicture,jdbcType=VARCHAR},
  743. goods_quantity = #{goodsQuantity,jdbcType=INTEGER},
  744. goods_type_count = #{goodsTypeCount,jdbcType=INTEGER},
  745. link_tesco = #{linkTesco,jdbcType=VARCHAR},
  746. receiver_name = #{receiverName,jdbcType=VARCHAR},
  747. receiver_phone = #{receiverPhone,jdbcType=VARCHAR},
  748. receiver_address = #{receiverAddress,jdbcType=VARCHAR}
  749. where id = #{id,jdbcType=BIGINT}
  750. </update>
  751. <select id="pdaList" parameterType="com.jsh.erp.datasource.pda.dto.PDADepotHeadDTO" resultType="com.jsh.erp.datasource.pda.vo.PDADepotHeadVO">
  752. SELECT
  753. dh.id,
  754. dh.number,
  755. dh.create_time,
  756. dh.goods_quantity,
  757. dh.goods_type_count,
  758. dh.oper_time,
  759. s.supplier AS supplier_name,
  760. dh.status
  761. FROM
  762. jsh_depot_head dh
  763. LEFT JOIN jsh_supplier s ON dh.organ_id = s.id
  764. <where>
  765. dh.sub_type = #{subType}
  766. AND dh.delete_flag = '0'
  767. AND ifnull(dh.status,'0') != '0'
  768. <if test="number != null and number != ''">
  769. AND dh.number = #{number}
  770. </if>
  771. <if test="status != null and status != ''">
  772. AND dh.status = #{status}
  773. </if>
  774. <if test="beginTime != null and beginTime != ''">
  775. AND dh.create_time between #{beginTime} and #{endTime}
  776. </if>
  777. </where>
  778. GROUP BY dh.id
  779. ORDER BY dh.create_time DESC
  780. </select>
  781. <select id="pdaDetail" resultType="com.jsh.erp.datasource.pda.vo.PDADepotHeadVO">
  782. SELECT
  783. dh.id,
  784. dh.number,
  785. dh.create_time,
  786. dh.goods_quantity,
  787. dh.goods_type_count,
  788. dh.oper_time,
  789. s.supplier AS supplier_name,
  790. dh.status
  791. FROM
  792. jsh_depot_head dh
  793. LEFT JOIN jsh_supplier s ON dh.organ_id = s.id
  794. LEFT JOIN jsh_
  795. WHERE
  796. dh.id = #{id}
  797. </select>
  798. <select id="getDepotLastByMaterialId" resultType="com.jsh.erp.datasource.entities.DepotHead">
  799. SELECT dh.* FROM jsh_depot_item di
  800. LEFT JOIN jsh_depot_head dh ON di.header_id = dh.id
  801. WHERE di.material_id = #{id}
  802. AND dh.type = '出库'
  803. AND ifnull(dh.delete_flag,'0') != '1'
  804. ORDER BY dh.oper_time DESC LIMIT 1
  805. </select>
  806. </mapper>