ThirdPartyCompanyMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  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
  528. left join official_fee_price op on b.patent_type =op.patent_type and a.patent_name_type =op.`type`
  529. where tid= #{tid}
  530. </select>
  531. <!-- <select id="selectByTidPuls" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  532. select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
  533. c.amount officialAmount,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
  534. left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
  535. where a.id= #{tid}
  536. </select> -->
  537. <select id="selectByTidGetListDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  538. select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
  539. c.amount officialAmount,c.proportion85 from t_order_task x left join t_order_task a on x.order_no =a.order_no left join t_order_outsource b on a.id=b.tid
  540. left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
  541. where x.id= #{tid}
  542. </select>
  543. <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">
  544. select a.id, c.contract_no contractNo,b.order_no orderNo,d.buyer_name userName, d.dep_name depName,f.party_amount costAmount,
  545. a.choose_type chooseType,a.payment_amount paymentAmount,a.application_amount applicationAmount,a.tid,a.company_name companyName,
  546. date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTime,a.aname,d.finance_name financeName,b.cname, b.commodity_name pname,
  547. b.project_status projectStatus,a.status,bp.`type` projectType,b.cost_reduction costReduction ,b.official_cost officialCost,c.total_amount totalAmount,
  548. c.settlement_amount settlementAmount,a.process_status processStatus
  549. 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
  550. left join business_project bp on b.commodity_id=bp.id
  551. left join t_order_mid d on b.order_no=d.order_no left join t_task_mid f on a.tid=f.tid
  552. where 1=1 and c.delete_sign in (0,2,3)
  553. <if test="lvl==0">
  554. and d.finance_id= #{aid}
  555. </if>
  556. <if test="lvl==1">
  557. and d.finance_id in (select id from admin where superior_id= #{aid} )
  558. </if>
  559. <if test="lvl==3">
  560. and b.task_receiver= #{aid}
  561. </if>
  562. <if test="lvl==4">
  563. and a.choose_type =2
  564. </if>
  565. <if test="contractNo !=null">
  566. and c.contract_no like concat('%', #{contractNo},'%')
  567. </if>
  568. <if test="orderNo !=null">
  569. and c.order_no like concat('%', #{orderNo} ,'%')
  570. </if>
  571. <if test="userName !=null">
  572. and d.buyer_name like concat('%', #{userName},'%')
  573. </if>
  574. <if test="deps !=null">
  575. and c.order_dep in
  576. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  577. #{depId}
  578. </foreach>
  579. </if>
  580. <if test="aname !=null">
  581. and a.aname like concat('%',#{aname},'%')
  582. </if>
  583. <if test="financeName !=null">
  584. and d.finance_name like concat('%',#{financeName},'%')
  585. </if>
  586. <if test="cname !=null">
  587. and b.cname like concat('%',#{cname},'%')
  588. </if>
  589. <if test="pname !=null">
  590. and b.commodity_name like concat('%',#{pname},'%')
  591. </if>
  592. <if test="status !=null">
  593. and a.status= #{status}
  594. </if>
  595. <if test="thchId != null">
  596. and b.task_receiver = #{thchId,jdbcType=VARCHAR}
  597. </if>
  598. order by a.status,a.create_time desc
  599. <if test="lvl==4">
  600. ,a.process_status
  601. </if>
  602. <if test="page_sql!=null">
  603. ${page_sql}
  604. </if>
  605. </select>
  606. <select id="selectPaymentCount" resultType="java.lang.Integer">
  607. select count(*)
  608. 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
  609. left join t_order_mid d on b.order_no=d.order_no
  610. where 1=1 and c.delete_sign in (0,2,3)
  611. <if test="lvl==0">
  612. and d.finance_id= #{aid}
  613. </if>
  614. <if test="lvl==1">
  615. and d.finance_id in (select id from admin where superior_id= #{aid} )
  616. </if>
  617. <if test="lvl==3">
  618. and b.task_receiver= #{aid}
  619. </if>
  620. <if test="lvl==4">
  621. and choose_type =2
  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="userName !=null">
  630. and d.buyer_name like concat('%', #{userName},'%')
  631. </if>
  632. <if test="deps !=null">
  633. and c.order_dep in
  634. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  635. #{depId}
  636. </foreach>
  637. </if>
  638. <if test="aname !=null">
  639. and a.aname like concat('%',#{aname},'%')
  640. </if>
  641. <if test="financeName !=null">
  642. and d.finance_name like concat('%',#{financeName},'%')
  643. </if>
  644. <if test="cname !=null">
  645. and b.cname like concat('%',#{cname},'%')
  646. </if>
  647. <if test="pname !=null">
  648. and b.commodity_name like concat('%',#{pname},'%')
  649. </if>
  650. <if test="status !=null">
  651. and a.status= #{status}
  652. </if>
  653. <if test="thchId != null">
  654. and b.task_receiver = #{thchId,jdbcType=VARCHAR}
  655. </if>
  656. </select>
  657. <select id="selectNodeList" resultType="com.goafanti.organization.bo.outNodeList">
  658. select c.contract_no contractNo,c.order_no orderNo,d.buyer_name userName,
  659. b.cname,b.commodity_name pname,c.order_status orderStatus,b.project_status projectStatus,
  660. b.set_up_amount projectAmount,e.cost_amount costAmount,e.party_amount partyAmount,b.task_receiver,
  661. c.liquidation_status liquidationStatus,a.dun_type dunType,a.project_type projectType,a.tid,
  662. a.total_amount NodeAmount,date_format(a.start_time,'%Y-%m-%d %H:%i:%S')startTime,a.status
  663. from payment_node a
  664. left join t_order_task b on a.tid=b.id
  665. left join t_order_new c on b.order_no=c.order_no
  666. left join t_order_mid d on b.order_no=d.order_no
  667. left join t_task_mid e on b.id=e.tid
  668. where 1=1
  669. <if test="lvl==0">
  670. and b.task_receiver= #{aid}
  671. </if>
  672. <if test="lvl==1">
  673. and c.finance_id= #{aid}
  674. </if>
  675. <if test="lvl==2">
  676. and c.finance_id in (select id from admin where superior_id= #{aid})
  677. </if>
  678. <if test="userName != null">
  679. and d.buyer_name like concat('%',#{userName},'%')
  680. </if>
  681. <if test="contractNo != null">
  682. and c.contract_no like concat('%',#{contractNo},'%')
  683. </if>
  684. <if test="orderNo != null">
  685. and c.order_no like concat('%',#{orderNo},'%')
  686. </if>
  687. <if test="cname !=null">
  688. and b.cname like concat('%',#{cname},'%')
  689. </if>
  690. <if test="pname !=null">
  691. and b.commodity_name like concat('%',#{pname},'%')
  692. </if>
  693. <if test="status !=null">
  694. and a.status= #{status}
  695. </if>
  696. <if test="startTime !=null and endTime != null">
  697. and a.start_time between #{startTime} and #{endTime}
  698. </if>
  699. order by a.status ,a.create_time desc
  700. <if test="page_sql!=null">
  701. ${page_sql}
  702. </if>
  703. </select>
  704. <select id="selectNodeCount" resultType="java.lang.Integer">
  705. select count(*)
  706. from payment_node a
  707. left join t_order_task b on a.tid=b.id
  708. left join t_order_new c on b.order_no=c.order_no
  709. left join t_order_mid d on b.order_no=d.order_no
  710. where 1=1
  711. <if test="lvl==0">
  712. and b.task_receiver= #{aid}
  713. </if>
  714. <if test="lvl==1">
  715. and c.finance_id= #{aid}
  716. </if>
  717. <if test="lvl==2">
  718. and c.finance_id in (select id from admin where superior_id= #{aid})
  719. </if>
  720. <if test="userName != null">
  721. and d.buyer_name like concat('%',#{userName},'%')
  722. </if>
  723. <if test="contractNo != null">
  724. and c.contract_no like concat('%',#{contractNo},'%')
  725. </if>
  726. <if test="orderNo != null">
  727. and c.order_no like concat('%',#{orderNo},'%')
  728. </if>
  729. <if test="cname !=null">
  730. and b.cname like concat('%',#{cname},'%')
  731. </if>
  732. <if test="pname !=null">
  733. and b.commodity_name like concat('%',#{pname},'%')
  734. </if>
  735. <if test="status !=null">
  736. and a.status= #{status}
  737. </if>
  738. <if test="startTime !=null and endTime != null">
  739. and a.start_time between #{startTime} and #{endTime}
  740. </if>
  741. </select>
  742. <select id="softWritingPriceList" resultType="com.goafanti.common.model.SoftWritingPrice">
  743. select a.id,a.cid,b.company_name companyName,a.material,a.unit_price unitPrice,a.urgent,a.remarks,
  744. a.status,date_format(a.create_time,'%Y-%m-%d %H:%i:%s')createTimes
  745. from soft_writing_price a left join company_library b on a.cid=b.id
  746. where 1=1
  747. <if test="s.companyName != null">
  748. and b.company_name like concat('%',#{s.companyName},'%')
  749. </if>
  750. <if test="s.material != null">
  751. and a.material= #{s.material}
  752. </if>
  753. <if test="s.urgent != null">
  754. and a.urgent= #{s.urgent}
  755. </if>
  756. <if test="page_sql!=null">
  757. ${page_sql}
  758. </if>
  759. </select>
  760. <select id="softWritingPriceCount" resultType="java.lang.Integer">
  761. select count(*)
  762. from soft_writing_price a left join company_library b on a.cid=b.id
  763. where 1=1
  764. <if test="s.companyName != null">
  765. and b.company_name like concat('%',#{s.companyName},'%')
  766. </if>
  767. <if test="s.material != null">
  768. and a.material= #{s.material}
  769. </if>
  770. <if test="s.urgent != null">
  771. and a.urgent= #{s.urgent}
  772. </if>
  773. </select>
  774. <select id="selectListOfficialFeePrice" resultType="com.goafanti.common.model.OfficialFeePrice">
  775. select id,type,patent_type patentType,amount,proportion85,remarks,date_format(create_time, '%Y-%m-%d %H:%i:%S') createTimes
  776. from official_fee_price where 1=1
  777. <if test="type != null">
  778. and type= #{type}
  779. </if>
  780. <if test="patentType != null">
  781. and patent_type= #{patentType}
  782. </if>
  783. order by patent_type
  784. <if test="page_sql!=null">
  785. ${page_sql}
  786. </if>
  787. </select>
  788. <select id="countListOfficialFeePrice" resultType="java.lang.Integer" >
  789. select count(*)
  790. from official_fee_price where 1=1
  791. <if test="type != null">
  792. and type= #{type}
  793. </if>
  794. <if test="patentType != null">
  795. and patent_type= #{patentType}
  796. </if>
  797. </select>
  798. <delete id="deleteByTid" >
  799. delete from third_party_company
  800. where tid= #{tid}
  801. </delete>
  802. </mapper>