TOrderInvoiceMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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.goafanti.common.dao.TOrderInvoiceMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderInvoice">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri May 17 09:46:50 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="type" jdbcType="INTEGER" property="type" />
  13. <result column="status" jdbcType="INTEGER" property="status" />
  14. <result column="reject_reason" jdbcType="VARCHAR" property="rejectReason" />
  15. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  16. <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
  17. <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
  18. <result column="tax_number" jdbcType="VARCHAR" property="taxNumber" />
  19. <result column="amount" jdbcType="DECIMAL" property="amount" />
  20. <result column="banks" jdbcType="VARCHAR" property="banks" />
  21. <result column="content" jdbcType="VARCHAR" property="content" />
  22. <result column="unit_address" jdbcType="VARCHAR" property="unitAddress" />
  23. <result column="invoice_remarks" jdbcType="VARCHAR" property="invoiceRemarks" />
  24. <result column="unit_mobile" jdbcType="VARCHAR" property="unitMobile" />
  25. <result column="voucher_url" jdbcType="VARCHAR" property="voucherUrl" />
  26. <result column="post" jdbcType="INTEGER" property="post" />
  27. <result column="addressee" jdbcType="VARCHAR" property="addressee" />
  28. <result column="addressee_mobile" jdbcType="VARCHAR" property="addresseeMobile" />
  29. <result column="addressee_province" jdbcType="INTEGER" property="addresseeProvince" />
  30. <result column="addressee_city" jdbcType="INTEGER" property="addresseeCity" />
  31. <result column="addressee_area" jdbcType="INTEGER" property="addresseeArea" />
  32. <result column="recipient_address" jdbcType="VARCHAR" property="recipientAddress" />
  33. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  34. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  35. <result column="approval" jdbcType="INTEGER" property="approval" />
  36. <result column="already_amount" jdbcType="DECIMAL" property="alreadyAmount" />
  37. </resultMap>
  38. <sql id="Example_Where_Clause">
  39. <!--
  40. WARNING - @mbg.generated
  41. This element is automatically generated by MyBatis Generator, do not modify.
  42. This element was generated on Fri May 17 09:46:50 CST 2019.
  43. -->
  44. <where>
  45. <foreach collection="oredCriteria" item="criteria" separator="or">
  46. <if test="criteria.valid">
  47. <trim prefix="(" prefixOverrides="and" suffix=")">
  48. <foreach collection="criteria.criteria" item="criterion">
  49. <choose>
  50. <when test="criterion.noValue">
  51. and ${criterion.condition}
  52. </when>
  53. <when test="criterion.singleValue">
  54. and ${criterion.condition} #{criterion.value}
  55. </when>
  56. <when test="criterion.betweenValue">
  57. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  58. </when>
  59. <when test="criterion.listValue">
  60. and ${criterion.condition}
  61. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  62. #{listItem}
  63. </foreach>
  64. </when>
  65. </choose>
  66. </foreach>
  67. </trim>
  68. </if>
  69. </foreach>
  70. </where>
  71. </sql>
  72. <sql id="Update_By_Example_Where_Clause">
  73. <!--
  74. WARNING - @mbg.generated
  75. This element is automatically generated by MyBatis Generator, do not modify.
  76. This element was generated on Fri May 17 09:46:50 CST 2019.
  77. -->
  78. <where>
  79. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  80. <if test="criteria.valid">
  81. <trim prefix="(" prefixOverrides="and" suffix=")">
  82. <foreach collection="criteria.criteria" item="criterion">
  83. <choose>
  84. <when test="criterion.noValue">
  85. and ${criterion.condition}
  86. </when>
  87. <when test="criterion.singleValue">
  88. and ${criterion.condition} #{criterion.value}
  89. </when>
  90. <when test="criterion.betweenValue">
  91. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  92. </when>
  93. <when test="criterion.listValue">
  94. and ${criterion.condition}
  95. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  96. #{listItem}
  97. </foreach>
  98. </when>
  99. </choose>
  100. </foreach>
  101. </trim>
  102. </if>
  103. </foreach>
  104. </where>
  105. </sql>
  106. <sql id="Base_Column_List">
  107. <!--
  108. WARNING - @mbg.generated
  109. This element is automatically generated by MyBatis Generator, do not modify.
  110. This element was generated on Fri May 17 09:46:50 CST 2019.
  111. -->
  112. id, order_no, type, status, reject_reason, remarks, invoice_type, unit_name, tax_number,
  113. amount, banks, content, unit_address, invoice_remarks, unit_mobile, voucher_url,
  114. post, addressee, addressee_mobile, addressee_province, addressee_city, addressee_area,
  115. recipient_address, create_time, update_time, approval, already_amount
  116. </sql>
  117. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultMap="BaseResultMap">
  118. <!--
  119. WARNING - @mbg.generated
  120. This element is automatically generated by MyBatis Generator, do not modify.
  121. This element was generated on Fri May 17 09:46:50 CST 2019.
  122. -->
  123. select
  124. <if test="distinct">
  125. distinct
  126. </if>
  127. <include refid="Base_Column_List" />
  128. from t_order_invoice
  129. <if test="_parameter != null">
  130. <include refid="Example_Where_Clause" />
  131. </if>
  132. <if test="orderByClause != null">
  133. order by ${orderByClause}
  134. </if>
  135. </select>
  136. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  137. <!--
  138. WARNING - @mbg.generated
  139. This element is automatically generated by MyBatis Generator, do not modify.
  140. This element was generated on Fri May 17 09:46:50 CST 2019.
  141. -->
  142. select
  143. <include refid="Base_Column_List" />
  144. from t_order_invoice
  145. where id = #{id,jdbcType=INTEGER}
  146. </select>
  147. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. This element was generated on Fri May 17 09:46:50 CST 2019.
  152. -->
  153. delete from t_order_invoice
  154. where id = #{id,jdbcType=INTEGER}
  155. </delete>
  156. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample">
  157. <!--
  158. WARNING - @mbg.generated
  159. This element is automatically generated by MyBatis Generator, do not modify.
  160. This element was generated on Fri May 17 09:46:50 CST 2019.
  161. -->
  162. delete from t_order_invoice
  163. <if test="_parameter != null">
  164. <include refid="Example_Where_Clause" />
  165. </if>
  166. </delete>
  167. <insert id="insert" parameterType="com.goafanti.common.model.TOrderInvoice">
  168. <!--
  169. WARNING - @mbg.generated
  170. This element is automatically generated by MyBatis Generator, do not modify.
  171. This element was generated on Fri May 17 09:46:50 CST 2019.
  172. -->
  173. insert into t_order_invoice (id, order_no, type,
  174. status, reject_reason, remarks,
  175. invoice_type, unit_name, tax_number,
  176. amount, banks, content,
  177. unit_address, invoice_remarks, unit_mobile,
  178. voucher_url, post, addressee,
  179. addressee_mobile, addressee_province, addressee_city,
  180. addressee_area, recipient_address, create_time,
  181. update_time, approval, already_amount
  182. )
  183. values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  184. #{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
  185. #{invoiceType,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
  186. #{amount,jdbcType=DECIMAL}, #{banks,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
  187. #{unitAddress,jdbcType=VARCHAR}, #{invoiceRemarks,jdbcType=VARCHAR}, #{unitMobile,jdbcType=VARCHAR},
  188. #{voucherUrl,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, #{addressee,jdbcType=VARCHAR},
  189. #{addresseeMobile,jdbcType=VARCHAR}, #{addresseeProvince,jdbcType=INTEGER}, #{addresseeCity,jdbcType=INTEGER},
  190. #{addresseeArea,jdbcType=INTEGER}, #{recipientAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  191. #{updateTime,jdbcType=TIMESTAMP}, #{approval,jdbcType=INTEGER}, #{alreadyAmount,jdbcType=DECIMAL}
  192. )
  193. </insert>
  194. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderInvoice">
  195. <!--
  196. WARNING - @mbg.generated
  197. This element is automatically generated by MyBatis Generator, do not modify.
  198. This element was generated on Fri May 17 09:46:50 CST 2019.
  199. -->
  200. insert into t_order_invoice
  201. <trim prefix="(" suffix=")" suffixOverrides=",">
  202. <if test="id != null">
  203. id,
  204. </if>
  205. <if test="orderNo != null">
  206. order_no,
  207. </if>
  208. <if test="type != null">
  209. type,
  210. </if>
  211. <if test="status != null">
  212. status,
  213. </if>
  214. <if test="rejectReason != null">
  215. reject_reason,
  216. </if>
  217. <if test="remarks != null">
  218. remarks,
  219. </if>
  220. <if test="invoiceType != null">
  221. invoice_type,
  222. </if>
  223. <if test="unitName != null">
  224. unit_name,
  225. </if>
  226. <if test="taxNumber != null">
  227. tax_number,
  228. </if>
  229. <if test="amount != null">
  230. amount,
  231. </if>
  232. <if test="banks != null">
  233. banks,
  234. </if>
  235. <if test="content != null">
  236. content,
  237. </if>
  238. <if test="unitAddress != null">
  239. unit_address,
  240. </if>
  241. <if test="invoiceRemarks != null">
  242. invoice_remarks,
  243. </if>
  244. <if test="unitMobile != null">
  245. unit_mobile,
  246. </if>
  247. <if test="voucherUrl != null">
  248. voucher_url,
  249. </if>
  250. <if test="post != null">
  251. post,
  252. </if>
  253. <if test="addressee != null">
  254. addressee,
  255. </if>
  256. <if test="addresseeMobile != null">
  257. addressee_mobile,
  258. </if>
  259. <if test="addresseeProvince != null">
  260. addressee_province,
  261. </if>
  262. <if test="addresseeCity != null">
  263. addressee_city,
  264. </if>
  265. <if test="addresseeArea != null">
  266. addressee_area,
  267. </if>
  268. <if test="recipientAddress != null">
  269. recipient_address,
  270. </if>
  271. <if test="createTime != null">
  272. create_time,
  273. </if>
  274. <if test="updateTime != null">
  275. update_time,
  276. </if>
  277. <if test="approval != null">
  278. approval,
  279. </if>
  280. <if test="alreadyAmount != null">
  281. already_amount,
  282. </if>
  283. </trim>
  284. <trim prefix="values (" suffix=")" suffixOverrides=",">
  285. <if test="id != null">
  286. #{id,jdbcType=INTEGER},
  287. </if>
  288. <if test="orderNo != null">
  289. #{orderNo,jdbcType=VARCHAR},
  290. </if>
  291. <if test="type != null">
  292. #{type,jdbcType=INTEGER},
  293. </if>
  294. <if test="status != null">
  295. #{status,jdbcType=INTEGER},
  296. </if>
  297. <if test="rejectReason != null">
  298. #{rejectReason,jdbcType=VARCHAR},
  299. </if>
  300. <if test="remarks != null">
  301. #{remarks,jdbcType=VARCHAR},
  302. </if>
  303. <if test="invoiceType != null">
  304. #{invoiceType,jdbcType=INTEGER},
  305. </if>
  306. <if test="unitName != null">
  307. #{unitName,jdbcType=VARCHAR},
  308. </if>
  309. <if test="taxNumber != null">
  310. #{taxNumber,jdbcType=VARCHAR},
  311. </if>
  312. <if test="amount != null">
  313. #{amount,jdbcType=DECIMAL},
  314. </if>
  315. <if test="banks != null">
  316. #{banks,jdbcType=VARCHAR},
  317. </if>
  318. <if test="content != null">
  319. #{content,jdbcType=VARCHAR},
  320. </if>
  321. <if test="unitAddress != null">
  322. #{unitAddress,jdbcType=VARCHAR},
  323. </if>
  324. <if test="invoiceRemarks != null">
  325. #{invoiceRemarks,jdbcType=VARCHAR},
  326. </if>
  327. <if test="unitMobile != null">
  328. #{unitMobile,jdbcType=VARCHAR},
  329. </if>
  330. <if test="voucherUrl != null">
  331. #{voucherUrl,jdbcType=VARCHAR},
  332. </if>
  333. <if test="post != null">
  334. #{post,jdbcType=INTEGER},
  335. </if>
  336. <if test="addressee != null">
  337. #{addressee,jdbcType=VARCHAR},
  338. </if>
  339. <if test="addresseeMobile != null">
  340. #{addresseeMobile,jdbcType=VARCHAR},
  341. </if>
  342. <if test="addresseeProvince != null">
  343. #{addresseeProvince,jdbcType=INTEGER},
  344. </if>
  345. <if test="addresseeCity != null">
  346. #{addresseeCity,jdbcType=INTEGER},
  347. </if>
  348. <if test="addresseeArea != null">
  349. #{addresseeArea,jdbcType=INTEGER},
  350. </if>
  351. <if test="recipientAddress != null">
  352. #{recipientAddress,jdbcType=VARCHAR},
  353. </if>
  354. <if test="createTime != null">
  355. #{createTime,jdbcType=TIMESTAMP},
  356. </if>
  357. <if test="updateTime != null">
  358. #{updateTime,jdbcType=TIMESTAMP},
  359. </if>
  360. <if test="approval != null">
  361. #{approval,jdbcType=INTEGER},
  362. </if>
  363. <if test="alreadyAmount != null">
  364. #{alreadyAmount,jdbcType=DECIMAL},
  365. </if>
  366. </trim>
  367. </insert>
  368. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultType="java.lang.Long">
  369. <!--
  370. WARNING - @mbg.generated
  371. This element is automatically generated by MyBatis Generator, do not modify.
  372. This element was generated on Fri May 17 09:46:50 CST 2019.
  373. -->
  374. select count(*) from t_order_invoice
  375. <if test="_parameter != null">
  376. <include refid="Example_Where_Clause" />
  377. </if>
  378. </select>
  379. <update id="updateByExampleSelective" parameterType="map">
  380. <!--
  381. WARNING - @mbg.generated
  382. This element is automatically generated by MyBatis Generator, do not modify.
  383. This element was generated on Fri May 17 09:46:50 CST 2019.
  384. -->
  385. update t_order_invoice
  386. <set>
  387. <if test="record.id != null">
  388. id = #{record.id,jdbcType=INTEGER},
  389. </if>
  390. <if test="record.orderNo != null">
  391. order_no = #{record.orderNo,jdbcType=VARCHAR},
  392. </if>
  393. <if test="record.type != null">
  394. type = #{record.type,jdbcType=INTEGER},
  395. </if>
  396. <if test="record.status != null">
  397. status = #{record.status,jdbcType=INTEGER},
  398. </if>
  399. <if test="record.rejectReason != null">
  400. reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
  401. </if>
  402. <if test="record.remarks != null">
  403. remarks = #{record.remarks,jdbcType=VARCHAR},
  404. </if>
  405. <if test="record.invoiceType != null">
  406. invoice_type = #{record.invoiceType,jdbcType=INTEGER},
  407. </if>
  408. <if test="record.unitName != null">
  409. unit_name = #{record.unitName,jdbcType=VARCHAR},
  410. </if>
  411. <if test="record.taxNumber != null">
  412. tax_number = #{record.taxNumber,jdbcType=VARCHAR},
  413. </if>
  414. <if test="record.amount != null">
  415. amount = #{record.amount,jdbcType=DECIMAL},
  416. </if>
  417. <if test="record.banks != null">
  418. banks = #{record.banks,jdbcType=VARCHAR},
  419. </if>
  420. <if test="record.content != null">
  421. content = #{record.content,jdbcType=VARCHAR},
  422. </if>
  423. <if test="record.unitAddress != null">
  424. unit_address = #{record.unitAddress,jdbcType=VARCHAR},
  425. </if>
  426. <if test="record.invoiceRemarks != null">
  427. invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
  428. </if>
  429. <if test="record.unitMobile != null">
  430. unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
  431. </if>
  432. <if test="record.voucherUrl != null">
  433. voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
  434. </if>
  435. <if test="record.post != null">
  436. post = #{record.post,jdbcType=INTEGER},
  437. </if>
  438. <if test="record.addressee != null">
  439. addressee = #{record.addressee,jdbcType=VARCHAR},
  440. </if>
  441. <if test="record.addresseeMobile != null">
  442. addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
  443. </if>
  444. <if test="record.addresseeProvince != null">
  445. addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
  446. </if>
  447. <if test="record.addresseeCity != null">
  448. addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
  449. </if>
  450. <if test="record.addresseeArea != null">
  451. addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
  452. </if>
  453. <if test="record.recipientAddress != null">
  454. recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
  455. </if>
  456. <if test="record.createTime != null">
  457. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  458. </if>
  459. <if test="record.updateTime != null">
  460. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  461. </if>
  462. <if test="record.approval != null">
  463. approval = #{record.approval,jdbcType=INTEGER},
  464. </if>
  465. <if test="record.alreadyAmount != null">
  466. already_amount = #{record.alreadyAmount,jdbcType=DECIMAL},
  467. </if>
  468. </set>
  469. <if test="_parameter != null">
  470. <include refid="Update_By_Example_Where_Clause" />
  471. </if>
  472. </update>
  473. <update id="updateByExample" parameterType="map">
  474. <!--
  475. WARNING - @mbg.generated
  476. This element is automatically generated by MyBatis Generator, do not modify.
  477. This element was generated on Fri May 17 09:46:50 CST 2019.
  478. -->
  479. update t_order_invoice
  480. set id = #{record.id,jdbcType=INTEGER},
  481. order_no = #{record.orderNo,jdbcType=VARCHAR},
  482. type = #{record.type,jdbcType=INTEGER},
  483. status = #{record.status,jdbcType=INTEGER},
  484. reject_reason = #{record.rejectReason,jdbcType=VARCHAR},
  485. remarks = #{record.remarks,jdbcType=VARCHAR},
  486. invoice_type = #{record.invoiceType,jdbcType=INTEGER},
  487. unit_name = #{record.unitName,jdbcType=VARCHAR},
  488. tax_number = #{record.taxNumber,jdbcType=VARCHAR},
  489. amount = #{record.amount,jdbcType=DECIMAL},
  490. banks = #{record.banks,jdbcType=VARCHAR},
  491. content = #{record.content,jdbcType=VARCHAR},
  492. unit_address = #{record.unitAddress,jdbcType=VARCHAR},
  493. invoice_remarks = #{record.invoiceRemarks,jdbcType=VARCHAR},
  494. unit_mobile = #{record.unitMobile,jdbcType=VARCHAR},
  495. voucher_url = #{record.voucherUrl,jdbcType=VARCHAR},
  496. post = #{record.post,jdbcType=INTEGER},
  497. addressee = #{record.addressee,jdbcType=VARCHAR},
  498. addressee_mobile = #{record.addresseeMobile,jdbcType=VARCHAR},
  499. addressee_province = #{record.addresseeProvince,jdbcType=INTEGER},
  500. addressee_city = #{record.addresseeCity,jdbcType=INTEGER},
  501. addressee_area = #{record.addresseeArea,jdbcType=INTEGER},
  502. recipient_address = #{record.recipientAddress,jdbcType=VARCHAR},
  503. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  504. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  505. approval = #{record.approval,jdbcType=INTEGER},
  506. already_amount = #{record.alreadyAmount,jdbcType=DECIMAL}
  507. <if test="_parameter != null">
  508. <include refid="Update_By_Example_Where_Clause" />
  509. </if>
  510. </update>
  511. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderInvoice">
  512. <!--
  513. WARNING - @mbg.generated
  514. This element is automatically generated by MyBatis Generator, do not modify.
  515. This element was generated on Fri May 17 09:46:50 CST 2019.
  516. -->
  517. update t_order_invoice
  518. <set>
  519. <if test="orderNo != null">
  520. order_no = #{orderNo,jdbcType=VARCHAR},
  521. </if>
  522. <if test="type != null">
  523. type = #{type,jdbcType=INTEGER},
  524. </if>
  525. <if test="status != null">
  526. status = #{status,jdbcType=INTEGER},
  527. </if>
  528. <if test="rejectReason != null">
  529. reject_reason = #{rejectReason,jdbcType=VARCHAR},
  530. </if>
  531. <if test="remarks != null">
  532. remarks = #{remarks,jdbcType=VARCHAR},
  533. </if>
  534. <if test="invoiceType != null">
  535. invoice_type = #{invoiceType,jdbcType=INTEGER},
  536. </if>
  537. <if test="unitName != null">
  538. unit_name = #{unitName,jdbcType=VARCHAR},
  539. </if>
  540. <if test="taxNumber != null">
  541. tax_number = #{taxNumber,jdbcType=VARCHAR},
  542. </if>
  543. <if test="amount != null">
  544. amount = #{amount,jdbcType=DECIMAL},
  545. </if>
  546. <if test="banks != null">
  547. banks = #{banks,jdbcType=VARCHAR},
  548. </if>
  549. <if test="content != null">
  550. content = #{content,jdbcType=VARCHAR},
  551. </if>
  552. <if test="unitAddress != null">
  553. unit_address = #{unitAddress,jdbcType=VARCHAR},
  554. </if>
  555. <if test="invoiceRemarks != null">
  556. invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
  557. </if>
  558. <if test="unitMobile != null">
  559. unit_mobile = #{unitMobile,jdbcType=VARCHAR},
  560. </if>
  561. <if test="voucherUrl != null">
  562. voucher_url = #{voucherUrl,jdbcType=VARCHAR},
  563. </if>
  564. <if test="post != null">
  565. post = #{post,jdbcType=INTEGER},
  566. </if>
  567. <if test="addressee != null">
  568. addressee = #{addressee,jdbcType=VARCHAR},
  569. </if>
  570. <if test="addresseeMobile != null">
  571. addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
  572. </if>
  573. <if test="addresseeProvince != null">
  574. addressee_province = #{addresseeProvince,jdbcType=INTEGER},
  575. </if>
  576. <if test="addresseeCity != null">
  577. addressee_city = #{addresseeCity,jdbcType=INTEGER},
  578. </if>
  579. <if test="addresseeArea != null">
  580. addressee_area = #{addresseeArea,jdbcType=INTEGER},
  581. </if>
  582. <if test="recipientAddress != null">
  583. recipient_address = #{recipientAddress,jdbcType=VARCHAR},
  584. </if>
  585. <if test="createTime != null">
  586. create_time = #{createTime,jdbcType=TIMESTAMP},
  587. </if>
  588. <if test="updateTime != null">
  589. update_time = #{updateTime,jdbcType=TIMESTAMP},
  590. </if>
  591. <if test="approval != null">
  592. approval = #{approval,jdbcType=INTEGER},
  593. </if>
  594. <if test="alreadyAmount != null">
  595. already_amount = #{alreadyAmount,jdbcType=DECIMAL},
  596. </if>
  597. </set>
  598. where id = #{id,jdbcType=INTEGER}
  599. </update>
  600. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderInvoice">
  601. <!--
  602. WARNING - @mbg.generated
  603. This element is automatically generated by MyBatis Generator, do not modify.
  604. This element was generated on Fri May 17 09:46:50 CST 2019.
  605. -->
  606. update t_order_invoice
  607. set order_no = #{orderNo,jdbcType=VARCHAR},
  608. type = #{type,jdbcType=INTEGER},
  609. status = #{status,jdbcType=INTEGER},
  610. reject_reason = #{rejectReason,jdbcType=VARCHAR},
  611. remarks = #{remarks,jdbcType=VARCHAR},
  612. invoice_type = #{invoiceType,jdbcType=INTEGER},
  613. unit_name = #{unitName,jdbcType=VARCHAR},
  614. tax_number = #{taxNumber,jdbcType=VARCHAR},
  615. amount = #{amount,jdbcType=DECIMAL},
  616. banks = #{banks,jdbcType=VARCHAR},
  617. content = #{content,jdbcType=VARCHAR},
  618. unit_address = #{unitAddress,jdbcType=VARCHAR},
  619. invoice_remarks = #{invoiceRemarks,jdbcType=VARCHAR},
  620. unit_mobile = #{unitMobile,jdbcType=VARCHAR},
  621. voucher_url = #{voucherUrl,jdbcType=VARCHAR},
  622. post = #{post,jdbcType=INTEGER},
  623. addressee = #{addressee,jdbcType=VARCHAR},
  624. addressee_mobile = #{addresseeMobile,jdbcType=VARCHAR},
  625. addressee_province = #{addresseeProvince,jdbcType=INTEGER},
  626. addressee_city = #{addresseeCity,jdbcType=INTEGER},
  627. addressee_area = #{addresseeArea,jdbcType=INTEGER},
  628. recipient_address = #{recipientAddress,jdbcType=VARCHAR},
  629. create_time = #{createTime,jdbcType=TIMESTAMP},
  630. update_time = #{updateTime,jdbcType=TIMESTAMP},
  631. approval = #{approval,jdbcType=INTEGER},
  632. already_amount = #{alreadyAmount,jdbcType=DECIMAL}
  633. where id = #{id,jdbcType=INTEGER}
  634. </update>
  635. <select id="checkApplyAmount" resultType="java.lang.Double">
  636. select ifnull(sum(amount),0) from t_order_invoice
  637. where order_no= #{orderNo,jdbcType=VARCHAR} and status !=4
  638. <if test="id != null">
  639. and id != #{id,jdbcType=INTEGER}
  640. </if>
  641. </select>
  642. <select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
  643. select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
  644. ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status,
  645. b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
  646. left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
  647. left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
  648. on a.order_no=d.order_no where a.status in (1,2) and a.approval in (0,2)
  649. <if test="type !=null">
  650. and a.`type`= #{type,jdbcType=INTEGER}
  651. </if>
  652. <if test="financeId !=null">
  653. and b.finance_id= #{financeId,jdbcType=VARCHAR}
  654. </if>
  655. <if test="orderNo !=null">
  656. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  657. </if>
  658. <if test="name !=null">
  659. and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  660. </if>
  661. <if test="orderDep !=null">
  662. and b.order_dep= #{orderDep,jdbcType=VARCHAR}
  663. </if>
  664. <if test="aDep !=null">
  665. and c.department_id=#{aDep,jdbcType=VARCHAR}
  666. </if>
  667. order by a.status ,a.create_time desc
  668. <if test="page_sql!=null">
  669. ${page_sql}
  670. </if>
  671. </select>
  672. <select id="financeOrderInvoiceCount" resultType="java.lang.Integer">
  673. select count(*) from t_order_invoice a
  674. left join t_order_new b on a.order_no=b.order_no
  675. left join admin c on b.salesman_id=c.id
  676. where a.status in (1,2) and a.approval in (0,2)
  677. <if test="type !=null">
  678. and a.`type`= #{type,jdbcType=INTEGER}
  679. </if>
  680. <if test="financeId !=null">
  681. and b.finance_id= #{financeId,jdbcType=VARCHAR}
  682. </if>
  683. <if test="orderNo !=null">
  684. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  685. </if>
  686. <if test="name !=null">
  687. and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  688. </if>
  689. <if test="orderDep !=null">
  690. and b.order_dep= #{orderDep,jdbcType=VARCHAR}
  691. </if>
  692. <if test="aDep !=null">
  693. and c.department_id=#{aDep,jdbcType=VARCHAR}
  694. </if>
  695. </select>
  696. <select id="salesmanOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
  697. select id ,order_no as orderNo,amount,date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTime,
  698. reject_reason as rejectReason,status from t_order_invoice
  699. where status !=4
  700. <if test="orderNo !=null">
  701. and order_no = #{orderNo,jdbcType=VARCHAR}
  702. </if>
  703. order by create_time desc
  704. <if test="page_sql!=null">
  705. ${page_sql}
  706. </if>
  707. </select>
  708. <select id="salesmanOrderInvoiceCount" resultType="java.lang.Integer">
  709. select count(*) from t_order_invoice where status !=4
  710. <if test="orderNo !=null">
  711. and order_no = #{orderNo,jdbcType=VARCHAR}
  712. </if>
  713. </select>
  714. <select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
  715. select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
  716. ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,
  717. b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
  718. left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
  719. left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
  720. on a.order_no=d.order_no where a.status =1 and a.approval =1
  721. <if test="type !=null">
  722. and a.type= #{type,jdbcType=INTEGER}
  723. </if>
  724. <if test="orderNo !=null">
  725. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  726. </if>
  727. <if test="name !=null">
  728. and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  729. </if>
  730. <if test="orderDep !=null">
  731. and b.order_dep= #{orderDep,jdbcType=VARCHAR}
  732. </if>
  733. <if test="aDep !=null">
  734. and c.department_id= #{aDep,jdbcType=VARCHAR}
  735. </if>
  736. order by a.create_time desc
  737. <if test="page_sql!=null">
  738. ${page_sql}
  739. </if>
  740. </select>
  741. <select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
  742. select count(*) from t_order_invoice a
  743. left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
  744. where a.status =1 and a.approval =1
  745. <if test="type !=null">
  746. and a.type= #{type,jdbcType=INTEGER}
  747. </if>
  748. <if test="orderNo !=null">
  749. and a.order_no = #{orderNo,jdbcType=VARCHAR}
  750. </if>
  751. <if test="name !=null">
  752. and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  753. </if>
  754. <if test="orderDep !=null">
  755. and b.order_dep= #{orderDep,jdbcType=VARCHAR}
  756. </if>
  757. <if test="aDep !=null">
  758. and c.department_id= #{aDep,jdbcType=VARCHAR}
  759. </if>
  760. </select>
  761. <select id="selectByInvoiceDitails" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderInvoiceDetails">
  762. select a.id ,a.order_no as orderNo,a.`type`,a.status,a.reject_reason as rejectReason,a.remarks,a.invoice_type as invoiceType,
  763. a.unit_name as unitName,a.tax_number as taxNumber,a.amount,a.banks,a.content,a.unit_address as unitAddress,
  764. a.invoice_remarks as invoiceRemarks,a.unit_mobile as unitMobile,a.voucher_url as voucherUrl ,a.post,a.addressee,
  765. a.addressee_area as addresseeArea,a.addressee_city as addresseeCity,a.addressee_province as addresseeProvince,
  766. a.addressee_mobile as addresseeMobile,a.recipient_address as recipientAddress,a.create_time,a.update_time,a.approval,
  767. a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
  768. left join t_order_new b on a.order_no=b.order_no
  769. where id = #{id,jdbcType=INTEGER}
  770. </select>
  771. </mapper>