TChangeTaskMapper.xml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  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.TChangeTaskMapper">
  4. <resultMap type="com.goafanti.common.model.TChangeTask" id="TChangeTaskMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="tid" column="tid" jdbcType="INTEGER"/>
  7. <result property="cid" column="cid" jdbcType="INTEGER"/>
  8. <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
  9. <result property="main" column="main" jdbcType="INTEGER"/>
  10. <result property="commodityId" column="commodity_id" jdbcType="VARCHAR"/>
  11. <result property="commodityName" column="commodity_name" jdbcType="VARCHAR"/>
  12. <result property="commodityQuantity" column="commodity_quantity" jdbcType="INTEGER"/>
  13. <result property="commodityPrice" column="commodity_price" jdbcType="VARCHAR"/>
  14. <result property="taskComment" column="task_comment" jdbcType="VARCHAR"/>
  15. <result property="type" column="type" jdbcType="INTEGER"/>
  16. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  17. <result property="splitStatus" column="split_status" jdbcType="INTEGER"/>
  18. <result property="splitSuper" column="split_super" jdbcType="INTEGER"/>
  19. <result property="receiverName" column="receiver_name" jdbcType="VARCHAR"/>
  20. <result property="officialCost" column="official_cost" jdbcType="INTEGER"/>
  21. <result property="costReduction" column="cost_reduction" jdbcType="INTEGER"/>
  22. <result property="serviceLife" column="service_life" jdbcType="VARCHAR"/>
  23. <result property="serviceYear" column="service_year" jdbcType="VARCHAR"/>
  24. <result property="yearSum" column="year_sum" jdbcType="INTEGER"/>
  25. <result property="contractTerm" column="contract_term" jdbcType="VARCHAR"/>
  26. <result property="declarationBatch" column="declaration_batch" jdbcType="INTEGER"/>
  27. <result property="patentType" column="patent_type" jdbcType="INTEGER"/>
  28. <result property="changeSplitSuper" column="change_split_super" jdbcType="INTEGER"/>
  29. <result property="lastYear" column="last_year" jdbcType="VARCHAR"/>
  30. <result property="lastYearCapital" column="last_year_capital" jdbcType="VARCHAR"/>
  31. <result property="lastYearIncome" column="last_year_income" jdbcType="VARCHAR"/>
  32. <result property="htMember" column="ht_member" jdbcType="INTEGER"/>
  33. <result property="additionalDeduction" column="additional_deduction" jdbcType="INTEGER"/>
  34. <result property="rdAwardsubsidy" column="rd_awardsubsidy" jdbcType="INTEGER"/>
  35. <result property="technologyProjectType" column="technology_project_Type" jdbcType="INTEGER"/>
  36. <result property="ordinaryRisk" column="ordinary_risk" jdbcType="INTEGER"/>
  37. <result property="days" column="days" jdbcType="INTEGER"/>
  38. <result property="scheme" column="scheme" jdbcType="INTEGER"/>
  39. </resultMap>
  40. <sql id="TChangeTaskAllSql">
  41. id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type, change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction, rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme
  42. </sql>
  43. <!--查询单个-->
  44. <select id="selectById" resultMap="TChangeTaskMap">
  45. select
  46. <include refid="TChangeTaskAllSql"/>
  47. from t_change_task
  48. where id = #{id}
  49. </select>
  50. <!--新增所有列-->
  51. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  52. insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
  53. commodity_price, task_comment, type, create_time, split_status, split_super,
  54. receiver_name, official_cost, cost_reduction, service_life, service_year, year_sum,
  55. contract_term, declaration_batch, patent_type, change_split_super, last_year,
  56. last_year_capital, last_year_income, ht_member, additional_deduction, rd_awardsubsidy,
  57. technology_project_Type, ordinary_risk, days, scheme)
  58. values (#{tid}, #{cid}, #{orderNo}, #{main}, #{commodityId}, #{commodityName}, #{commodityQuantity},
  59. #{commodityPrice}, #{taskComment}, #{type}, #{createTime}, #{splitStatus}, #{splitSuper},
  60. #{receiverName}, #{officialCost}, #{costReduction}, #{serviceLife}, #{serviceYear}, #{yearSum},
  61. #{contractTerm}, #{declarationBatch}, #{patentType}, #{changeSplitSuper}, #{lastYear},
  62. #{lastYearCapital}, #{lastYearIncome}, #{htMember}, #{additionalDeduction}, #{rdAwardsubsidy},
  63. #{technologyProjectType}, #{ordinaryRisk}, #{days}, #{scheme})
  64. </insert>
  65. <insert id="insertBatch">
  66. insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
  67. commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost,
  68. cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type,
  69. change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction,
  70. rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme)
  71. values
  72. <foreach collection="entities" item="entity" separator=",">
  73. (#{entity.tid}, #{entity.cid}, #{entity.orderNo}, #{entity.main}, #{entity.commodityId},
  74. #{entity.commodityName}, #{entity.commodityQuantity}, #{entity.commodityPrice}, #{entity.taskComment},
  75. #{entity.type}, #{entity.createTime}, #{entity.splitStatus}, #{entity.splitSuper}, #{entity.receiverName},
  76. #{entity.officialCost}, #{entity.costReduction}, #{entity.serviceLife}, #{entity.serviceYear},
  77. #{entity.yearSum}, #{entity.contractTerm}, #{entity.declarationBatch}, #{entity.patentType},
  78. #{entity.changeSplitSuper}, #{entity.lastYear}, #{entity.lastYearCapital}, #{entity.lastYearIncome},
  79. #{entity.htMember}, #{entity.additionalDeduction}, #{entity.rdAwardsubsidy},
  80. #{entity.technologyProjectType}, #{entity.ordinaryRisk}, #{entity.days}, #{entity.scheme})
  81. </foreach>
  82. </insert>
  83. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  84. insert into t_change_task(tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity,
  85. commodity_price, task_comment, type, create_time, split_status, split_super, receiver_name, official_cost,
  86. cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch, patent_type,
  87. change_split_super, last_year, last_year_capital, last_year_income, ht_member, additional_deduction,
  88. rd_awardsubsidy, technology_project_Type, ordinary_risk, days, scheme)
  89. values
  90. <foreach collection="entities" item="entity" separator=",">
  91. (#{entity.tid}, #{entity.cid}, #{entity.orderNo}, #{entity.main}, #{entity.commodityId},
  92. #{entity.commodityName}, #{entity.commodityQuantity}, #{entity.commodityPrice}, #{entity.taskComment},
  93. #{entity.type}, #{entity.createTime}, #{entity.splitStatus}, #{entity.splitSuper}, #{entity.receiverName},
  94. #{entity.officialCost}, #{entity.costReduction}, #{entity.serviceLife}, #{entity.serviceYear},
  95. #{entity.yearSum}, #{entity.contractTerm}, #{entity.declarationBatch}, #{entity.patentType},
  96. #{entity.changeSplitSuper}, #{entity.lastYear}, #{entity.lastYearCapital}, #{entity.lastYearIncome},
  97. #{entity.htMember}, #{entity.additionalDeduction}, #{entity.rdAwardsubsidy},
  98. #{entity.technologyProjectType}, #{entity.ordinaryRisk}, #{entity.days}, #{entity.scheme})
  99. </foreach>
  100. on duplicate key update
  101. tid = values(tid),
  102. cid = values(cid),
  103. order_no = values(order_no),
  104. main = values(main),
  105. commodity_id = values(commodity_id),
  106. commodity_name = values(commodity_name),
  107. commodity_quantity = values(commodity_quantity),
  108. commodity_price = values(commodity_price),
  109. task_comment = values(task_comment),
  110. type = values(type),
  111. create_time = values(create_time),
  112. split_status = values(split_status),
  113. split_super = values(split_super),
  114. receiver_name = values(receiver_name),
  115. official_cost = values(official_cost),
  116. cost_reduction = values(cost_reduction),
  117. service_life = values(service_life),
  118. service_year = values(service_year),
  119. year_sum = values(year_sum),
  120. contract_term = values(contract_term),
  121. declaration_batch = values(declaration_batch),
  122. patent_type = values(patent_type),
  123. change_split_super = values(change_split_super),
  124. last_year = values(last_year),
  125. last_year_capital = values(last_year_capital),
  126. last_year_income = values(last_year_income),
  127. ht_member = values(ht_member),
  128. additional_deduction = values(additional_deduction),
  129. rd_awardsubsidy = values(rd_awardsubsidy),
  130. technology_project_Type = values(technology_project_Type),
  131. ordinary_risk = values(ordinary_risk),
  132. days = values(days),
  133. scheme = values(scheme)
  134. </insert>
  135. <!--通过主键修改数据-->
  136. <update id="update">
  137. update t_change_task
  138. <set>
  139. <if test="tid != null">
  140. tid = #{tid},
  141. </if>
  142. <if test="cid != null">
  143. cid = #{cid},
  144. </if>
  145. <if test="orderNo != null and orderNo != ''">
  146. order_no = #{orderNo},
  147. </if>
  148. <if test="main != null">
  149. main = #{main},
  150. </if>
  151. <if test="commodityId != null and commodityId != ''">
  152. commodity_id = #{commodityId},
  153. </if>
  154. <if test="commodityName != null and commodityName != ''">
  155. commodity_name = #{commodityName},
  156. </if>
  157. <if test="commodityQuantity != null">
  158. commodity_quantity = #{commodityQuantity},
  159. </if>
  160. <if test="commodityPrice != null">
  161. commodity_price = #{commodityPrice},
  162. </if>
  163. <if test="taskComment != null and taskComment != ''">
  164. task_comment = #{taskComment},
  165. </if>
  166. <if test="type != null">
  167. type = #{type},
  168. </if>
  169. <if test="createTime != null">
  170. create_time = #{createTime},
  171. </if>
  172. <if test="splitStatus != null">
  173. split_status = #{splitStatus},
  174. </if>
  175. <if test="splitSuper != null">
  176. split_super = #{splitSuper},
  177. </if>
  178. <if test="receiverName != null and receiverName != ''">
  179. receiver_name = #{receiverName},
  180. </if>
  181. <if test="officialCost != null">
  182. official_cost = #{officialCost},
  183. </if>
  184. <if test="costReduction != null">
  185. cost_reduction = #{costReduction},
  186. </if>
  187. <if test="serviceLife != null and serviceLife != ''">
  188. service_life = #{serviceLife},
  189. </if>
  190. <if test="serviceYear != null and serviceYear != ''">
  191. service_year = #{serviceYear},
  192. </if>
  193. <if test="yearSum != null">
  194. year_sum = #{yearSum},
  195. </if>
  196. <if test="contractTerm != null and contractTerm != ''">
  197. contract_term = #{contractTerm},
  198. </if>
  199. <if test="declarationBatch != null">
  200. declaration_batch = #{declarationBatch},
  201. </if>
  202. <if test="patentType != null">
  203. patent_type = #{patentType},
  204. </if>
  205. <if test="changeSplitSuper != null">
  206. change_split_super = #{changeSplitSuper},
  207. </if>
  208. <if test="lastYear != null and lastYear != ''">
  209. last_year = #{lastYear},
  210. </if>
  211. <if test="lastYearCapital != null">
  212. last_year_capital = #{lastYearCapital},
  213. </if>
  214. <if test="lastYearIncome != null">
  215. last_year_income = #{lastYearIncome},
  216. </if>
  217. <if test="htMember != null">
  218. ht_member = #{htMember},
  219. </if>
  220. <if test="additionalDeduction != null">
  221. additional_deduction = #{additionalDeduction},
  222. </if>
  223. <if test="rdAwardsubsidy != null">
  224. rd_awardsubsidy = #{rdAwardsubsidy},
  225. </if>
  226. <if test="technologyProjectType != null">
  227. technology_project_Type = #{technologyProjectType},
  228. </if>
  229. <if test="ordinaryRisk != null">
  230. ordinary_risk = #{ordinaryRisk},
  231. </if>
  232. <if test="days != null">
  233. days = #{days},
  234. </if>
  235. <if test="scheme != null">
  236. scheme = #{scheme},
  237. </if>
  238. </set>
  239. where id = #{id}
  240. </update>
  241. <!--查询指定行数据-->
  242. <select id="findTChangeTaskList" resultMap="TChangeTaskMap">
  243. select
  244. <include refid="TChangeTaskAllSql"/>
  245. from t_change_task
  246. <where>
  247. <if test="id != null">
  248. and id = #{id}
  249. </if>
  250. <if test="tid != null">
  251. and tid = #{tid}
  252. </if>
  253. <if test="cid != null">
  254. and cid = #{cid}
  255. </if>
  256. <if test="orderNo != null and orderNo != ''">
  257. and order_no = #{orderNo}
  258. </if>
  259. <if test="main != null">
  260. and main = #{main}
  261. </if>
  262. <if test="commodityId != null and commodityId != ''">
  263. and commodity_id = #{commodityId}
  264. </if>
  265. <if test="commodityName != null and commodityName != ''">
  266. and commodity_name = #{commodityName}
  267. </if>
  268. <if test="commodityQuantity != null">
  269. and commodity_quantity = #{commodityQuantity}
  270. </if>
  271. <if test="commodityPrice != null">
  272. and commodity_price = #{commodityPrice}
  273. </if>
  274. <if test="taskComment != null and taskComment != ''">
  275. and task_comment = #{taskComment}
  276. </if>
  277. <if test="type != null">
  278. and type = #{type}
  279. </if>
  280. <if test="createTime != null">
  281. and create_time = #{createTime}
  282. </if>
  283. <if test="splitStatus != null">
  284. and split_status = #{splitStatus}
  285. </if>
  286. <if test="splitSuper != null">
  287. and split_super = #{splitSuper}
  288. </if>
  289. <if test="receiverName != null and receiverName != ''">
  290. and receiver_name = #{receiverName}
  291. </if>
  292. <if test="officialCost != null">
  293. and official_cost = #{officialCost}
  294. </if>
  295. <if test="costReduction != null">
  296. and cost_reduction = #{costReduction}
  297. </if>
  298. <if test="serviceLife != null and serviceLife != ''">
  299. and service_life = #{serviceLife}
  300. </if>
  301. <if test="serviceYear != null and serviceYear != ''">
  302. and service_year = #{serviceYear}
  303. </if>
  304. <if test="yearSum != null">
  305. and year_sum = #{yearSum}
  306. </if>
  307. <if test="contractTerm != null and contractTerm != ''">
  308. and contract_term = #{contractTerm}
  309. </if>
  310. <if test="declarationBatch != null">
  311. and declaration_batch = #{declarationBatch}
  312. </if>
  313. <if test="patentType != null">
  314. and patent_type = #{patentType}
  315. </if>
  316. <if test="changeSplitSuper != null">
  317. and change_split_super = #{changeSplitSuper}
  318. </if>
  319. <if test="lastYear != null and lastYear != ''">
  320. and last_year = #{lastYear}
  321. </if>
  322. <if test="lastYearCapital != null">
  323. and last_year_capital = #{lastYearCapital}
  324. </if>
  325. <if test="lastYearIncome != null">
  326. and last_year_income = #{lastYearIncome}
  327. </if>
  328. <if test="htMember != null">
  329. and ht_member = #{htMember}
  330. </if>
  331. <if test="additionalDeduction != null">
  332. and additional_deduction = #{additionalDeduction}
  333. </if>
  334. <if test="rdAwardsubsidy != null">
  335. and rd_awardsubsidy = #{rdAwardsubsidy}
  336. </if>
  337. <if test="technologyProjectType != null">
  338. and technology_project_Type = #{technologyProjectType}
  339. </if>
  340. <if test="ordinaryRisk != null">
  341. and ordinary_risk = #{ordinaryRisk}
  342. </if>
  343. <if test="days != null">
  344. and days = #{days}
  345. </if>
  346. <if test="scheme != null">
  347. and scheme = #{scheme}
  348. </if>
  349. </where>
  350. <if test="page_sql != null">
  351. ${page_sql}
  352. </if>
  353. </select>
  354. <!--统计总行数-->
  355. <select id="findTChangeTaskCount" resultType="java.lang.Integer">
  356. select count(1)
  357. from t_change_task
  358. <where>
  359. <if test="id != null">
  360. and id = #{id}
  361. </if>
  362. <if test="tid != null">
  363. and tid = #{tid}
  364. </if>
  365. <if test="cid != null">
  366. and cid = #{cid}
  367. </if>
  368. <if test="orderNo != null and orderNo != ''">
  369. and order_no = #{orderNo}
  370. </if>
  371. <if test="main != null">
  372. and main = #{main}
  373. </if>
  374. <if test="commodityId != null and commodityId != ''">
  375. and commodity_id = #{commodityId}
  376. </if>
  377. <if test="commodityName != null and commodityName != ''">
  378. and commodity_name = #{commodityName}
  379. </if>
  380. <if test="commodityQuantity != null">
  381. and commodity_quantity = #{commodityQuantity}
  382. </if>
  383. <if test="commodityPrice != null">
  384. and commodity_price = #{commodityPrice}
  385. </if>
  386. <if test="taskComment != null and taskComment != ''">
  387. and task_comment = #{taskComment}
  388. </if>
  389. <if test="type != null">
  390. and type = #{type}
  391. </if>
  392. <if test="createTime != null">
  393. and create_time = #{createTime}
  394. </if>
  395. <if test="splitStatus != null">
  396. and split_status = #{splitStatus}
  397. </if>
  398. <if test="splitSuper != null">
  399. and split_super = #{splitSuper}
  400. </if>
  401. <if test="receiverName != null and receiverName != ''">
  402. and receiver_name = #{receiverName}
  403. </if>
  404. <if test="officialCost != null">
  405. and official_cost = #{officialCost}
  406. </if>
  407. <if test="costReduction != null">
  408. and cost_reduction = #{costReduction}
  409. </if>
  410. <if test="serviceLife != null and serviceLife != ''">
  411. and service_life = #{serviceLife}
  412. </if>
  413. <if test="serviceYear != null and serviceYear != ''">
  414. and service_year = #{serviceYear}
  415. </if>
  416. <if test="yearSum != null">
  417. and year_sum = #{yearSum}
  418. </if>
  419. <if test="contractTerm != null and contractTerm != ''">
  420. and contract_term = #{contractTerm}
  421. </if>
  422. <if test="declarationBatch != null">
  423. and declaration_batch = #{declarationBatch}
  424. </if>
  425. <if test="patentType != null">
  426. and patent_type = #{patentType}
  427. </if>
  428. <if test="changeSplitSuper != null">
  429. and change_split_super = #{changeSplitSuper}
  430. </if>
  431. <if test="lastYear != null and lastYear != ''">
  432. and last_year = #{lastYear}
  433. </if>
  434. <if test="lastYearCapital != null">
  435. and last_year_capital = #{lastYearCapital}
  436. </if>
  437. <if test="lastYearIncome != null">
  438. and last_year_income = #{lastYearIncome}
  439. </if>
  440. <if test="htMember != null">
  441. and ht_member = #{htMember}
  442. </if>
  443. <if test="additionalDeduction != null">
  444. and additional_deduction = #{additionalDeduction}
  445. </if>
  446. <if test="rdAwardsubsidy != null">
  447. and rd_awardsubsidy = #{rdAwardsubsidy}
  448. </if>
  449. <if test="technologyProjectType != null">
  450. and technology_project_Type = #{technologyProjectType}
  451. </if>
  452. <if test="ordinaryRisk != null">
  453. and ordinary_risk = #{ordinaryRisk}
  454. </if>
  455. <if test="days != null">
  456. and days = #{days}
  457. </if>
  458. <if test="scheme != null">
  459. and scheme = #{scheme}
  460. </if>
  461. </where>
  462. </select>
  463. <!--通过主键删除-->
  464. <delete id="deleteById">
  465. delete from t_change_task where id = #{id}
  466. </delete>
  467. <insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
  468. insert into t_change_task
  469. <trim prefix="(" suffix=")" suffixOverrides=",">
  470. <if test="tid != null">
  471. tid ,
  472. </if>
  473. <if test="cid != null">
  474. cid ,
  475. </if>
  476. <if test="orderNo != null and orderNo != ''">
  477. order_no ,
  478. </if>
  479. <if test="main != null">
  480. main ,
  481. </if>
  482. <if test="commodityId != null and commodityId != ''">
  483. commodity_id ,
  484. </if>
  485. <if test="commodityName != null and commodityName != ''">
  486. commodity_name,
  487. </if>
  488. <if test="commodityQuantity != null">
  489. commodity_quantity ,
  490. </if>
  491. <if test="commodityPrice != null">
  492. commodity_price,
  493. </if>
  494. <if test="taskComment != null and taskComment != ''">
  495. task_comment ,
  496. </if>
  497. <if test="type != null">
  498. type,
  499. </if>
  500. <if test="createTime != null">
  501. create_time,
  502. </if>
  503. <if test="splitStatus != null">
  504. split_status,
  505. </if>
  506. <if test="splitSuper != null">
  507. split_super ,
  508. </if>
  509. <if test="receiverName != null and receiverName != ''">
  510. receiver_name ,
  511. </if>
  512. <if test="officialCost != null">
  513. official_cost,
  514. </if>
  515. <if test="costReduction != null">
  516. cost_reduction ,
  517. </if>
  518. <if test="serviceLife != null and serviceLife != ''">
  519. service_life ,
  520. </if>
  521. <if test="serviceYear != null and serviceYear != ''">
  522. service_year ,
  523. </if>
  524. <if test="yearSum != null">
  525. year_sum ,
  526. </if>
  527. <if test="contractTerm != null and contractTerm != ''">
  528. contract_term,
  529. </if>
  530. <if test="declarationBatch != null">
  531. declaration_batch ,
  532. </if>
  533. <if test="patentType != null">
  534. patent_type,
  535. </if>
  536. <if test="changeSplitSuper != null">
  537. change_split_super ,
  538. </if>
  539. <if test="lastYear != null and lastYear != ''">
  540. last_year ,
  541. </if>
  542. <if test="lastYearCapital != null">
  543. last_year_capital ,
  544. </if>
  545. <if test="lastYearIncome != null">
  546. last_year_income ,
  547. </if>
  548. <if test="htMember != null">
  549. ht_member ,
  550. </if>
  551. <if test="additionalDeduction != null">
  552. additional_deduction ,
  553. </if>
  554. <if test="rdAwardsubsidy != null">
  555. rd_awardsubsidy ,
  556. </if>
  557. <if test="justForms != null">
  558. just_forms ,
  559. </if>
  560. <if test="technologyProjectType != null">
  561. technology_project_Type ,
  562. </if>
  563. <if test="ordinaryRisk != null">
  564. ordinary_risk ,
  565. </if>
  566. <if test="days != null">
  567. days ,
  568. </if>
  569. <if test="scheme != null">
  570. scheme ,
  571. </if>
  572. <if test="unilateralService != null">
  573. unilateral_service ,
  574. </if>
  575. </trim>
  576. <trim prefix="values (" suffix=")" suffixOverrides=",">
  577. <if test="tid != null">
  578. #{tid},
  579. </if>
  580. <if test="cid != null">
  581. #{cid},
  582. </if>
  583. <if test="orderNo != null and orderNo != ''">
  584. #{orderNo},
  585. </if>
  586. <if test="main != null">
  587. #{main},
  588. </if>
  589. <if test="commodityId != null and commodityId != ''">
  590. #{commodityId},
  591. </if>
  592. <if test="commodityName != null and commodityName != ''">
  593. #{commodityName},
  594. </if>
  595. <if test="commodityQuantity != null">
  596. #{commodityQuantity},
  597. </if>
  598. <if test="commodityPrice != null">
  599. #{commodityPrice},
  600. </if>
  601. <if test="taskComment != null and taskComment != ''">
  602. #{taskComment},
  603. </if>
  604. <if test="type != null">
  605. #{type},
  606. </if>
  607. <if test="createTime != null">
  608. #{createTime},
  609. </if>
  610. <if test="splitStatus != null">
  611. #{splitStatus},
  612. </if>
  613. <if test="splitSuper != null">
  614. #{splitSuper},
  615. </if>
  616. <if test="receiverName != null and receiverName != ''">
  617. #{receiverName},
  618. </if>
  619. <if test="officialCost != null">
  620. #{officialCost},
  621. </if>
  622. <if test="costReduction != null">
  623. #{costReduction},
  624. </if>
  625. <if test="serviceLife != null and serviceLife != ''">
  626. #{serviceLife},
  627. </if>
  628. <if test="serviceYear != null and serviceYear != ''">
  629. #{serviceYear},
  630. </if>
  631. <if test="yearSum != null">
  632. #{yearSum},
  633. </if>
  634. <if test="contractTerm != null and contractTerm != ''">
  635. #{contractTerm},
  636. </if>
  637. <if test="declarationBatch != null">
  638. #{declarationBatch},
  639. </if>
  640. <if test="patentType != null">
  641. #{patentType},
  642. </if>
  643. <if test="changeSplitSuper != null">
  644. #{changeSplitSuper},
  645. </if>
  646. <if test="lastYear != null and lastYear != ''">
  647. #{lastYear},
  648. </if>
  649. <if test="lastYearCapital != null">
  650. #{lastYearCapital},
  651. </if>
  652. <if test="lastYearIncome != null">
  653. #{lastYearIncome},
  654. </if>
  655. <if test="htMember != null">
  656. #{htMember},
  657. </if>
  658. <if test="additionalDeduction != null">
  659. #{additionalDeduction},
  660. </if>
  661. <if test="rdAwardsubsidy != null">
  662. #{rdAwardsubsidy},
  663. </if>
  664. <if test="justForms != null">
  665. #{justForms},
  666. </if>
  667. <if test="technologyProjectType != null">
  668. #{technologyProjectType},
  669. </if>
  670. <if test="ordinaryRisk != null">
  671. #{ordinaryRisk},
  672. </if>
  673. <if test="days != null">
  674. #{days},
  675. </if>
  676. <if test="scheme != null">
  677. #{scheme},
  678. </if>
  679. <if test="unilateralService != null">
  680. #{unilateralService},
  681. </if>
  682. </trim>
  683. </insert>
  684. <select id="selectByCid" resultType="com.goafanti.order.bo.TChangeTaskOut">
  685. select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,a.official_cost officialCost,
  686. a.official_cost officialCost, a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,
  687. a.receiver_name receiverName, a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,
  688. a.split_super splitSuper, a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum,i.patent_transfer patentTransfer,
  689. i.type taskType, a.declaration_batch declarationBatch,a.patent_type patentType,a.contract_term contractTerm,a.cost_reduction costReduction,
  690. a.change_split_super changeSplitSuper,a.last_year lastYear,a.last_year_income lastYearIncome,a.last_year_capital lastYearCapital,i.project_type as projectType,
  691. a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy,
  692. a.technology_project_Type technologyProjectType,a.ordinary_risk ordinaryRisk,a.days,a.scheme
  693. from t_change_task a left join business_project i on a.commodity_id=i.id
  694. left join business_category c on i.cid=c.id
  695. where 1=1
  696. <if test="splitStatus !=null and splitStatus !=3">
  697. and a.split_status= #{splitStatus}
  698. </if>
  699. <if test="splitStatus ==3">
  700. and a.split_status in (0,1)
  701. </if>
  702. and a.cid= #{id} order by a.id
  703. </select>
  704. <update id="updateByTid">
  705. update t_change_task
  706. <set>
  707. <if test="type != null">
  708. type= #{type},
  709. </if>
  710. <if test="member ==1">
  711. service_life=null,year_sum=null,
  712. </if>
  713. </set>
  714. where 1=1
  715. <if test="tid !=null">
  716. and tid= #{tid}
  717. </if>
  718. <if test="cid !=null">
  719. and cid= #{cid}
  720. </if>
  721. <if test="sid !=null">
  722. and split_super= #{sid}
  723. </if>
  724. </update>
  725. <update id="deleteByTid">
  726. delete from t_change_task where tid= #{tid};
  727. </update>
  728. <delete id="deleteByChangeSplitSuper">
  729. delete from t_change_task where change_split_super= #{tid};
  730. </delete>
  731. <update id="updateMemberByTid">
  732. update t_change_task
  733. <set>
  734. <if test="type != null">
  735. type= #{type},
  736. </if>
  737. <if test="serviceLife != null">
  738. service_life= #{serviceLife},
  739. </if>
  740. <if test="serviceYear != null">
  741. service_year= #{serviceYear},
  742. </if>
  743. <if test="yearSum != null">
  744. year_sum= #{yearSum},
  745. </if>
  746. <if test="contractTerm != null">
  747. contract_term= #{contractTerm},
  748. </if>
  749. </set>
  750. where 1=1
  751. <if test="cid !=null">
  752. and cid= #{cid}
  753. </if>
  754. <if test="sid !=null">
  755. and split_super= #{sid}
  756. </if>
  757. </update>
  758. <update id="updateTypeBatch">
  759. update t_change_task set type= #{type}
  760. where id in
  761. <foreach close=")" collection="list" item="id" open="(" separator=",">
  762. #{id}
  763. </foreach>
  764. </update>
  765. <select id="selectBySuper" resultType="com.goafanti.order.bo.TChangeTaskOut">
  766. select a.id,a.order_no as orderNo,a.main, c.cname,c.sort cSort,a.commodity_name as commodityName,
  767. a.commodity_quantity as commodityQuantity,i.price,a.commodity_id as commodityId,a.type,a.tid,a.receiver_name receiverName,
  768. a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,a.split_super splitSuper,
  769. a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum, a.declaration_batch declarationBatch,
  770. a.patent_type patentType,a.contract_term contractTerm,a.change_split_super changeSplitSuper,
  771. a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy
  772. from t_change_task a left join business_project i on a.commodity_id=i.id
  773. left join business_category c on i.cid=c.id
  774. where a.split_status=2 and a.cid= #{cid}
  775. <if test="splitSuper !=null">
  776. and a.split_super= #{splitSuper}
  777. </if>
  778. <if test="changeSplitSuper !=null" >
  779. and a.change_split_super= #{changeSplitSuper}
  780. </if>
  781. order by a.id
  782. </select>
  783. <select id="selectBytid" resultType="com.goafanti.common.model.TChangeTask">
  784. select tct.id,tct.tid,tct.cid,tct.order_no orderNo
  785. from t_change_task tct left join new_order_change noc on tct.cid =noc.id
  786. where noc.process_state &lt; 4 and noc.status in (0,1,2)
  787. and tct.tid= #{tid}
  788. </select>
  789. <update id="updateSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
  790. update t_change_task a,(select a.split_super,GROUP_CONCAT(a.service_year) counts
  791. from t_change_task a where a.split_status =2 and a.type in (0,1,2)
  792. and a.split_super=#{splitSuper} and a.cid= #{cid} group by a.split_super)x
  793. set a.service_year =x.counts
  794. where a.tid =x.split_super and a.cid= #{cid};
  795. </update>
  796. <update id="updateChangeSuperServiceYear" parameterType="com.goafanti.common.model.TChangeTask">
  797. update t_change_task a,(select a.change_split_super,GROUP_CONCAT(a.service_year) counts
  798. from t_change_task a where a.split_status =2 and a.type in (0,1,2)
  799. and a.change_split_super = #{changeSplitSuper} group by a.change_split_super)x
  800. set a.service_year =x.counts
  801. where a.id =x.change_split_super
  802. </update>
  803. </mapper>