ThirdPartyCompanyMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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.ThirdPartyCompanyMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.ThirdPartyCompany">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="tid" jdbcType="INTEGER" property="tid" />
  12. <result column="company_name" jdbcType="VARCHAR" property="companyName" />
  13. <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
  14. <result column="quantity" jdbcType="INTEGER" property="quantity" />
  15. <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
  16. <result column="material" jdbcType="INTEGER" property="material" />
  17. <result column="urgent" jdbcType="INTEGER" property="urgent" />
  18. <result column="audit" jdbcType="INTEGER" property="audit" />
  19. <result column="assets" jdbcType="VARCHAR" property="assets" />
  20. <result column="income" jdbcType="VARCHAR" property="income" />
  21. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  22. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  23. <result column="cid" jdbcType="INTEGER" property="cid" />
  24. <result column="party_amount" jdbcType="DECIMAL" property="partyAmount" />
  25. <result column="type" jdbcType="INTEGER" property="type" />
  26. <result column="patent_name_type" jdbcType="INTEGER" property="patentNameType" />
  27. <result column="official_amount" jdbcType="DECIMAL" property="officialAmount" />
  28. </resultMap>
  29. <sql id="Example_Where_Clause">
  30. <!--
  31. WARNING - @mbg.generated
  32. This element is automatically generated by MyBatis Generator, do not modify.
  33. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  34. -->
  35. <where>
  36. <foreach collection="oredCriteria" item="criteria" separator="or">
  37. <if test="criteria.valid">
  38. <trim prefix="(" prefixOverrides="and" suffix=")">
  39. <foreach collection="criteria.criteria" item="criterion">
  40. <choose>
  41. <when test="criterion.noValue">
  42. and ${criterion.condition}
  43. </when>
  44. <when test="criterion.singleValue">
  45. and ${criterion.condition} #{criterion.value}
  46. </when>
  47. <when test="criterion.betweenValue">
  48. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  49. </when>
  50. <when test="criterion.listValue">
  51. and ${criterion.condition}
  52. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  53. #{listItem}
  54. </foreach>
  55. </when>
  56. </choose>
  57. </foreach>
  58. </trim>
  59. </if>
  60. </foreach>
  61. </where>
  62. </sql>
  63. <sql id="Update_By_Example_Where_Clause">
  64. <!--
  65. WARNING - @mbg.generated
  66. This element is automatically generated by MyBatis Generator, do not modify.
  67. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  68. -->
  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. <!--
  99. WARNING - @mbg.generated
  100. This element is automatically generated by MyBatis Generator, do not modify.
  101. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  102. -->
  103. id, tid, company_name, unit_price, quantity, total_amount, material, urgent, audit,
  104. assets, income, remarks, create_time, cid, party_amount, type, patent_name_type,
  105. official_amount
  106. </sql>
  107. <select id="selectByExample" parameterType="com.goafanti.common.model.ThirdPartyCompanyExample" resultMap="BaseResultMap">
  108. <!--
  109. WARNING - @mbg.generated
  110. This element is automatically generated by MyBatis Generator, do not modify.
  111. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  112. -->
  113. select
  114. <if test="distinct">
  115. distinct
  116. </if>
  117. <include refid="Base_Column_List" />
  118. from third_party_company
  119. <if test="_parameter != null">
  120. <include refid="Example_Where_Clause" />
  121. </if>
  122. <if test="orderByClause != null">
  123. order by ${orderByClause}
  124. </if>
  125. </select>
  126. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  127. <!--
  128. WARNING - @mbg.generated
  129. This element is automatically generated by MyBatis Generator, do not modify.
  130. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  131. -->
  132. select
  133. <include refid="Base_Column_List" />
  134. from third_party_company
  135. where id = #{id,jdbcType=INTEGER}
  136. </select>
  137. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  142. -->
  143. delete from third_party_company
  144. where id = #{id,jdbcType=INTEGER}
  145. </delete>
  146. <delete id="deleteByExample" parameterType="com.goafanti.common.model.ThirdPartyCompanyExample">
  147. <!--
  148. WARNING - @mbg.generated
  149. This element is automatically generated by MyBatis Generator, do not modify.
  150. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  151. -->
  152. delete from third_party_company
  153. <if test="_parameter != null">
  154. <include refid="Example_Where_Clause" />
  155. </if>
  156. </delete>
  157. <insert id="insert" parameterType="com.goafanti.common.model.ThirdPartyCompany">
  158. <!--
  159. WARNING - @mbg.generated
  160. This element is automatically generated by MyBatis Generator, do not modify.
  161. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  162. -->
  163. insert into third_party_company (id, tid, company_name,
  164. unit_price, quantity, total_amount,
  165. material, urgent, audit,
  166. assets, income, remarks,
  167. create_time, cid, party_amount,
  168. type, patent_name_type, official_amount
  169. )
  170. values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR},
  171. #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
  172. #{material,jdbcType=INTEGER}, #{urgent,jdbcType=INTEGER}, #{audit,jdbcType=INTEGER},
  173. #{assets,jdbcType=VARCHAR}, #{income,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
  174. #{createTime,jdbcType=TIMESTAMP}, #{cid,jdbcType=INTEGER}, #{partyAmount,jdbcType=DECIMAL},
  175. #{type,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER}, #{officialAmount,jdbcType=DECIMAL}
  176. )
  177. </insert>
  178. <insert id="insertSelective" parameterType="com.goafanti.common.model.ThirdPartyCompany">
  179. <!--
  180. WARNING - @mbg.generated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  183. -->
  184. insert into third_party_company
  185. <trim prefix="(" suffix=")" suffixOverrides=",">
  186. <if test="id != null">
  187. id,
  188. </if>
  189. <if test="tid != null">
  190. tid,
  191. </if>
  192. <if test="companyName != null">
  193. company_name,
  194. </if>
  195. <if test="unitPrice != null">
  196. unit_price,
  197. </if>
  198. <if test="quantity != null">
  199. quantity,
  200. </if>
  201. <if test="totalAmount != null">
  202. total_amount,
  203. </if>
  204. <if test="material != null">
  205. material,
  206. </if>
  207. <if test="urgent != null">
  208. urgent,
  209. </if>
  210. <if test="audit != null">
  211. audit,
  212. </if>
  213. <if test="assets != null">
  214. assets,
  215. </if>
  216. <if test="income != null">
  217. income,
  218. </if>
  219. <if test="remarks != null">
  220. remarks,
  221. </if>
  222. <if test="createTime != null">
  223. create_time,
  224. </if>
  225. <if test="cid != null">
  226. cid,
  227. </if>
  228. <if test="partyAmount != null">
  229. party_amount,
  230. </if>
  231. <if test="type != null">
  232. type,
  233. </if>
  234. <if test="patentNameType != null">
  235. patent_name_type,
  236. </if>
  237. <if test="officialAmount != null">
  238. official_amount,
  239. </if>
  240. </trim>
  241. <trim prefix="values (" suffix=")" suffixOverrides=",">
  242. <if test="id != null">
  243. #{id,jdbcType=INTEGER},
  244. </if>
  245. <if test="tid != null">
  246. #{tid,jdbcType=INTEGER},
  247. </if>
  248. <if test="companyName != null">
  249. #{companyName,jdbcType=VARCHAR},
  250. </if>
  251. <if test="unitPrice != null">
  252. #{unitPrice,jdbcType=DECIMAL},
  253. </if>
  254. <if test="quantity != null">
  255. #{quantity,jdbcType=INTEGER},
  256. </if>
  257. <if test="totalAmount != null">
  258. #{totalAmount,jdbcType=DECIMAL},
  259. </if>
  260. <if test="material != null">
  261. #{material,jdbcType=INTEGER},
  262. </if>
  263. <if test="urgent != null">
  264. #{urgent,jdbcType=INTEGER},
  265. </if>
  266. <if test="audit != null">
  267. #{audit,jdbcType=INTEGER},
  268. </if>
  269. <if test="assets != null">
  270. #{assets,jdbcType=VARCHAR},
  271. </if>
  272. <if test="income != null">
  273. #{income,jdbcType=VARCHAR},
  274. </if>
  275. <if test="remarks != null">
  276. #{remarks,jdbcType=VARCHAR},
  277. </if>
  278. <if test="createTime != null">
  279. #{createTime,jdbcType=TIMESTAMP},
  280. </if>
  281. <if test="cid != null">
  282. #{cid,jdbcType=INTEGER},
  283. </if>
  284. <if test="partyAmount != null">
  285. #{partyAmount,jdbcType=DECIMAL},
  286. </if>
  287. <if test="type != null">
  288. #{type,jdbcType=INTEGER},
  289. </if>
  290. <if test="patentNameType != null">
  291. #{patentNameType,jdbcType=INTEGER},
  292. </if>
  293. <if test="officialAmount != null">
  294. #{officialAmount,jdbcType=DECIMAL},
  295. </if>
  296. </trim>
  297. </insert>
  298. <select id="countByExample" parameterType="com.goafanti.common.model.ThirdPartyCompanyExample" resultType="java.lang.Long">
  299. <!--
  300. WARNING - @mbg.generated
  301. This element is automatically generated by MyBatis Generator, do not modify.
  302. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  303. -->
  304. select count(*) from third_party_company
  305. <if test="_parameter != null">
  306. <include refid="Example_Where_Clause" />
  307. </if>
  308. </select>
  309. <update id="updateByExampleSelective" parameterType="map">
  310. <!--
  311. WARNING - @mbg.generated
  312. This element is automatically generated by MyBatis Generator, do not modify.
  313. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  314. -->
  315. update third_party_company
  316. <set>
  317. <if test="record.id != null">
  318. id = #{record.id,jdbcType=INTEGER},
  319. </if>
  320. <if test="record.tid != null">
  321. tid = #{record.tid,jdbcType=INTEGER},
  322. </if>
  323. <if test="record.companyName != null">
  324. company_name = #{record.companyName,jdbcType=VARCHAR},
  325. </if>
  326. <if test="record.unitPrice != null">
  327. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  328. </if>
  329. <if test="record.quantity != null">
  330. quantity = #{record.quantity,jdbcType=INTEGER},
  331. </if>
  332. <if test="record.totalAmount != null">
  333. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  334. </if>
  335. <if test="record.material != null">
  336. material = #{record.material,jdbcType=INTEGER},
  337. </if>
  338. <if test="record.urgent != null">
  339. urgent = #{record.urgent,jdbcType=INTEGER},
  340. </if>
  341. <if test="record.audit != null">
  342. audit = #{record.audit,jdbcType=INTEGER},
  343. </if>
  344. <if test="record.assets != null">
  345. assets = #{record.assets,jdbcType=VARCHAR},
  346. </if>
  347. <if test="record.income != null">
  348. income = #{record.income,jdbcType=VARCHAR},
  349. </if>
  350. <if test="record.remarks != null">
  351. remarks = #{record.remarks,jdbcType=VARCHAR},
  352. </if>
  353. <if test="record.createTime != null">
  354. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  355. </if>
  356. <if test="record.cid != null">
  357. cid = #{record.cid,jdbcType=INTEGER},
  358. </if>
  359. <if test="record.partyAmount != null">
  360. party_amount = #{record.partyAmount,jdbcType=DECIMAL},
  361. </if>
  362. <if test="record.type != null">
  363. type = #{record.type,jdbcType=INTEGER},
  364. </if>
  365. <if test="record.patentNameType != null">
  366. patent_name_type = #{record.patentNameType,jdbcType=INTEGER},
  367. </if>
  368. <if test="record.officialAmount != null">
  369. official_amount = #{record.officialAmount,jdbcType=DECIMAL},
  370. </if>
  371. </set>
  372. <if test="_parameter != null">
  373. <include refid="Update_By_Example_Where_Clause" />
  374. </if>
  375. </update>
  376. <update id="updateByExample" parameterType="map">
  377. <!--
  378. WARNING - @mbg.generated
  379. This element is automatically generated by MyBatis Generator, do not modify.
  380. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  381. -->
  382. update third_party_company
  383. set id = #{record.id,jdbcType=INTEGER},
  384. tid = #{record.tid,jdbcType=INTEGER},
  385. company_name = #{record.companyName,jdbcType=VARCHAR},
  386. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  387. quantity = #{record.quantity,jdbcType=INTEGER},
  388. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  389. material = #{record.material,jdbcType=INTEGER},
  390. urgent = #{record.urgent,jdbcType=INTEGER},
  391. audit = #{record.audit,jdbcType=INTEGER},
  392. assets = #{record.assets,jdbcType=VARCHAR},
  393. income = #{record.income,jdbcType=VARCHAR},
  394. remarks = #{record.remarks,jdbcType=VARCHAR},
  395. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  396. cid = #{record.cid,jdbcType=INTEGER},
  397. party_amount = #{record.partyAmount,jdbcType=DECIMAL},
  398. type = #{record.type,jdbcType=INTEGER},
  399. patent_name_type = #{record.patentNameType,jdbcType=INTEGER},
  400. official_amount = #{record.officialAmount,jdbcType=DECIMAL}
  401. <if test="_parameter != null">
  402. <include refid="Update_By_Example_Where_Clause" />
  403. </if>
  404. </update>
  405. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ThirdPartyCompany">
  406. <!--
  407. WARNING - @mbg.generated
  408. This element is automatically generated by MyBatis Generator, do not modify.
  409. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  410. -->
  411. update third_party_company
  412. <set>
  413. <if test="tid != null">
  414. tid = #{tid,jdbcType=INTEGER},
  415. </if>
  416. <if test="companyName != null">
  417. company_name = #{companyName,jdbcType=VARCHAR},
  418. </if>
  419. <if test="unitPrice != null">
  420. unit_price = #{unitPrice,jdbcType=DECIMAL},
  421. </if>
  422. <if test="quantity != null">
  423. quantity = #{quantity,jdbcType=INTEGER},
  424. </if>
  425. <if test="totalAmount != null">
  426. total_amount = #{totalAmount,jdbcType=DECIMAL},
  427. </if>
  428. <if test="material != null">
  429. material = #{material,jdbcType=INTEGER},
  430. </if>
  431. <if test="urgent != null">
  432. urgent = #{urgent,jdbcType=INTEGER},
  433. </if>
  434. <if test="audit != null">
  435. audit = #{audit,jdbcType=INTEGER},
  436. </if>
  437. <if test="assets != null">
  438. assets = #{assets,jdbcType=VARCHAR},
  439. </if>
  440. <if test="income != null">
  441. income = #{income,jdbcType=VARCHAR},
  442. </if>
  443. <if test="remarks != null">
  444. remarks = #{remarks,jdbcType=VARCHAR},
  445. </if>
  446. <if test="createTime != null">
  447. create_time = #{createTime,jdbcType=TIMESTAMP},
  448. </if>
  449. <if test="cid != null">
  450. cid = #{cid,jdbcType=INTEGER},
  451. </if>
  452. <if test="partyAmount != null">
  453. party_amount = #{partyAmount,jdbcType=DECIMAL},
  454. </if>
  455. <if test="type != null">
  456. type = #{type,jdbcType=INTEGER},
  457. </if>
  458. <if test="patentNameType != null">
  459. patent_name_type = #{patentNameType,jdbcType=INTEGER},
  460. </if>
  461. <if test="officialAmount != null">
  462. official_amount = #{officialAmount,jdbcType=DECIMAL},
  463. </if>
  464. </set>
  465. where id = #{id,jdbcType=INTEGER}
  466. </update>
  467. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ThirdPartyCompany">
  468. <!--
  469. WARNING - @mbg.generated
  470. This element is automatically generated by MyBatis Generator, do not modify.
  471. This element was generated on Tue Sep 15 15:56:36 CST 2020.
  472. -->
  473. update third_party_company
  474. set tid = #{tid,jdbcType=INTEGER},
  475. company_name = #{companyName,jdbcType=VARCHAR},
  476. unit_price = #{unitPrice,jdbcType=DECIMAL},
  477. quantity = #{quantity,jdbcType=INTEGER},
  478. total_amount = #{totalAmount,jdbcType=DECIMAL},
  479. material = #{material,jdbcType=INTEGER},
  480. urgent = #{urgent,jdbcType=INTEGER},
  481. audit = #{audit,jdbcType=INTEGER},
  482. assets = #{assets,jdbcType=VARCHAR},
  483. income = #{income,jdbcType=VARCHAR},
  484. remarks = #{remarks,jdbcType=VARCHAR},
  485. create_time = #{createTime,jdbcType=TIMESTAMP},
  486. cid = #{cid,jdbcType=INTEGER},
  487. party_amount = #{partyAmount,jdbcType=DECIMAL},
  488. type = #{type,jdbcType=INTEGER},
  489. patent_name_type = #{patentNameType,jdbcType=INTEGER},
  490. official_amount = #{officialAmount,jdbcType=DECIMAL}
  491. where id = #{id,jdbcType=INTEGER}
  492. </update>
  493. <select id="selectByTid" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
  494. select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
  495. a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
  496. a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount
  497. from third_party_company a left join t_order_task b on a.tid=b.id left join official_fee_price op on a.patent_name_type=op.`type`
  498. where tid= #{tid}
  499. </select>
  500. <select id="selectByIdPuls" resultType="com.goafanti.organization.bo.OutThirdPartyCompany">
  501. select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
  502. a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
  503. a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount
  504. from third_party_company a left join t_order_task b on a.tid=b.id left join official_fee_price op on a.patent_name_type=op.`type`
  505. where a.id= #{id}
  506. </select>
  507. <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">
  508. select a.id, c.contract_no contractNo,b.order_no orderNo,d.buyer_name userName, d.dep_name depName,f.party_amount costAmount,
  509. a.choose_type chooseType,a.payment_amount paymentAmount,a.application_amount applicationAmount,a.tid,a.company_name companyName,
  510. date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTime,a.aname,d.finance_name financeName,b.cname,
  511. b.commodity_name pname,b.project_status projectStatus,a.status,bp.`type` projectType
  512. from t_order_payment a left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
  513. left join business_project bp on b.commodity_id=bp.id
  514. left join t_order_mid d on b.order_no=d.order_no left join t_task_mid f on a.tid=f.tid
  515. where 1=1
  516. <if test="lvl==0">
  517. and c.finance_id= #{aid}
  518. </if>
  519. <if test="lvl==1">
  520. and c.finance_id in (select id from admin where superior_id= #{aid} )
  521. </if>
  522. <if test="lvl==3">
  523. and b.task_receiver= #{aid}
  524. </if>
  525. <if test="contractNo !=null">
  526. and c.contract_no like concat('%', #{contractNo},'%')
  527. </if>
  528. <if test="orderNo !=null">
  529. and c.order_no like concat('%', #{orderNo} ,'%')
  530. </if>
  531. <if test="userName !=null">
  532. and d.buyer_name like concat('%', #{userName},'%')
  533. </if>
  534. <if test="depId !=null">
  535. and c.order_dep= #{depId}
  536. </if>
  537. <if test="aname !=null">
  538. and a.aname like concat('%',#{aname},'%')
  539. </if>
  540. <if test="financeName !=null">
  541. and d.finance_name like concat('%',#{financeName},'%')
  542. </if>
  543. <if test="cname !=null">
  544. and b.cname like concat('%',#{cname},'%')
  545. </if>
  546. <if test="pname !=null">
  547. and b.commodity_name like concat('%',#{pname},'%')
  548. </if>
  549. <if test="status !=null">
  550. and a.status= #{status}
  551. </if>
  552. order by a.status,a.create_time desc
  553. <if test="page_sql!=null">
  554. ${page_sql}
  555. </if>
  556. </select>
  557. <select id="selectPaymentCount" resultType="java.lang.Integer">
  558. select count(*)
  559. from t_order_payment a left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
  560. left join t_order_mid d on b.order_no=d.order_no
  561. where 1=1
  562. <if test="lvl==0">
  563. and c.finance_id= #{aid}
  564. </if>
  565. <if test="lvl==1">
  566. and c.finance_id in (select id from admin where superior_id= #{aid} )
  567. </if>
  568. <if test="lvl==3">
  569. and b.task_receiver= #{aid}
  570. </if>
  571. <if test="contractNo !=null">
  572. and c.contract_no like concat('%', #{contractNo},'%')
  573. </if>
  574. <if test="orderNo !=null">
  575. and c.order_no like concat('%', #{orderNo} ,'%')
  576. </if>
  577. <if test="userName !=null">
  578. and d.buyer_name like concat('%', #{userName},'%')
  579. </if>
  580. <if test="depId !=null">
  581. and c.order_dep= #{depId}
  582. </if>
  583. <if test="aname !=null">
  584. and a.aname like concat('%',#{aname},'%')
  585. </if>
  586. <if test="financeName !=null">
  587. and d.finance_name like concat('%',#{financeName},'%')
  588. </if>
  589. <if test="cname !=null">
  590. and b.cname like concat('%',#{cname},'%')
  591. </if>
  592. <if test="pname !=null">
  593. and b.commodity_name like concat('%',#{pname},'%')
  594. </if>
  595. <if test="status !=null">
  596. and a.status= #{status}
  597. </if>
  598. </select>
  599. <select id="selectNodeList" resultType="com.goafanti.organization.bo.outNodeList">
  600. select c.contract_no contractNo,c.order_no orderNo,d.buyer_name userName,
  601. b.cname,b.commodity_name pname,c.order_status orderStatus,b.project_status projectStatus,
  602. b.set_up_amount projectAmount,e.cost_amount costAmount,e.party_amount partyAmount,b.task_receiver,
  603. c.liquidation_status liquidationStatus,a.dun_type dunType,a.project_type projectType,a.tid,
  604. a.total_amount NodeAmount,date_format(a.start_time,'%Y-%m-%d %H:%i:%S')startTime,a.status
  605. from payment_node a
  606. left join t_order_task b on a.tid=b.id
  607. left join t_order_new c on b.order_no=c.order_no
  608. left join t_order_mid d on b.order_no=d.order_no
  609. left join t_task_mid e on b.id=e.tid
  610. where 1=1
  611. <if test="lvl==0">
  612. and b.task_receiver= #{aid}
  613. </if>
  614. <if test="lvl==1">
  615. and c.finance_id= #{aid}
  616. </if>
  617. <if test="lvl==2">
  618. and c.finance_id in (select id from admin where superior_id= #{aid})
  619. </if>
  620. <if test="userName != null">
  621. and d.buyer_name like concat('%',#{userName},'%')
  622. </if>
  623. <if test="contractNo != null">
  624. and c.contract_no like concat('%',#{contractNo},'%')
  625. </if>
  626. <if test="orderNo != null">
  627. and c.order_no like concat('%',#{orderNo},'%')
  628. </if>
  629. <if test="cname !=null">
  630. and b.cname like concat('%',#{cname},'%')
  631. </if>
  632. <if test="pname !=null">
  633. and b.commodity_name like concat('%',#{pname},'%')
  634. </if>
  635. <if test="status !=null">
  636. and a.status= #{status}
  637. </if>
  638. <if test="startTime !=null and endTime != null">
  639. and a.start_time between #{startTime} and #{endTime}
  640. </if>
  641. order by a.status ,a.create_time desc
  642. <if test="page_sql!=null">
  643. ${page_sql}
  644. </if>
  645. </select>
  646. <select id="selectNodeCount" resultType="java.lang.Integer">
  647. select count(*)
  648. from payment_node a
  649. left join t_order_task b on a.tid=b.id
  650. left join t_order_new c on b.order_no=c.order_no
  651. left join t_order_mid d on b.order_no=d.order_no
  652. where 1=1
  653. <if test="lvl==0">
  654. and b.task_receiver= #{aid}
  655. </if>
  656. <if test="lvl==1">
  657. and c.finance_id= #{aid}
  658. </if>
  659. <if test="lvl==2">
  660. and c.finance_id in (select id from admin where superior_id= #{aid})
  661. </if>
  662. <if test="userName != null">
  663. and d.buyer_name like concat('%',#{userName},'%')
  664. </if>
  665. <if test="contractNo != null">
  666. and c.contract_no like concat('%',#{contractNo},'%')
  667. </if>
  668. <if test="orderNo != null">
  669. and c.order_no like concat('%',#{orderNo},'%')
  670. </if>
  671. <if test="cname !=null">
  672. and b.cname like concat('%',#{cname},'%')
  673. </if>
  674. <if test="pname !=null">
  675. and b.commodity_name like concat('%',#{pname},'%')
  676. </if>
  677. <if test="status !=null">
  678. and a.status= #{status}
  679. </if>
  680. <if test="startTime !=null and endTime != null">
  681. and a.start_time between #{startTime} and #{endTime}
  682. </if>
  683. </select>
  684. <select id="softWritingPriceList" resultType="com.goafanti.common.model.SoftWritingPrice">
  685. select a.id,a.cid,b.company_name companyName,a.material,a.unit_price unitPrice,a.urgent,a.remarks,
  686. a.status,date_format(a.create_time,'%Y-%m-%d %H:%i:%s')createTimes
  687. from soft_writing_price a left join company_library b on a.cid=b.id
  688. where 1=1
  689. <if test="s.companyName != null">
  690. and b.company_name like concat('%',#{s.companyName},'%')
  691. </if>
  692. <if test="s.material != null">
  693. and a.material= #{s.material}
  694. </if>
  695. <if test="s.urgent != null">
  696. and a.urgent= #{s.urgent}
  697. </if>
  698. <if test="page_sql!=null">
  699. ${page_sql}
  700. </if>
  701. </select>
  702. <select id="softWritingPriceCount" resultType="java.lang.Integer">
  703. select count(*)
  704. from soft_writing_price a left join company_library b on a.cid=b.id
  705. where 1=1
  706. <if test="s.companyName != null">
  707. and b.company_name like concat('%',#{s.companyName},'%')
  708. </if>
  709. <if test="s.material != null">
  710. and a.material= #{s.material}
  711. </if>
  712. <if test="s.urgent != null">
  713. and a.urgent= #{s.urgent}
  714. </if>
  715. </select>
  716. </mapper>