ThirdPartyCompanyMapper.xml 27 KB

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