TOrderTaskMapper.xml 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079
  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.TOrderTaskMapper">
  4. <resultMap type="com.goafanti.common.model.TOrderTask" id="TOrderTaskMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
  7. <result property="main" column="main" jdbcType="INTEGER"/>
  8. <result property="superId" column="super_id" jdbcType="VARCHAR"/>
  9. <result property="commodityId" column="commodity_id" jdbcType="VARCHAR"/>
  10. <result property="commodityName" column="commodity_name" jdbcType="VARCHAR"/>
  11. <result property="commodityQuantity" column="commodity_quantity" jdbcType="INTEGER"/>
  12. <result property="commodityMode" column="commodity_mode" jdbcType="VARCHAR"/>
  13. <result property="commodityPrice" column="commodity_price" jdbcType="VARCHAR"/>
  14. <result property="taskStatus" column="task_status" jdbcType="INTEGER"/>
  15. <result property="taskDistributionTime" column="task_distribution_time" jdbcType="TIMESTAMP"/>
  16. <result property="taskAllocator" column="task_allocator" jdbcType="VARCHAR"/>
  17. <result property="taskReceiver" column="task_receiver" jdbcType="VARCHAR"/>
  18. <result property="taskComment" column="task_comment" jdbcType="VARCHAR"/>
  19. <result property="taskStartTime" column="task_start_time" jdbcType="TIMESTAMP"/>
  20. <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
  21. <result property="attachmentUrl" column="attachment_url" jdbcType="VARCHAR"/>
  22. <result property="projectStatus" column="project_status" jdbcType="INTEGER"/>
  23. <result property="acceptTime" column="accept_time" jdbcType="TIMESTAMP"/>
  24. <result property="reviewTime" column="review_time" jdbcType="TIMESTAMP"/>
  25. <result property="publicityTime" column="publicity_time" jdbcType="TIMESTAMP"/>
  26. <result property="licenceTime" column="licence_time" jdbcType="TIMESTAMP"/>
  27. <result property="certificateNumber" column="certificate_number" jdbcType="VARCHAR"/>
  28. <result property="status" column="status" jdbcType="INTEGER"/>
  29. <result property="formRetrieve" column="form_retrieve" jdbcType="INTEGER"/>
  30. <result property="taskRefund" column="task_refund" jdbcType="INTEGER"/>
  31. <result property="refundContent" column="refund_content" jdbcType="VARCHAR"/>
  32. <result property="retrieveContent" column="retrieve_content" jdbcType="VARCHAR"/>
  33. <result property="declareUser" column="declare_user" jdbcType="VARCHAR"/>
  34. <result property="declarePwd" column="declare_pwd" jdbcType="VARCHAR"/>
  35. <result property="setUpAmount" column="set_up_amount" jdbcType="VARCHAR"/>
  36. <result property="arrivalMoney" column="arrival_money" jdbcType="INTEGER"/>
  37. <result property="outsourceName" column="outsource_name" jdbcType="VARCHAR"/>
  38. <result property="outsourcePrice" column="outsource_price" jdbcType="VARCHAR"/>
  39. <result property="consultantId" column="consultant_id" jdbcType="VARCHAR"/>
  40. <result property="managerId" column="manager_id" jdbcType="VARCHAR"/>
  41. <result property="outsource" column="outsource" jdbcType="INTEGER"/>
  42. <result property="splitSuper" column="split_super" jdbcType="INTEGER"/>
  43. <result property="splitStatus" column="split_status" jdbcType="INTEGER"/>
  44. <result property="splitId" column="split_id" jdbcType="INTEGER"/>
  45. <result property="splitAid" column="split_aid" jdbcType="VARCHAR"/>
  46. <result property="splitTime" column="split_time" jdbcType="TIMESTAMP"/>
  47. <result property="cname" column="cname" jdbcType="VARCHAR"/>
  48. <result property="receiverName" column="receiver_name" jdbcType="VARCHAR"/>
  49. <result property="declarationBatch" column="declaration_batch" jdbcType="INTEGER"/>
  50. <result property="costReduction" column="cost_reduction" jdbcType="INTEGER"/>
  51. <result property="officialCost" column="official_cost" jdbcType="INTEGER"/>
  52. <result property="setUpStatus" column="set_up_status" jdbcType="INTEGER"/>
  53. <result property="setUpTime" column="set_up_time" jdbcType="TIMESTAMP"/>
  54. <result property="spotCheckStatus" column="spot_check_status" jdbcType="INTEGER"/>
  55. <result property="highTechStatus" column="high_tech_status" jdbcType="INTEGER"/>
  56. <result property="specialComment" column="special_comment" jdbcType="VARCHAR"/>
  57. <result property="ifCertificationFee" column="if_certification_fee" jdbcType="INTEGER"/>
  58. <result property="certificationFee" column="certification_fee" jdbcType="VARCHAR"/>
  59. <result property="certificationCorporate" column="certification_corporate" jdbcType="VARCHAR"/>
  60. <result property="timeRecord" column="time_record" jdbcType="VARCHAR"/>
  61. <result property="ifPublicity" column="if_publicity" jdbcType="INTEGER"/>
  62. <result property="checkStatus" column="check_status" jdbcType="INTEGER"/>
  63. <result property="patentType" column="patent_type" jdbcType="INTEGER"/>
  64. <result property="pubicityUrl" column="pubicity_url" jdbcType="VARCHAR"/>
  65. <result property="processStatus" column="process_status" jdbcType="INTEGER"/>
  66. <result property="memberType" column="member_type" jdbcType="INTEGER"/>
  67. <result property="pictureUrl" column="picture_url" jdbcType="VARCHAR"/>
  68. <result property="satisfactionDegree" column="satisfaction_degree" jdbcType="INTEGER"/>
  69. <result property="satisfactionDegreeUrl" column="satisfaction_degree_url" jdbcType="VARCHAR"/>
  70. <result property="examineType" column="examine_type" jdbcType="INTEGER"/>
  71. <result property="approval" column="approval" jdbcType="INTEGER"/>
  72. <result property="completeDate" column="complete_date" jdbcType="TIMESTAMP"/>
  73. <result property="completeStatus" column="complete_status" jdbcType="INTEGER"/>
  74. <result property="scoreStatus" column="score_status" jdbcType="INTEGER"/>
  75. <result property="scoreNumber" column="score_number" jdbcType="INTEGER"/>
  76. </resultMap>
  77. <sql id="TOrderTaskAllSql">
  78. id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode, commodity_price, task_status, task_distribution_time, task_allocator, task_receiver, task_comment, task_start_time, task_end_time, attachment_url, project_status, accept_time, review_time, publicity_time, licence_time, certificate_number, status, form_retrieve, task_refund, refund_content, retrieve_content, declare_user, declare_pwd, set_up_amount, arrival_money, outsource_name, outsource_price, consultant_id, manager_id, outsource, split_super, split_status, split_id, split_aid, split_time, cname, receiver_name, declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status, high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate, time_record, if_publicity, check_status, patent_type, pubicity_url, process_status, member_type, picture_url, satisfaction_degree, satisfaction_degree_url, examine_type, approval, complete_date, complete_status, score_status, score_number
  79. </sql>
  80. <!--查询单个-->
  81. <select id="queryById" resultMap="TOrderTaskMap">
  82. select
  83. <include refid="TOrderTaskAllSql"/>
  84. from t_order_task
  85. where id = #{id}
  86. </select>
  87. <!--查询指定行数据-->
  88. <select id="findTOrderTaskList" resultMap="TOrderTaskMap">
  89. select
  90. <include refid="TOrderTaskAllSql"/>
  91. from t_order_task
  92. <where>
  93. <if test="id != null">
  94. and id = #{id}
  95. </if>
  96. <if test="orderNo != null and orderNo != ''">
  97. and order_no = #{orderNo}
  98. </if>
  99. <if test="main != null">
  100. and main = #{main}
  101. </if>
  102. <if test="superId != null and superId != ''">
  103. and super_id = #{superId}
  104. </if>
  105. <if test="commodityId != null and commodityId != ''">
  106. and commodity_id = #{commodityId}
  107. </if>
  108. <if test="commodityName != null and commodityName != ''">
  109. and commodity_name = #{commodityName}
  110. </if>
  111. <if test="commodityQuantity != null">
  112. and commodity_quantity = #{commodityQuantity}
  113. </if>
  114. <if test="commodityMode != null and commodityMode != ''">
  115. and commodity_mode = #{commodityMode}
  116. </if>
  117. <if test="commodityPrice != null">
  118. and commodity_price = #{commodityPrice}
  119. </if>
  120. <if test="taskStatus != null">
  121. and task_status = #{taskStatus}
  122. </if>
  123. <if test="taskDistributionTime != null">
  124. and task_distribution_time = #{taskDistributionTime}
  125. </if>
  126. <if test="taskAllocator != null and taskAllocator != ''">
  127. and task_allocator = #{taskAllocator}
  128. </if>
  129. <if test="taskReceiver != null and taskReceiver != ''">
  130. and task_receiver = #{taskReceiver}
  131. </if>
  132. <if test="taskComment != null and taskComment != ''">
  133. and task_comment = #{taskComment}
  134. </if>
  135. <if test="taskStartTime != null">
  136. and task_start_time = #{taskStartTime}
  137. </if>
  138. <if test="taskEndTime != null">
  139. and task_end_time = #{taskEndTime}
  140. </if>
  141. <if test="attachmentUrl != null and attachmentUrl != ''">
  142. and attachment_url = #{attachmentUrl}
  143. </if>
  144. <if test="projectStatus != null">
  145. and project_status = #{projectStatus}
  146. </if>
  147. <if test="acceptTime != null">
  148. and accept_time = #{acceptTime}
  149. </if>
  150. <if test="reviewTime != null">
  151. and review_time = #{reviewTime}
  152. </if>
  153. <if test="publicityTime != null">
  154. and publicity_time = #{publicityTime}
  155. </if>
  156. <if test="licenceTime != null">
  157. and licence_time = #{licenceTime}
  158. </if>
  159. <if test="certificateNumber != null and certificateNumber != ''">
  160. and certificate_number = #{certificateNumber}
  161. </if>
  162. <if test="status != null">
  163. and status = #{status}
  164. </if>
  165. <if test="formRetrieve != null">
  166. and form_retrieve = #{formRetrieve}
  167. </if>
  168. <if test="taskRefund != null">
  169. and task_refund = #{taskRefund}
  170. </if>
  171. <if test="refundContent != null and refundContent != ''">
  172. and refund_content = #{refundContent}
  173. </if>
  174. <if test="retrieveContent != null and retrieveContent != ''">
  175. and retrieve_content = #{retrieveContent}
  176. </if>
  177. <if test="declareUser != null and declareUser != ''">
  178. and declare_user = #{declareUser}
  179. </if>
  180. <if test="declarePwd != null and declarePwd != ''">
  181. and declare_pwd = #{declarePwd}
  182. </if>
  183. <if test="setUpAmount != null">
  184. and set_up_amount = #{setUpAmount}
  185. </if>
  186. <if test="arrivalMoney != null">
  187. and arrival_money = #{arrivalMoney}
  188. </if>
  189. <if test="outsourceName != null and outsourceName != ''">
  190. and outsource_name = #{outsourceName}
  191. </if>
  192. <if test="outsourcePrice != null">
  193. and outsource_price = #{outsourcePrice}
  194. </if>
  195. <if test="consultantId != null and consultantId != ''">
  196. and consultant_id = #{consultantId}
  197. </if>
  198. <if test="managerId != null and managerId != ''">
  199. and manager_id = #{managerId}
  200. </if>
  201. <if test="outsource != null">
  202. and outsource = #{outsource}
  203. </if>
  204. <if test="splitSuper != null">
  205. and split_super = #{splitSuper}
  206. </if>
  207. <if test="splitStatus != null">
  208. and split_status = #{splitStatus}
  209. </if>
  210. <if test="splitId != null">
  211. and split_id = #{splitId}
  212. </if>
  213. <if test="splitAid != null and splitAid != ''">
  214. and split_aid = #{splitAid}
  215. </if>
  216. <if test="splitTime != null">
  217. and split_time = #{splitTime}
  218. </if>
  219. <if test="cname != null and cname != ''">
  220. and cname = #{cname}
  221. </if>
  222. <if test="receiverName != null and receiverName != ''">
  223. and receiver_name = #{receiverName}
  224. </if>
  225. <if test="declarationBatch != null">
  226. and declaration_batch = #{declarationBatch}
  227. </if>
  228. <if test="costReduction != null">
  229. and cost_reduction = #{costReduction}
  230. </if>
  231. <if test="officialCost != null">
  232. and official_cost = #{officialCost}
  233. </if>
  234. <if test="setUpStatus != null">
  235. and set_up_status = #{setUpStatus}
  236. </if>
  237. <if test="setUpTime != null">
  238. and set_up_time = #{setUpTime}
  239. </if>
  240. <if test="spotCheckStatus != null">
  241. and spot_check_status = #{spotCheckStatus}
  242. </if>
  243. <if test="highTechStatus != null">
  244. and high_tech_status = #{highTechStatus}
  245. </if>
  246. <if test="specialComment != null and specialComment != ''">
  247. and special_comment = #{specialComment}
  248. </if>
  249. <if test="ifCertificationFee != null">
  250. and if_certification_fee = #{ifCertificationFee}
  251. </if>
  252. <if test="certificationFee != null">
  253. and certification_fee = #{certificationFee}
  254. </if>
  255. <if test="certificationCorporate != null and certificationCorporate != ''">
  256. and certification_corporate = #{certificationCorporate}
  257. </if>
  258. <if test="timeRecord != null and timeRecord != ''">
  259. and time_record = #{timeRecord}
  260. </if>
  261. <if test="ifPublicity != null">
  262. and if_publicity = #{ifPublicity}
  263. </if>
  264. <if test="checkStatus != null">
  265. and check_status = #{checkStatus}
  266. </if>
  267. <if test="patentType != null">
  268. and patent_type = #{patentType}
  269. </if>
  270. <if test="pubicityUrl != null and pubicityUrl != ''">
  271. and pubicity_url = #{pubicityUrl}
  272. </if>
  273. <if test="processStatus != null">
  274. and process_status = #{processStatus}
  275. </if>
  276. <if test="memberType != null">
  277. and member_type = #{memberType}
  278. </if>
  279. <if test="pictureUrl != null and pictureUrl != ''">
  280. and picture_url = #{pictureUrl}
  281. </if>
  282. <if test="satisfactionDegree != null">
  283. and satisfaction_degree = #{satisfactionDegree}
  284. </if>
  285. <if test="satisfactionDegreeUrl != null and satisfactionDegreeUrl != ''">
  286. and satisfaction_degree_url = #{satisfactionDegreeUrl}
  287. </if>
  288. <if test="examineType != null">
  289. and examine_type = #{examineType}
  290. </if>
  291. <if test="approval != null">
  292. and approval = #{approval}
  293. </if>
  294. <if test="completeDate != null">
  295. and complete_date = #{completeDate}
  296. </if>
  297. <if test="completeStatus != null">
  298. and complete_status = #{completeStatus}
  299. </if>
  300. <if test="scoreStatus != null">
  301. and score_status = #{scoreStatus}
  302. </if>
  303. <if test="scoreNumber != null">
  304. and score_number = #{scoreNumber}
  305. </if>
  306. </where>
  307. <if test="page_sql != null">
  308. ${page_sql}
  309. </if>
  310. </select>
  311. <!--统计总行数-->
  312. <select id="findTOrderTaskCount" resultType="java.lang.Integer">
  313. select count(1)
  314. from t_order_task
  315. <where>
  316. <if test="id != null">
  317. and id = #{id}
  318. </if>
  319. <if test="orderNo != null and orderNo != ''">
  320. and order_no = #{orderNo}
  321. </if>
  322. <if test="main != null">
  323. and main = #{main}
  324. </if>
  325. <if test="superId != null and superId != ''">
  326. and super_id = #{superId}
  327. </if>
  328. <if test="commodityId != null and commodityId != ''">
  329. and commodity_id = #{commodityId}
  330. </if>
  331. <if test="commodityName != null and commodityName != ''">
  332. and commodity_name = #{commodityName}
  333. </if>
  334. <if test="commodityQuantity != null">
  335. and commodity_quantity = #{commodityQuantity}
  336. </if>
  337. <if test="commodityMode != null and commodityMode != ''">
  338. and commodity_mode = #{commodityMode}
  339. </if>
  340. <if test="commodityPrice != null">
  341. and commodity_price = #{commodityPrice}
  342. </if>
  343. <if test="taskStatus != null">
  344. and task_status = #{taskStatus}
  345. </if>
  346. <if test="taskDistributionTime != null">
  347. and task_distribution_time = #{taskDistributionTime}
  348. </if>
  349. <if test="taskAllocator != null and taskAllocator != ''">
  350. and task_allocator = #{taskAllocator}
  351. </if>
  352. <if test="taskReceiver != null and taskReceiver != ''">
  353. and task_receiver = #{taskReceiver}
  354. </if>
  355. <if test="taskComment != null and taskComment != ''">
  356. and task_comment = #{taskComment}
  357. </if>
  358. <if test="taskStartTime != null">
  359. and task_start_time = #{taskStartTime}
  360. </if>
  361. <if test="taskEndTime != null">
  362. and task_end_time = #{taskEndTime}
  363. </if>
  364. <if test="attachmentUrl != null and attachmentUrl != ''">
  365. and attachment_url = #{attachmentUrl}
  366. </if>
  367. <if test="projectStatus != null">
  368. and project_status = #{projectStatus}
  369. </if>
  370. <if test="acceptTime != null">
  371. and accept_time = #{acceptTime}
  372. </if>
  373. <if test="reviewTime != null">
  374. and review_time = #{reviewTime}
  375. </if>
  376. <if test="publicityTime != null">
  377. and publicity_time = #{publicityTime}
  378. </if>
  379. <if test="licenceTime != null">
  380. and licence_time = #{licenceTime}
  381. </if>
  382. <if test="certificateNumber != null and certificateNumber != ''">
  383. and certificate_number = #{certificateNumber}
  384. </if>
  385. <if test="status != null">
  386. and status = #{status}
  387. </if>
  388. <if test="formRetrieve != null">
  389. and form_retrieve = #{formRetrieve}
  390. </if>
  391. <if test="taskRefund != null">
  392. and task_refund = #{taskRefund}
  393. </if>
  394. <if test="refundContent != null and refundContent != ''">
  395. and refund_content = #{refundContent}
  396. </if>
  397. <if test="retrieveContent != null and retrieveContent != ''">
  398. and retrieve_content = #{retrieveContent}
  399. </if>
  400. <if test="declareUser != null and declareUser != ''">
  401. and declare_user = #{declareUser}
  402. </if>
  403. <if test="declarePwd != null and declarePwd != ''">
  404. and declare_pwd = #{declarePwd}
  405. </if>
  406. <if test="setUpAmount != null">
  407. and set_up_amount = #{setUpAmount}
  408. </if>
  409. <if test="arrivalMoney != null">
  410. and arrival_money = #{arrivalMoney}
  411. </if>
  412. <if test="outsourceName != null and outsourceName != ''">
  413. and outsource_name = #{outsourceName}
  414. </if>
  415. <if test="outsourcePrice != null">
  416. and outsource_price = #{outsourcePrice}
  417. </if>
  418. <if test="consultantId != null and consultantId != ''">
  419. and consultant_id = #{consultantId}
  420. </if>
  421. <if test="managerId != null and managerId != ''">
  422. and manager_id = #{managerId}
  423. </if>
  424. <if test="outsource != null">
  425. and outsource = #{outsource}
  426. </if>
  427. <if test="splitSuper != null">
  428. and split_super = #{splitSuper}
  429. </if>
  430. <if test="splitStatus != null">
  431. and split_status = #{splitStatus}
  432. </if>
  433. <if test="splitId != null">
  434. and split_id = #{splitId}
  435. </if>
  436. <if test="splitAid != null and splitAid != ''">
  437. and split_aid = #{splitAid}
  438. </if>
  439. <if test="splitTime != null">
  440. and split_time = #{splitTime}
  441. </if>
  442. <if test="cname != null and cname != ''">
  443. and cname = #{cname}
  444. </if>
  445. <if test="receiverName != null and receiverName != ''">
  446. and receiver_name = #{receiverName}
  447. </if>
  448. <if test="declarationBatch != null">
  449. and declaration_batch = #{declarationBatch}
  450. </if>
  451. <if test="costReduction != null">
  452. and cost_reduction = #{costReduction}
  453. </if>
  454. <if test="officialCost != null">
  455. and official_cost = #{officialCost}
  456. </if>
  457. <if test="setUpStatus != null">
  458. and set_up_status = #{setUpStatus}
  459. </if>
  460. <if test="setUpTime != null">
  461. and set_up_time = #{setUpTime}
  462. </if>
  463. <if test="spotCheckStatus != null">
  464. and spot_check_status = #{spotCheckStatus}
  465. </if>
  466. <if test="highTechStatus != null">
  467. and high_tech_status = #{highTechStatus}
  468. </if>
  469. <if test="specialComment != null and specialComment != ''">
  470. and special_comment = #{specialComment}
  471. </if>
  472. <if test="ifCertificationFee != null">
  473. and if_certification_fee = #{ifCertificationFee}
  474. </if>
  475. <if test="certificationFee != null">
  476. and certification_fee = #{certificationFee}
  477. </if>
  478. <if test="certificationCorporate != null and certificationCorporate != ''">
  479. and certification_corporate = #{certificationCorporate}
  480. </if>
  481. <if test="timeRecord != null and timeRecord != ''">
  482. and time_record = #{timeRecord}
  483. </if>
  484. <if test="ifPublicity != null">
  485. and if_publicity = #{ifPublicity}
  486. </if>
  487. <if test="checkStatus != null">
  488. and check_status = #{checkStatus}
  489. </if>
  490. <if test="patentType != null">
  491. and patent_type = #{patentType}
  492. </if>
  493. <if test="pubicityUrl != null and pubicityUrl != ''">
  494. and pubicity_url = #{pubicityUrl}
  495. </if>
  496. <if test="processStatus != null">
  497. and process_status = #{processStatus}
  498. </if>
  499. <if test="memberType != null">
  500. and member_type = #{memberType}
  501. </if>
  502. <if test="pictureUrl != null and pictureUrl != ''">
  503. and picture_url = #{pictureUrl}
  504. </if>
  505. <if test="satisfactionDegree != null">
  506. and satisfaction_degree = #{satisfactionDegree}
  507. </if>
  508. <if test="satisfactionDegreeUrl != null and satisfactionDegreeUrl != ''">
  509. and satisfaction_degree_url = #{satisfactionDegreeUrl}
  510. </if>
  511. <if test="examineType != null">
  512. and examine_type = #{examineType}
  513. </if>
  514. <if test="approval != null">
  515. and approval = #{approval}
  516. </if>
  517. <if test="completeDate != null">
  518. and complete_date = #{completeDate}
  519. </if>
  520. <if test="completeStatus != null">
  521. and complete_status = #{completeStatus}
  522. </if>
  523. <if test="scoreStatus != null">
  524. and score_status = #{scoreStatus}
  525. </if>
  526. <if test="scoreNumber != null">
  527. and score_number = #{scoreNumber}
  528. </if>
  529. </where>
  530. </select>
  531. <!--新增所有列-->
  532. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  533. insert into t_order_task(order_no, main, super_id, commodity_id, commodity_name, commodity_quantity,
  534. commodity_mode, commodity_price, task_status, task_distribution_time, task_allocator,
  535. task_receiver, task_comment, task_start_time, task_end_time, attachment_url,
  536. project_status, accept_time, review_time, publicity_time, licence_time,
  537. certificate_number, status, form_retrieve, task_refund, refund_content,
  538. retrieve_content, declare_user, declare_pwd, set_up_amount, arrival_money,
  539. outsource_name, outsource_price, consultant_id, manager_id, outsource, split_super,
  540. split_status, split_id, split_aid, split_time, cname, receiver_name, declaration_batch,
  541. cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
  542. high_tech_status, special_comment, if_certification_fee, certification_fee,
  543. certification_corporate, time_record, if_publicity, check_status, patent_type,
  544. pubicity_url, process_status, member_type, picture_url, satisfaction_degree,
  545. satisfaction_degree_url, examine_type, approval, complete_date, complete_status,
  546. score_status, score_number)
  547. values (#{orderNo}, #{main}, #{superId}, #{commodityId}, #{commodityName}, #{commodityQuantity},
  548. #{commodityMode}, #{commodityPrice}, #{taskStatus}, #{taskDistributionTime}, #{taskAllocator},
  549. #{taskReceiver}, #{taskComment}, #{taskStartTime}, #{taskEndTime}, #{attachmentUrl}, #{projectStatus},
  550. #{acceptTime}, #{reviewTime}, #{publicityTime}, #{licenceTime}, #{certificateNumber}, #{status},
  551. #{formRetrieve}, #{taskRefund}, #{refundContent}, #{retrieveContent}, #{declareUser}, #{declarePwd},
  552. #{setUpAmount}, #{arrivalMoney}, #{outsourceName}, #{outsourcePrice}, #{consultantId}, #{managerId},
  553. #{outsource}, #{splitSuper}, #{splitStatus}, #{splitId}, #{splitAid}, #{splitTime}, #{cname},
  554. #{receiverName}, #{declarationBatch}, #{costReduction}, #{officialCost}, #{setUpStatus}, #{setUpTime},
  555. #{spotCheckStatus}, #{highTechStatus}, #{specialComment}, #{ifCertificationFee}, #{certificationFee},
  556. #{certificationCorporate}, #{timeRecord}, #{ifPublicity}, #{checkStatus}, #{patentType}, #{pubicityUrl},
  557. #{processStatus}, #{memberType}, #{pictureUrl}, #{satisfactionDegree}, #{satisfactionDegreeUrl},
  558. #{examineType}, #{approval}, #{completeDate}, #{completeStatus}, #{scoreStatus}, #{scoreNumber})
  559. </insert>
  560. <insert id="insertBatch">
  561. insert into t_order_task(order_no, main, super_id, commodity_id, commodity_name, commodity_quantity,
  562. commodity_mode, commodity_price, task_status, task_distribution_time, task_allocator, task_receiver,
  563. task_comment, task_start_time, task_end_time, attachment_url, project_status, accept_time, review_time,
  564. publicity_time, licence_time, certificate_number, status, form_retrieve, task_refund, refund_content,
  565. retrieve_content, declare_user, declare_pwd, set_up_amount, arrival_money, outsource_name, outsource_price,
  566. consultant_id, manager_id, outsource, split_super, split_status, split_id, split_aid, split_time, cname,
  567. receiver_name, declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
  568. high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
  569. time_record, if_publicity, check_status, patent_type, pubicity_url, process_status, member_type, picture_url,
  570. satisfaction_degree, satisfaction_degree_url, examine_type, approval, complete_date, complete_status,
  571. score_status, score_number)
  572. values
  573. <foreach collection="entities" item="entity" separator=",">
  574. (#{entity.orderNo}, #{entity.main}, #{entity.superId}, #{entity.commodityId}, #{entity.commodityName},
  575. #{entity.commodityQuantity}, #{entity.commodityMode}, #{entity.commodityPrice}, #{entity.taskStatus},
  576. #{entity.taskDistributionTime}, #{entity.taskAllocator}, #{entity.taskReceiver}, #{entity.taskComment},
  577. #{entity.taskStartTime}, #{entity.taskEndTime}, #{entity.attachmentUrl}, #{entity.projectStatus},
  578. #{entity.acceptTime}, #{entity.reviewTime}, #{entity.publicityTime}, #{entity.licenceTime},
  579. #{entity.certificateNumber}, #{entity.status}, #{entity.formRetrieve}, #{entity.taskRefund},
  580. #{entity.refundContent}, #{entity.retrieveContent}, #{entity.declareUser}, #{entity.declarePwd},
  581. #{entity.setUpAmount}, #{entity.arrivalMoney}, #{entity.outsourceName}, #{entity.outsourcePrice},
  582. #{entity.consultantId}, #{entity.managerId}, #{entity.outsource}, #{entity.splitSuper},
  583. #{entity.splitStatus}, #{entity.splitId}, #{entity.splitAid}, #{entity.splitTime}, #{entity.cname},
  584. #{entity.receiverName}, #{entity.declarationBatch}, #{entity.costReduction}, #{entity.officialCost},
  585. #{entity.setUpStatus}, #{entity.setUpTime}, #{entity.spotCheckStatus}, #{entity.highTechStatus},
  586. #{entity.specialComment}, #{entity.ifCertificationFee}, #{entity.certificationFee},
  587. #{entity.certificationCorporate}, #{entity.timeRecord}, #{entity.ifPublicity}, #{entity.checkStatus},
  588. #{entity.patentType}, #{entity.pubicityUrl}, #{entity.processStatus}, #{entity.memberType},
  589. #{entity.pictureUrl}, #{entity.satisfactionDegree}, #{entity.satisfactionDegreeUrl}, #{entity.examineType},
  590. #{entity.approval}, #{entity.completeDate}, #{entity.completeStatus}, #{entity.scoreStatus},
  591. #{entity.scoreNumber})
  592. </foreach>
  593. </insert>
  594. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  595. insert into t_order_task(order_no, main, super_id, commodity_id, commodity_name, commodity_quantity,
  596. commodity_mode, commodity_price, task_status, task_distribution_time, task_allocator, task_receiver,
  597. task_comment, task_start_time, task_end_time, attachment_url, project_status, accept_time, review_time,
  598. publicity_time, licence_time, certificate_number, status, form_retrieve, task_refund, refund_content,
  599. retrieve_content, declare_user, declare_pwd, set_up_amount, arrival_money, outsource_name, outsource_price,
  600. consultant_id, manager_id, outsource, split_super, split_status, split_id, split_aid, split_time, cname,
  601. receiver_name, declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
  602. high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
  603. time_record, if_publicity, check_status, patent_type, pubicity_url, process_status, member_type, picture_url,
  604. satisfaction_degree, satisfaction_degree_url, examine_type, approval, complete_date, complete_status,
  605. score_status, score_number)
  606. values
  607. <foreach collection="entities" item="entity" separator=",">
  608. (#{entity.orderNo}, #{entity.main}, #{entity.superId}, #{entity.commodityId}, #{entity.commodityName},
  609. #{entity.commodityQuantity}, #{entity.commodityMode}, #{entity.commodityPrice}, #{entity.taskStatus},
  610. #{entity.taskDistributionTime}, #{entity.taskAllocator}, #{entity.taskReceiver}, #{entity.taskComment},
  611. #{entity.taskStartTime}, #{entity.taskEndTime}, #{entity.attachmentUrl}, #{entity.projectStatus},
  612. #{entity.acceptTime}, #{entity.reviewTime}, #{entity.publicityTime}, #{entity.licenceTime},
  613. #{entity.certificateNumber}, #{entity.status}, #{entity.formRetrieve}, #{entity.taskRefund},
  614. #{entity.refundContent}, #{entity.retrieveContent}, #{entity.declareUser}, #{entity.declarePwd},
  615. #{entity.setUpAmount}, #{entity.arrivalMoney}, #{entity.outsourceName}, #{entity.outsourcePrice},
  616. #{entity.consultantId}, #{entity.managerId}, #{entity.outsource}, #{entity.splitSuper},
  617. #{entity.splitStatus}, #{entity.splitId}, #{entity.splitAid}, #{entity.splitTime}, #{entity.cname},
  618. #{entity.receiverName}, #{entity.declarationBatch}, #{entity.costReduction}, #{entity.officialCost},
  619. #{entity.setUpStatus}, #{entity.setUpTime}, #{entity.spotCheckStatus}, #{entity.highTechStatus},
  620. #{entity.specialComment}, #{entity.ifCertificationFee}, #{entity.certificationFee},
  621. #{entity.certificationCorporate}, #{entity.timeRecord}, #{entity.ifPublicity}, #{entity.checkStatus},
  622. #{entity.patentType}, #{entity.pubicityUrl}, #{entity.processStatus}, #{entity.memberType},
  623. #{entity.pictureUrl}, #{entity.satisfactionDegree}, #{entity.satisfactionDegreeUrl}, #{entity.examineType},
  624. #{entity.approval}, #{entity.completeDate}, #{entity.completeStatus}, #{entity.scoreStatus},
  625. #{entity.scoreNumber})
  626. </foreach>
  627. on duplicate key update
  628. order_no = values(order_no),
  629. main = values(main),
  630. super_id = values(super_id),
  631. commodity_id = values(commodity_id),
  632. commodity_name = values(commodity_name),
  633. commodity_quantity = values(commodity_quantity),
  634. commodity_mode = values(commodity_mode),
  635. commodity_price = values(commodity_price),
  636. task_status = values(task_status),
  637. task_distribution_time = values(task_distribution_time),
  638. task_allocator = values(task_allocator),
  639. task_receiver = values(task_receiver),
  640. task_comment = values(task_comment),
  641. task_start_time = values(task_start_time),
  642. task_end_time = values(task_end_time),
  643. attachment_url = values(attachment_url),
  644. project_status = values(project_status),
  645. accept_time = values(accept_time),
  646. review_time = values(review_time),
  647. publicity_time = values(publicity_time),
  648. licence_time = values(licence_time),
  649. certificate_number = values(certificate_number),
  650. status = values(status),
  651. form_retrieve = values(form_retrieve),
  652. task_refund = values(task_refund),
  653. refund_content = values(refund_content),
  654. retrieve_content = values(retrieve_content),
  655. declare_user = values(declare_user),
  656. declare_pwd = values(declare_pwd),
  657. set_up_amount = values(set_up_amount),
  658. arrival_money = values(arrival_money),
  659. outsource_name = values(outsource_name),
  660. outsource_price = values(outsource_price),
  661. consultant_id = values(consultant_id),
  662. manager_id = values(manager_id),
  663. outsource = values(outsource),
  664. split_super = values(split_super),
  665. split_status = values(split_status),
  666. split_id = values(split_id),
  667. split_aid = values(split_aid),
  668. split_time = values(split_time),
  669. cname = values(cname),
  670. receiver_name = values(receiver_name),
  671. declaration_batch = values(declaration_batch),
  672. cost_reduction = values(cost_reduction),
  673. official_cost = values(official_cost),
  674. set_up_status = values(set_up_status),
  675. set_up_time = values(set_up_time),
  676. spot_check_status = values(spot_check_status),
  677. high_tech_status = values(high_tech_status),
  678. special_comment = values(special_comment),
  679. if_certification_fee = values(if_certification_fee),
  680. certification_fee = values(certification_fee),
  681. certification_corporate = values(certification_corporate),
  682. time_record = values(time_record),
  683. if_publicity = values(if_publicity),
  684. check_status = values(check_status),
  685. patent_type = values(patent_type),
  686. pubicity_url = values(pubicity_url),
  687. process_status = values(process_status),
  688. member_type = values(member_type),
  689. picture_url = values(picture_url),
  690. satisfaction_degree = values(satisfaction_degree),
  691. satisfaction_degree_url = values(satisfaction_degree_url),
  692. examine_type = values(examine_type),
  693. approval = values(approval),
  694. complete_date = values(complete_date),
  695. complete_status = values(complete_status),
  696. score_status = values(score_status),
  697. score_number = values(score_number)
  698. </insert>
  699. <!--通过主键修改数据-->
  700. <update id="update">
  701. update t_order_task
  702. <set>
  703. <if test="orderNo != null and orderNo != ''">
  704. order_no = #{orderNo},
  705. </if>
  706. <if test="main != null">
  707. main = #{main},
  708. </if>
  709. <if test="superId != null and superId != ''">
  710. super_id = #{superId},
  711. </if>
  712. <if test="commodityId != null and commodityId != ''">
  713. commodity_id = #{commodityId},
  714. </if>
  715. <if test="commodityName != null and commodityName != ''">
  716. commodity_name = #{commodityName},
  717. </if>
  718. <if test="commodityQuantity != null">
  719. commodity_quantity = #{commodityQuantity},
  720. </if>
  721. <if test="commodityMode != null and commodityMode != ''">
  722. commodity_mode = #{commodityMode},
  723. </if>
  724. <if test="commodityPrice != null">
  725. commodity_price = #{commodityPrice},
  726. </if>
  727. <if test="taskStatus != null">
  728. task_status = #{taskStatus},
  729. </if>
  730. <if test="taskDistributionTime != null">
  731. task_distribution_time = #{taskDistributionTime},
  732. </if>
  733. <if test="taskAllocator != null and taskAllocator != ''">
  734. task_allocator = #{taskAllocator},
  735. </if>
  736. <if test="taskReceiver != null and taskReceiver != ''">
  737. task_receiver = #{taskReceiver},
  738. </if>
  739. <if test="taskComment != null and taskComment != ''">
  740. task_comment = #{taskComment},
  741. </if>
  742. <if test="taskStartTime != null">
  743. task_start_time = #{taskStartTime},
  744. </if>
  745. <if test="taskEndTime != null">
  746. task_end_time = #{taskEndTime},
  747. </if>
  748. <if test="attachmentUrl != null and attachmentUrl != ''">
  749. attachment_url = #{attachmentUrl},
  750. </if>
  751. <if test="projectStatus != null">
  752. project_status = #{projectStatus},
  753. </if>
  754. <if test="acceptTime != null">
  755. accept_time = #{acceptTime},
  756. </if>
  757. <if test="reviewTime != null">
  758. review_time = #{reviewTime},
  759. </if>
  760. <if test="publicityTime != null">
  761. publicity_time = #{publicityTime},
  762. </if>
  763. <if test="licenceTime != null">
  764. licence_time = #{licenceTime},
  765. </if>
  766. <if test="certificateNumber != null and certificateNumber != ''">
  767. certificate_number = #{certificateNumber},
  768. </if>
  769. <if test="status != null">
  770. status = #{status},
  771. </if>
  772. <if test="formRetrieve != null">
  773. form_retrieve = #{formRetrieve},
  774. </if>
  775. <if test="taskRefund != null">
  776. task_refund = #{taskRefund},
  777. </if>
  778. <if test="refundContent != null and refundContent != ''">
  779. refund_content = #{refundContent},
  780. </if>
  781. <if test="retrieveContent != null and retrieveContent != ''">
  782. retrieve_content = #{retrieveContent},
  783. </if>
  784. <if test="declareUser != null and declareUser != ''">
  785. declare_user = #{declareUser},
  786. </if>
  787. <if test="declarePwd != null and declarePwd != ''">
  788. declare_pwd = #{declarePwd},
  789. </if>
  790. <if test="setUpAmount != null">
  791. set_up_amount = #{setUpAmount},
  792. </if>
  793. <if test="arrivalMoney != null">
  794. arrival_money = #{arrivalMoney},
  795. </if>
  796. <if test="outsourceName != null and outsourceName != ''">
  797. outsource_name = #{outsourceName},
  798. </if>
  799. <if test="outsourcePrice != null">
  800. outsource_price = #{outsourcePrice},
  801. </if>
  802. <if test="consultantId != null and consultantId != ''">
  803. consultant_id = #{consultantId},
  804. </if>
  805. <if test="managerId != null and managerId != ''">
  806. manager_id = #{managerId},
  807. </if>
  808. <if test="outsource != null">
  809. outsource = #{outsource},
  810. </if>
  811. <if test="splitSuper != null">
  812. split_super = #{splitSuper},
  813. </if>
  814. <if test="splitStatus != null">
  815. split_status = #{splitStatus},
  816. </if>
  817. <if test="splitId != null">
  818. split_id = #{splitId},
  819. </if>
  820. <if test="splitAid != null and splitAid != ''">
  821. split_aid = #{splitAid},
  822. </if>
  823. <if test="splitTime != null">
  824. split_time = #{splitTime},
  825. </if>
  826. <if test="cname != null and cname != ''">
  827. cname = #{cname},
  828. </if>
  829. <if test="receiverName != null and receiverName != ''">
  830. receiver_name = #{receiverName},
  831. </if>
  832. <if test="declarationBatch != null">
  833. declaration_batch = #{declarationBatch},
  834. </if>
  835. <if test="costReduction != null">
  836. cost_reduction = #{costReduction},
  837. </if>
  838. <if test="officialCost != null">
  839. official_cost = #{officialCost},
  840. </if>
  841. <if test="setUpStatus != null">
  842. set_up_status = #{setUpStatus},
  843. </if>
  844. <if test="setUpTime != null">
  845. set_up_time = #{setUpTime},
  846. </if>
  847. <if test="spotCheckStatus != null">
  848. spot_check_status = #{spotCheckStatus},
  849. </if>
  850. <if test="highTechStatus != null">
  851. high_tech_status = #{highTechStatus},
  852. </if>
  853. <if test="specialComment != null and specialComment != ''">
  854. special_comment = #{specialComment},
  855. </if>
  856. <if test="ifCertificationFee != null">
  857. if_certification_fee = #{ifCertificationFee},
  858. </if>
  859. <if test="certificationFee != null">
  860. certification_fee = #{certificationFee},
  861. </if>
  862. <if test="certificationCorporate != null and certificationCorporate != ''">
  863. certification_corporate = #{certificationCorporate},
  864. </if>
  865. <if test="timeRecord != null and timeRecord != ''">
  866. time_record = #{timeRecord},
  867. </if>
  868. <if test="ifPublicity != null">
  869. if_publicity = #{ifPublicity},
  870. </if>
  871. <if test="checkStatus != null">
  872. check_status = #{checkStatus},
  873. </if>
  874. <if test="patentType != null">
  875. patent_type = #{patentType},
  876. </if>
  877. <if test="pubicityUrl != null and pubicityUrl != ''">
  878. pubicity_url = #{pubicityUrl},
  879. </if>
  880. <if test="processStatus != null">
  881. process_status = #{processStatus},
  882. </if>
  883. <if test="memberType != null">
  884. member_type = #{memberType},
  885. </if>
  886. <if test="pictureUrl != null and pictureUrl != ''">
  887. picture_url = #{pictureUrl},
  888. </if>
  889. <if test="satisfactionDegree != null">
  890. satisfaction_degree = #{satisfactionDegree},
  891. </if>
  892. <if test="satisfactionDegreeUrl != null and satisfactionDegreeUrl != ''">
  893. satisfaction_degree_url = #{satisfactionDegreeUrl},
  894. </if>
  895. <if test="examineType != null">
  896. examine_type = #{examineType},
  897. </if>
  898. <if test="approval != null">
  899. approval = #{approval},
  900. </if>
  901. <if test="completeDate != null">
  902. complete_date = #{completeDate},
  903. </if>
  904. <if test="completeStatus != null">
  905. complete_status = #{completeStatus},
  906. </if>
  907. <if test="scoreStatus != null">
  908. score_status = #{scoreStatus},
  909. </if>
  910. <if test="scoreNumber != null">
  911. score_number = #{scoreNumber},
  912. </if>
  913. </set>
  914. where id = #{id}
  915. </update>
  916. <!--通过主键删除-->
  917. <delete id="deleteById">
  918. delete
  919. from t_order_task
  920. where id = #{id}
  921. </delete>
  922. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  923. insert into t_order_task
  924. <trim prefix="(" suffix=")" suffixOverrides=",">
  925. <if test="orderNo != null">
  926. order_no,
  927. </if>
  928. <if test="main != null">
  929. main,
  930. </if>
  931. <if test="superId != null">
  932. super_id,
  933. </if>
  934. <if test="commodityId != null">
  935. commodity_id,
  936. </if>
  937. <if test="commodityName != null">
  938. commodity_name,
  939. </if>
  940. <if test="commodityQuantity != null">
  941. commodity_quantity,
  942. </if>
  943. <if test="commodityMode != null">
  944. commodity_mode,
  945. </if>
  946. <if test="commodityPrice != null">
  947. commodity_price,
  948. </if>
  949. <if test="taskStatus != null">
  950. task_status,
  951. </if>
  952. <if test="taskDistributionTime != null">
  953. task_distribution_time,
  954. </if>
  955. <if test="taskAllocator != null">
  956. task_allocator,
  957. </if>
  958. <if test="taskReceiver != null">
  959. task_receiver,
  960. </if>
  961. <if test="taskComment != null">
  962. task_comment,
  963. </if>
  964. <if test="taskStartTime != null">
  965. task_start_time,
  966. </if>
  967. <if test="taskEndTime != null">
  968. task_end_time,
  969. </if>
  970. <if test="attachmentUrl != null">
  971. attachment_url,
  972. </if>
  973. <if test="projectStatus != null">
  974. project_status,
  975. </if>
  976. <if test="acceptTime != null">
  977. accept_time,
  978. </if>
  979. <if test="reviewTime != null">
  980. review_time,
  981. </if>
  982. <if test="publicityTime != null">
  983. publicity_time,
  984. </if>
  985. <if test="licenceTime != null">
  986. licence_time,
  987. </if>
  988. <if test="certificateNumber != null">
  989. certificate_number,
  990. </if>
  991. <if test="status != null">
  992. `status`,
  993. </if>
  994. <if test="formRetrieve != null">
  995. form_retrieve,
  996. </if>
  997. <if test="taskRefund != null">
  998. task_refund,
  999. </if>
  1000. <if test="refundContent != null">
  1001. refund_content,
  1002. </if>
  1003. <if test="retrieveContent != null">
  1004. retrieve_content,
  1005. </if>
  1006. <if test="declareUser != null">
  1007. declare_user,
  1008. </if>
  1009. <if test="declarePwd != null">
  1010. declare_pwd,
  1011. </if>
  1012. <if test="setUpAmount != null">
  1013. set_up_amount,
  1014. </if>
  1015. <if test="arrivalMoney != null">
  1016. arrival_money,
  1017. </if>
  1018. <if test="outsourceName != null">
  1019. outsource_name,
  1020. </if>
  1021. <if test="outsourcePrice != null">
  1022. outsource_price,
  1023. </if>
  1024. <if test="consultantId != null">
  1025. consultant_id,
  1026. </if>
  1027. <if test="managerId != null">
  1028. manager_id,
  1029. </if>
  1030. <if test="outsource != null">
  1031. outsource,
  1032. </if>
  1033. <if test="splitSuper != null">
  1034. split_super,
  1035. </if>
  1036. <if test="splitStatus != null">
  1037. split_status,
  1038. </if>
  1039. <if test="splitId != null">
  1040. split_id,
  1041. </if>
  1042. <if test="splitAid != null">
  1043. split_aid,
  1044. </if>
  1045. <if test="splitTime != null">
  1046. split_time,
  1047. </if>
  1048. <if test="cname != null">
  1049. cname,
  1050. </if>
  1051. <if test="receiverName != null">
  1052. receiver_name,
  1053. </if>
  1054. <if test="declarationBatch != null">
  1055. declaration_batch,
  1056. </if>
  1057. <if test="costReduction != null">
  1058. cost_reduction,
  1059. </if>
  1060. <if test="officialCost != null">
  1061. official_cost,
  1062. </if>
  1063. <if test="setUpStatus != null">
  1064. set_up_status,
  1065. </if>
  1066. <if test="setUpTime != null">
  1067. set_up_time,
  1068. </if>
  1069. <if test="spotCheckStatus != null">
  1070. spot_check_status,
  1071. </if>
  1072. <if test="highTechStatus != null">
  1073. high_tech_status,
  1074. </if>
  1075. <if test="specialComment != null">
  1076. special_comment,
  1077. </if>
  1078. <if test="ifCertificationFee != null">
  1079. if_certification_fee,
  1080. </if>
  1081. <if test="certificationFee != null">
  1082. certification_fee,
  1083. </if>
  1084. <if test="certificationCorporate != null">
  1085. certification_corporate,
  1086. </if>
  1087. <if test="timeRecord != null">
  1088. time_record,
  1089. </if>
  1090. <if test="ifPublicity != null">
  1091. if_publicity,
  1092. </if>
  1093. <if test="checkStatus != null">
  1094. check_status,
  1095. </if>
  1096. <if test="patentType != null">
  1097. patent_type,
  1098. </if>
  1099. <if test="pubicityUrl != null">
  1100. pubicity_url,
  1101. </if>
  1102. <if test="processStatus != null">
  1103. process_status,
  1104. </if>
  1105. <if test="memberType != null">
  1106. member_type,
  1107. </if>
  1108. <if test="pictureUrl != null">
  1109. picture_url,
  1110. </if>
  1111. <if test="satisfactionDegree != null">
  1112. satisfaction_degree,
  1113. </if>
  1114. <if test="satisfactionDegreeUrl != null">
  1115. satisfaction_degree_url,
  1116. </if>
  1117. <if test="examineType != null">
  1118. examine_type,
  1119. </if>
  1120. <if test="approval != null">
  1121. approval,
  1122. </if>
  1123. <if test="completeDate != null">
  1124. complete_date,
  1125. </if>
  1126. <if test="completeStatus != null">
  1127. complete_status ,
  1128. </if>
  1129. <if test="scoreStatus != null">
  1130. score_status ,
  1131. </if>
  1132. <if test="scoreNumber != null">
  1133. score_number ,
  1134. </if>
  1135. </trim>
  1136. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1137. <if test="orderNo != null">
  1138. #{orderNo,jdbcType=VARCHAR},
  1139. </if>
  1140. <if test="main != null">
  1141. #{main,jdbcType=INTEGER},
  1142. </if>
  1143. <if test="superId != null">
  1144. #{superId,jdbcType=VARCHAR},
  1145. </if>
  1146. <if test="commodityId != null">
  1147. #{commodityId,jdbcType=VARCHAR},
  1148. </if>
  1149. <if test="commodityName != null">
  1150. #{commodityName,jdbcType=VARCHAR},
  1151. </if>
  1152. <if test="commodityQuantity != null">
  1153. #{commodityQuantity,jdbcType=INTEGER},
  1154. </if>
  1155. <if test="commodityMode != null">
  1156. #{commodityMode,jdbcType=VARCHAR},
  1157. </if>
  1158. <if test="commodityPrice != null">
  1159. #{commodityPrice,jdbcType=DECIMAL},
  1160. </if>
  1161. <if test="taskStatus != null">
  1162. #{taskStatus,jdbcType=INTEGER},
  1163. </if>
  1164. <if test="taskDistributionTime != null">
  1165. #{taskDistributionTime,jdbcType=TIMESTAMP},
  1166. </if>
  1167. <if test="taskAllocator != null">
  1168. #{taskAllocator,jdbcType=VARCHAR},
  1169. </if>
  1170. <if test="taskReceiver != null">
  1171. #{taskReceiver,jdbcType=VARCHAR},
  1172. </if>
  1173. <if test="taskComment != null">
  1174. #{taskComment,jdbcType=VARCHAR},
  1175. </if>
  1176. <if test="taskStartTime != null">
  1177. #{taskStartTime,jdbcType=TIMESTAMP},
  1178. </if>
  1179. <if test="taskEndTime != null">
  1180. #{taskEndTime,jdbcType=TIMESTAMP},
  1181. </if>
  1182. <if test="attachmentUrl != null">
  1183. #{attachmentUrl,jdbcType=VARCHAR},
  1184. </if>
  1185. <if test="projectStatus != null">
  1186. #{projectStatus,jdbcType=INTEGER},
  1187. </if>
  1188. <if test="acceptTime != null">
  1189. #{acceptTime,jdbcType=DATE},
  1190. </if>
  1191. <if test="reviewTime != null">
  1192. #{reviewTime,jdbcType=DATE},
  1193. </if>
  1194. <if test="publicityTime != null">
  1195. #{publicityTime,jdbcType=DATE},
  1196. </if>
  1197. <if test="licenceTime != null">
  1198. #{licenceTime,jdbcType=DATE},
  1199. </if>
  1200. <if test="certificateNumber != null">
  1201. #{certificateNumber,jdbcType=VARCHAR},
  1202. </if>
  1203. <if test="status != null">
  1204. #{status,jdbcType=INTEGER},
  1205. </if>
  1206. <if test="formRetrieve != null">
  1207. #{formRetrieve,jdbcType=INTEGER},
  1208. </if>
  1209. <if test="taskRefund != null">
  1210. #{taskRefund,jdbcType=INTEGER},
  1211. </if>
  1212. <if test="refundContent != null">
  1213. #{refundContent,jdbcType=VARCHAR},
  1214. </if>
  1215. <if test="retrieveContent != null">
  1216. #{retrieveContent,jdbcType=VARCHAR},
  1217. </if>
  1218. <if test="declareUser != null">
  1219. #{declareUser,jdbcType=VARCHAR},
  1220. </if>
  1221. <if test="declarePwd != null">
  1222. #{declarePwd,jdbcType=VARCHAR},
  1223. </if>
  1224. <if test="setUpAmount != null">
  1225. #{setUpAmount,jdbcType=DECIMAL},
  1226. </if>
  1227. <if test="arrivalMoney != null">
  1228. #{arrivalMoney,jdbcType=INTEGER},
  1229. </if>
  1230. <if test="outsourceName != null">
  1231. #{outsourceName,jdbcType=VARCHAR},
  1232. </if>
  1233. <if test="outsourcePrice != null">
  1234. #{outsourcePrice,jdbcType=DECIMAL},
  1235. </if>
  1236. <if test="consultantId != null">
  1237. #{consultantId,jdbcType=VARCHAR},
  1238. </if>
  1239. <if test="managerId != null">
  1240. #{managerId,jdbcType=VARCHAR},
  1241. </if>
  1242. <if test="outsource != null">
  1243. #{outsource,jdbcType=INTEGER},
  1244. </if>
  1245. <if test="splitSuper != null">
  1246. #{splitSuper,jdbcType=INTEGER},
  1247. </if>
  1248. <if test="splitStatus != null">
  1249. #{splitStatus,jdbcType=INTEGER},
  1250. </if>
  1251. <if test="splitId != null">
  1252. #{splitId,jdbcType=INTEGER},
  1253. </if>
  1254. <if test="splitAid != null">
  1255. #{splitAid,jdbcType=VARCHAR},
  1256. </if>
  1257. <if test="splitTime != null">
  1258. #{splitTime,jdbcType=TIMESTAMP},
  1259. </if>
  1260. <if test="cname != null">
  1261. #{cname,jdbcType=VARCHAR},
  1262. </if>
  1263. <if test="receiverName != null">
  1264. #{receiverName,jdbcType=VARCHAR},
  1265. </if>
  1266. <if test="declarationBatch != null">
  1267. #{declarationBatch,jdbcType=INTEGER},
  1268. </if>
  1269. <if test="costReduction != null">
  1270. #{costReduction,jdbcType=INTEGER},
  1271. </if>
  1272. <if test="officialCost != null">
  1273. #{officialCost,jdbcType=INTEGER},
  1274. </if>
  1275. <if test="setUpStatus != null">
  1276. #{setUpStatus,jdbcType=INTEGER},
  1277. </if>
  1278. <if test="setUpTime != null">
  1279. #{setUpTime,jdbcType=TIMESTAMP},
  1280. </if>
  1281. <if test="spotCheckStatus != null">
  1282. #{spotCheckStatus,jdbcType=INTEGER},
  1283. </if>
  1284. <if test="highTechStatus != null">
  1285. #{highTechStatus,jdbcType=INTEGER},
  1286. </if>
  1287. <if test="specialComment != null">
  1288. #{specialComment,jdbcType=VARCHAR},
  1289. </if>
  1290. <if test="ifCertificationFee != null">
  1291. #{ifCertificationFee,jdbcType=INTEGER},
  1292. </if>
  1293. <if test="certificationFee != null">
  1294. #{certificationFee,jdbcType=DECIMAL},
  1295. </if>
  1296. <if test="certificationCorporate != null">
  1297. #{certificationCorporate,jdbcType=VARCHAR},
  1298. </if>
  1299. <if test="timeRecord != null">
  1300. #{timeRecord,jdbcType=VARCHAR},
  1301. </if>
  1302. <if test="ifPublicity != null">
  1303. #{ifPublicity,jdbcType=INTEGER},
  1304. </if>
  1305. <if test="checkStatus != null">
  1306. #{checkStatus,jdbcType=INTEGER},
  1307. </if>
  1308. <if test="patentType != null">
  1309. #{patentType,jdbcType=INTEGER},
  1310. </if>
  1311. <if test="pubicityUrl != null">
  1312. #{pubicityUrl,jdbcType=VARCHAR},
  1313. </if>
  1314. <if test="processStatus != null">
  1315. #{processStatus,jdbcType=INTEGER},
  1316. </if>
  1317. <if test="memberType != null">
  1318. #{memberType,jdbcType=INTEGER},
  1319. </if>
  1320. <if test="pictureUrl != null">
  1321. #{pictureUrl,jdbcType=VARCHAR},
  1322. </if>
  1323. <if test="satisfactionDegree != null">
  1324. #{satisfactionDegree,jdbcType=INTEGER},
  1325. </if>
  1326. <if test="satisfactionDegreeUrl != null">
  1327. #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  1328. </if>
  1329. <if test="examineType != null">
  1330. #{examineType,jdbcType=INTEGER},
  1331. </if>
  1332. <if test="approval != null">
  1333. #{approval,jdbcType=INTEGER},
  1334. </if>
  1335. <if test="completeDate != null">
  1336. #{completeDate},
  1337. </if>
  1338. <if test="completeStatus != null">
  1339. #{completeStatus},
  1340. </if>
  1341. <if test="scoreStatus != null">
  1342. #{scoreStatus},
  1343. </if>
  1344. <if test="scoreNumber != null">
  1345. #{scoreNumber},
  1346. </if>
  1347. </trim>
  1348. </insert>
  1349. <update id="updateBySuperId">
  1350. update t_order_task
  1351. <set>
  1352. <if test="orderNo != null">
  1353. order_no = #{orderNo,jdbcType=VARCHAR},
  1354. </if>
  1355. <if test="main != null">
  1356. main = #{main,jdbcType=INTEGER},
  1357. </if>
  1358. <if test="superId != null">
  1359. super_id = #{superId,jdbcType=VARCHAR},
  1360. </if>
  1361. <if test="commodityId != null">
  1362. commodity_id = #{commodityId,jdbcType=VARCHAR},
  1363. </if>
  1364. <if test="commodityName != null">
  1365. commodity_name = #{commodityName,jdbcType=VARCHAR},
  1366. </if>
  1367. <if test="commodityQuantity != null">
  1368. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  1369. </if>
  1370. <if test="commodityMode != null">
  1371. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  1372. </if>
  1373. <if test="commodityPrice != null">
  1374. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  1375. </if>
  1376. <if test="taskStatus != null">
  1377. task_status = #{taskStatus,jdbcType=INTEGER},
  1378. </if>
  1379. <if test="taskDistributionTime != null">
  1380. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  1381. </if>
  1382. <if test="taskAllocator != null">
  1383. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  1384. </if>
  1385. <if test="taskReceiver != null">
  1386. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  1387. </if>
  1388. <if test="taskComment != null">
  1389. task_comment = #{taskComment,jdbcType=VARCHAR},
  1390. </if>
  1391. <if test="taskStartTime != null">
  1392. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  1393. </if>
  1394. <if test="taskEndTime != null">
  1395. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  1396. </if>
  1397. <if test="attachmentUrl != null">
  1398. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  1399. </if>
  1400. <if test="projectStatus != null">
  1401. project_status = #{projectStatus,jdbcType=INTEGER},
  1402. </if>
  1403. <if test="acceptTime != null">
  1404. accept_time = #{acceptTime,jdbcType=DATE},
  1405. </if>
  1406. <if test="reviewTime != null">
  1407. review_time = #{reviewTime,jdbcType=DATE},
  1408. </if>
  1409. <if test="publicityTime != null">
  1410. publicity_time = #{publicityTime,jdbcType=DATE},
  1411. </if>
  1412. <if test="licenceTime != null">
  1413. licence_time = #{licenceTime,jdbcType=DATE},
  1414. </if>
  1415. <if test="certificateNumber != null">
  1416. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  1417. </if>
  1418. <if test="status != null">
  1419. `status` = #{status,jdbcType=INTEGER},
  1420. </if>
  1421. <if test="formRetrieve != null">
  1422. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  1423. </if>
  1424. <if test="taskRefund != null">
  1425. task_refund = #{taskRefund,jdbcType=INTEGER},
  1426. </if>
  1427. <if test="refundContent != null">
  1428. refund_content = #{refundContent,jdbcType=VARCHAR},
  1429. </if>
  1430. <if test="retrieveContent != null">
  1431. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  1432. </if>
  1433. <if test="declareUser != null">
  1434. declare_user = #{declareUser,jdbcType=VARCHAR},
  1435. </if>
  1436. <if test="declarePwd != null">
  1437. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  1438. </if>
  1439. <if test="setUpAmount != null">
  1440. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  1441. </if>
  1442. <if test="arrivalMoney != null">
  1443. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  1444. </if>
  1445. <if test="outsourceName != null">
  1446. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  1447. </if>
  1448. <if test="outsourcePrice != null">
  1449. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  1450. </if>
  1451. <if test="consultantId != null">
  1452. consultant_id = #{consultantId,jdbcType=VARCHAR},
  1453. </if>
  1454. <if test="managerId != null">
  1455. manager_id = #{managerId,jdbcType=VARCHAR},
  1456. </if>
  1457. <if test="outsource != null">
  1458. outsource = #{outsource,jdbcType=INTEGER},
  1459. </if>
  1460. <if test="splitStatus != null">
  1461. split_status = #{splitStatus,jdbcType=INTEGER},
  1462. </if>
  1463. <if test="splitId != null">
  1464. split_id = #{splitId,jdbcType=INTEGER},
  1465. </if>
  1466. <if test="splitAid != null">
  1467. split_aid = #{splitAid,jdbcType=VARCHAR},
  1468. </if>
  1469. <if test="splitTime != null">
  1470. split_time = #{splitTime,jdbcType=TIMESTAMP},
  1471. </if>
  1472. <if test="cname != null">
  1473. cname = #{cname,jdbcType=VARCHAR},
  1474. </if>
  1475. <if test="receiverName != null">
  1476. receiver_name = #{receiverName,jdbcType=VARCHAR},
  1477. </if>
  1478. <if test="declarationBatch != null">
  1479. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  1480. </if>
  1481. <if test="costReduction != null">
  1482. cost_reduction = #{costReduction,jdbcType=INTEGER},
  1483. </if>
  1484. <if test="officialCost != null">
  1485. official_cost = #{officialCost,jdbcType=INTEGER},
  1486. </if>
  1487. <if test="setUpStatus != null">
  1488. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  1489. </if>
  1490. <if test="setUpTime != null">
  1491. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  1492. </if>
  1493. <if test="spotCheckStatus != null">
  1494. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  1495. </if>
  1496. <if test="highTechStatus != null">
  1497. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  1498. </if>
  1499. <if test="specialComment != null">
  1500. special_comment = #{specialComment,jdbcType=VARCHAR},
  1501. </if>
  1502. <if test="ifCertificationFee != null">
  1503. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  1504. </if>
  1505. <if test="certificationFee != null">
  1506. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  1507. </if>
  1508. <if test="certificationCorporate != null">
  1509. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  1510. </if>
  1511. <if test="timeRecord != null">
  1512. time_record = #{timeRecord,jdbcType=VARCHAR},
  1513. </if>
  1514. <if test="ifPublicity != null">
  1515. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  1516. </if>
  1517. <if test="checkStatus != null">
  1518. check_status = #{checkStatus,jdbcType=INTEGER},
  1519. </if>
  1520. <if test="patentType != null">
  1521. patent_type = #{patentType,jdbcType=INTEGER},
  1522. </if>
  1523. <if test="pubicityUrl != null">
  1524. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
  1525. </if>
  1526. <if test="processStatus != null">
  1527. process_status = #{processStatus,jdbcType=INTEGER},
  1528. </if>
  1529. <if test="memberType != null">
  1530. member_type = #{memberType,jdbcType=INTEGER},
  1531. </if>
  1532. <if test="pictureUrl != null">
  1533. picture_url = #{pictureUrl,jdbcType=VARCHAR},
  1534. </if>
  1535. <if test="satisfactionDegree != null">
  1536. satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
  1537. </if>
  1538. <if test="satisfactionDegreeUrl != null">
  1539. satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  1540. </if>
  1541. <if test="scoreStatus != null">
  1542. score_status = #{scoreStatus},
  1543. </if>
  1544. <if test="scoreNumber != null">
  1545. score_number = #{scoreNumber},
  1546. </if>
  1547. </set>
  1548. where split_super = #{splitSuper,jdbcType=INTEGER}
  1549. </update>
  1550. <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1551. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
  1552. a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
  1553. e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1554. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,b.patent_transfer patentTransfer ,
  1555. i.price,a.certificate_number as certificateNumber, a.commodity_id as commodityId,a.manager_id managerId,
  1556. a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,j.contract_term contractTerm,
  1557. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,ttm.stop_type stopType,ttm.stop_status stopStatus,
  1558. a.task_receiver as taskReceiver ,a.if_certification_fee ifCertificationFee , a.split_status splitStatus,
  1559. a.cost_reduction costReduction,a.official_cost officialCost,i.`type` ,d.name ,a.declaration_batch declarationBatch,
  1560. a.patent_type patentType,a.picture_url pictureUrl,j.service_life serviceLife ,j.service_year serviceYear,j.year_sum yearSum,ttm.change,
  1561. ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,ttm.stop_status projectStopStatus
  1562. from t_order_task a left join business_project b on a.commodity_id=b.id left join t_order_new e on a.order_no=e.order_no
  1563. left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
  1564. left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id
  1565. left join admin d on a.task_receiver=d.id left join t_task_member j on a.id =j.tid
  1566. left join t_task_mid ttm on a.id=ttm.tid
  1567. where a.super_id is null and a.split_status in(0,1)
  1568. <if test="orderNo != null">
  1569. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1570. </if>
  1571. <if test="type == 1">
  1572. and a.process_status in(0,3)
  1573. </if>
  1574. order by a.id
  1575. </select>
  1576. <select id="selectOrderTaskAll" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1577. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,a.outsource,
  1578. a.outsource_price outsourcePrice,g.name depName,e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1579. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,a.receiver_name receiverName,
  1580. a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
  1581. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus, a.task_receiver as taskReceiver ,
  1582. a.split_status splitStatus,a.split_super splitSuper,a.split_aid splitAid,a.split_time splitTime,a.patent_type patentType,ttm.contract_term contractTerm,
  1583. a.picture_url pictureUrl, ttm.service_life serviceLife ,ttm.service_year serviceYear,ttm.year_sum yearSum,
  1584. tm.last_year lastYear,tm.last_year_capital lastYearCapital,tm.last_year_income lastYearIncome
  1585. from t_order_task a left join t_order_new e on a.order_no=e.order_no left join admin f on e.salesman_id=f.id
  1586. left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id left join business_project i on a.commodity_id=i.id
  1587. left join business_category c on i.cid=c.id left join admin d on a.task_receiver=d.id
  1588. left join t_task_member ttm on a.id=ttm.tid left join t_task_mid tm on a.id=tm.tid
  1589. where a.super_id is null and a.process_status in (0,3) and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1590. <if test="splitStatus !=null">
  1591. <if test="splitStatus &lt; 3">
  1592. and a.split_status= #{splitStatus}
  1593. </if>
  1594. <if test="splitStatus ==3">
  1595. and a.split_status in(0,1)
  1596. </if>
  1597. <if test="splitStatus ==4">
  1598. and a.split_status in(0,2)
  1599. </if>
  1600. </if>
  1601. order by a.id
  1602. </select>
  1603. <select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1604. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,a.receiver_name receiverName,a.project_status projectStatus,e.contract_no contractNo,
  1605. a.task_receiver taskReceiver,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S') as taskDate, a.commodity_quantity as commodityQuantity,
  1606. e.approval,l.refund_status outsourceStatus,l.start_type outsourceType,ttm.certificates_count alreadyNumber,f.nickname as userName,h.name as depName, l.company_name as outsourceName ,
  1607. ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId,b.`type` projectType,ttm.cost_amount costAmount,tm.salesman_name salesmanName ,
  1608. ttm.party_amount partyAmount,a.commodity_price commodityPrice,a.outsource,date_format(a.task_end_time,'%Y-%m-%d') taskEndTime,date_format(e.sign_time,'%Y-%m-%d') signTime,
  1609. date_format(e.create_time ,'%Y-%m-%d')creteTime,a.patent_type patentType,tmer.service_year serviceYear,toa.type,toa.type_explain typeExplain
  1610. from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1611. left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id left join t_order_mid tm on a.order_no =tm.order_no
  1612. left join department h on e.order_dep=h.id left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
  1613. on a.id=l.tid left join t_task_mid ttm on a.id=ttm.tid left join t_task_member tmer on a.id=tmer.tid
  1614. left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1615. from t_order_approval group by order_no) toa on e.order_no=toa.order_no
  1616. <if test="type !=null">
  1617. inner join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1618. from t_order_approval
  1619. where `type` in
  1620. <foreach collection="type" item="item" separator="," open="(" close=")">
  1621. #{item}
  1622. </foreach>
  1623. group by order_no) toa2 on e.order_no=toa2.order_no
  1624. </if>
  1625. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1626. and a.outsource= #{outsource,jdbcType=INTEGER}
  1627. <include refid="selectOrderTaskListSql"/>
  1628. order by a.task_distribution_time desc
  1629. <if test="page_sql!=null">
  1630. ${page_sql}
  1631. </if>
  1632. </select>
  1633. <sql id="selectOrderTaskListSql">
  1634. <if test="role == 0 ">
  1635. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1636. </if>
  1637. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1638. and e.finance_id in
  1639. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1640. #{item}
  1641. </foreach>
  1642. </if>
  1643. <if test="specially == 0 ">
  1644. and a.split_status in (0,2)
  1645. </if>
  1646. <if test="orderNo != null">
  1647. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1648. </if>
  1649. <if test="approval ==0">
  1650. and e.approval = 0
  1651. </if>
  1652. <if test="approval ==1">
  1653. and e.approval in(1,2)
  1654. </if>
  1655. <if test="approval ==2">
  1656. and e.approval in (4,5)
  1657. </if>
  1658. <if test="cid != null">
  1659. and c.id = #{cid}
  1660. </if>
  1661. <if test="outsourceStatus !=null">
  1662. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1663. </if>
  1664. <if test="contractNo != null">
  1665. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1666. </if>
  1667. <if test="projectStatus != null">
  1668. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1669. </if>
  1670. <if test="deps != null">
  1671. and e.order_dep in
  1672. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  1673. #{depId}
  1674. </foreach>
  1675. </if>
  1676. <if test="name != null">
  1677. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1678. </if>
  1679. <if test="projectName != null">
  1680. and a.commodity_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
  1681. </if>
  1682. <if test="taskId != null">
  1683. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1684. </if>
  1685. <if test="taskStatus != null">
  1686. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1687. </if>
  1688. <if test="adminName != null">
  1689. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1690. </if>
  1691. <if test="startTime != null and endTime != null">
  1692. and e.sign_time between #{startTime} and #{endTime}
  1693. </if>
  1694. </sql>
  1695. <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
  1696. select count(*) from t_order_task a
  1697. left join t_order_new e on a.order_no=e.order_no
  1698. <if test="cid != null">
  1699. left join business_project b on a.commodity_id=b.id
  1700. left join business_category c on b.cid=c.id
  1701. </if>
  1702. <if test="name != null">
  1703. left join user f on e.buyer_id=f.id
  1704. </if>
  1705. <if test="outsourceStatus !=null">
  1706. left join t_order_outsource l on a.id=l.tid
  1707. </if>
  1708. <if test="type !=null">
  1709. inner join
  1710. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1711. from t_order_approval
  1712. where `type` in
  1713. <foreach collection="type" item="item" separator="," open="(" close=")">
  1714. #{item}
  1715. </foreach>
  1716. group by order_no) toa on e.order_no=toa.order_no
  1717. </if>
  1718. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1719. and a.outsource= #{outsource,jdbcType=INTEGER}
  1720. <include refid="selectOrderTaskListSql"/>
  1721. </select>
  1722. <select id="selectOrderTaskListSum" resultType="java.util.Map">
  1723. select sum(a.commodity_price) totalAmount,sum(a.commodity_quantity)totalNumber
  1724. from t_order_task a
  1725. left join t_order_new e on a.order_no=e.order_no
  1726. <if test="cid != null">
  1727. left join business_project b on a.commodity_id=b.id
  1728. left join business_category c on b.cid=c.id
  1729. </if>
  1730. <if test="name != null">
  1731. left join user f on e.buyer_id=f.id
  1732. </if>
  1733. <if test="outsourceStatus !=null">
  1734. left join t_order_outsource l on a.id=l.tid
  1735. </if>
  1736. <if test="type !=null">
  1737. inner join
  1738. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1739. from t_order_approval
  1740. where `type` in
  1741. <foreach collection="type" item="item" separator="," open="(" close=")">
  1742. #{item}
  1743. </foreach>
  1744. group by order_no) toa on e.order_no=toa.order_no
  1745. </if>
  1746. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1747. and a.outsource= #{outsource,jdbcType=INTEGER}
  1748. <include refid="selectOrderTaskListSql"/>
  1749. </select>
  1750. <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
  1751. select
  1752. a.id,a.commodity_name as taskName,a.order_no as orderNo,c.sort ,c.cname,d.name as receiverName,a.task_comment as taskComment,a.project_status as projectStatus,
  1753. a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName, f.nickname as userName,a.set_up_amount as setUpAmount,
  1754. g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
  1755. a.certificate_number as certificateNumber, a.status,a.form_retrieve as formRetrieve, a.task_refund as taskRefund,a.task_receiver taskReceiver,b.patent_transfer patentTransfer,
  1756. a.refund_content as refundContent, a.declare_user as declareUser, a.declare_pwd as declarePwd,e.contract_no as contractNo,e.contacts ,b.`type` bpType,
  1757. date_format(a.task_end_time,'%Y-%m-%d') as endDate,date_format(a.accept_time,'%Y-%m-%d') as acceptDate,h.name as depName,e.contact_mobile as contactMobile ,
  1758. date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,e.delete_sign deleteSign,
  1759. date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S') as taskDate,e.legal_person as legalPerson,
  1760. e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,a.patent_type patentType,
  1761. a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
  1762. a.cost_reduction costReduction, a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
  1763. a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus,
  1764. ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity,
  1765. a.satisfaction_degree satisfactionDegree,a.satisfaction_degree_url satisfactionDegreeUrl
  1766. from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1767. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1768. left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id LEFT JOIN t_task_mid ttm ON a.id=ttm.tid
  1769. left join admin g on e.salesman_id=g.id
  1770. where a.id= #{id,jdbcType=VARCHAR}
  1771. </select>
  1772. <select id="selectBySuperId" resultType="com.goafanti.common.model.TOrderTask">
  1773. select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main from t_order_task
  1774. where super_id = #{superId,jdbcType=VARCHAR} group by super_id
  1775. </select>
  1776. <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1777. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,a.receiver_name as receiverName,dep.name as depName,a.project_status projectStatus,
  1778. a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
  1779. e.contract_no as contractNo,date_format(e.create_time,'%Y-%m-%d %H:%i:%S')as creteTime,date_format(e.sign_time,'%Y-%m-%d')as signTime,a.outsource,
  1780. date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S')taskDate, date_format(a.task_end_time,'%Y-%m-%d')taskEndTime,tm.salesman_name salesmanName,
  1781. a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,ifnull(ttm.cost_amount,0) costAmount,ifnull(ttm.party_amount,0) partyAmount
  1782. from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1783. left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id
  1784. left join user f on e.buyer_id=f.id left join (select tid,sum(hours)hours from task_hours_count group by tid) g on a.id=g.tid
  1785. left join t_order_mid tm on a.order_no=tm.order_no left join t_task_mid ttm on a.id=ttm.tid
  1786. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1787. <if test="shiroType == 1 and aid !=null">
  1788. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1789. </if>
  1790. <if test="shiroType == 2 and aid !=null">
  1791. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1792. </if>
  1793. <if test="name != null">
  1794. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1795. </if>
  1796. <if test="thchId != null">
  1797. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1798. </if>
  1799. <if test="cid != null">
  1800. and b.cid = #{cid,jdbcType=VARCHAR}
  1801. </if>
  1802. <if test="outsource != null">
  1803. and a.outsource = #{outsource,jdbcType=INTEGER}
  1804. </if>
  1805. <if test="depId != null">
  1806. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1807. </if>
  1808. <if test="contractNo != null">
  1809. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1810. </if>
  1811. <if test="orderNo != null">
  1812. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1813. </if>
  1814. <if test="taskId != null">
  1815. and a.id= #{taskId,jdbcType=VARCHAR}
  1816. </if>
  1817. <if test="starTime !=null and endTime !=null">
  1818. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1819. </if>
  1820. order by a.task_start_time desc,e.create_time desc
  1821. <if test="page_sql!=null">
  1822. ${page_sql}
  1823. </if>
  1824. </select>
  1825. <select id="selectTaskHoursListCount" resultType="java.lang.Integer">
  1826. select count(*) from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1827. left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id left join t_order_mid tm on a.order_no=tm.order_no
  1828. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1829. <if test="shiroType == 1 and aid !=null">
  1830. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1831. </if>
  1832. <if test="shiroType == 2 and aid !=null">
  1833. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1834. </if>
  1835. <if test="name != null">
  1836. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1837. </if>
  1838. <if test="thchId != null">
  1839. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1840. </if>
  1841. <if test="outsource != null">
  1842. and a.outsource = #{outsource,jdbcType=INTEGER}
  1843. </if>
  1844. <if test="cid != null">
  1845. and b.cid = #{cid,jdbcType=VARCHAR}
  1846. </if>
  1847. <if test="depId != null">
  1848. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1849. </if>
  1850. <if test="contractNo != null">
  1851. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1852. </if>
  1853. <if test="orderNo != null">
  1854. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1855. </if>
  1856. <if test="taskId != null">
  1857. and a.id= #{taskId,jdbcType=VARCHAR}
  1858. </if>
  1859. <if test="starTime !=null and endTime !=null">
  1860. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1861. </if>
  1862. </select>
  1863. <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1864. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  1865. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1866. a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber,
  1867. a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId,ttm.contract_term contractTerm,ttm.service_year serviceYear,
  1868. toa.type as type,toa.type_explain as typeExplain
  1869. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1870. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1871. left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1872. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1873. left join user f on e.buyer_id=f.id left join department h on e.order_dep=h.id
  1874. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1875. left join t_task_member ttm on a.id=ttm.tid
  1876. left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1877. from t_order_approval group by order_no) toa on e.order_no=toa.order_no
  1878. <if test="type !=null">
  1879. inner join
  1880. (select distinct order_no
  1881. from t_order_approval
  1882. where `type` in
  1883. <foreach collection="type" item="item" separator="," open="(" close=")">
  1884. #{item}
  1885. </foreach>
  1886. group by order_no) toa2 on e.order_no=toa2.order_no
  1887. </if>
  1888. where e.delete_sign in(0,2,3)
  1889. <if test="orderNo != null">
  1890. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1891. </if>
  1892. <if test="name != null">
  1893. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1894. </if>
  1895. <if test="orderNo != null">
  1896. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1897. </if>
  1898. <if test="depId != null">
  1899. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1900. </if>
  1901. <if test="thchId != null">
  1902. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1903. </if>
  1904. <if test="taskId != null">
  1905. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1906. </if>
  1907. <if test="taskStatus != null">
  1908. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1909. </if>
  1910. <if test="adminName != null">
  1911. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1912. </if>
  1913. order by a.task_distribution_time desc
  1914. <if test="page_sql!=null">
  1915. ${page_sql}
  1916. </if>
  1917. </select>
  1918. <select id="selectTaskListCount" resultType="java.lang.Integer">
  1919. select count(*)
  1920. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1921. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1922. left join business_project b on a.commodity_id=b.id
  1923. left join business_category c on b.cid=c.id
  1924. left join admin d on a.task_receiver=d.id
  1925. left join t_order_new e on a.order_no=e.order_no
  1926. left join user f on e.buyer_id=f.id
  1927. left join department h on e.order_dep=h.id
  1928. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1929. <if test="type !=null">
  1930. inner join
  1931. (select distinct order_no
  1932. from t_order_approval
  1933. where `type` in
  1934. <foreach collection="type" item="item" separator="," open="(" close=")">
  1935. #{item}
  1936. </foreach>
  1937. group by order_no) toa2 on e.order_no=toa2.order_no
  1938. </if>
  1939. where e.delete_sign in(0,2,3)
  1940. <if test="orderNo != null">
  1941. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1942. </if>
  1943. <if test="name != null">
  1944. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1945. </if>
  1946. <if test="depId != null">
  1947. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1948. </if>
  1949. <if test="thchId != null">
  1950. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1951. </if>
  1952. <if test="orderNo != null">
  1953. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1954. </if>
  1955. <if test="taskId != null">
  1956. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1957. </if>
  1958. <if test="taskStatus != null">
  1959. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1960. </if>
  1961. <if test="adminName != null">
  1962. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1963. </if>
  1964. </select>
  1965. <!-- 根据订单编号获得所有的任务负责人 -->
  1966. <select id="getReceiverByOid" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1967. select distinct task_receiver, a.name, a.email, t.id, t.project_status from t_order_task t
  1968. inner join admin a on t.task_receiver = a.id
  1969. where order_no = #{orderNo,jdbcType=VARCHAR} and task_status &gt; 0 and super_id is null
  1970. </select>
  1971. <update id="updateDimissionTransfer" parameterType="java.lang.String">
  1972. update t_order_task a left join t_change_task b on a.id =b.tid
  1973. left join (select * from admin where id= #{transferId,jdbcType=VARCHAR})c on 1=1
  1974. set a.task_allocator= #{aid,jdbcType=VARCHAR},a.task_receiver= c.id,
  1975. a.receiver_name=c.name,b.receiver_name=c.name
  1976. <if test="type==0">
  1977. ,a.consultant_id=c.id
  1978. </if>
  1979. <if test="type==1">
  1980. ,a.manager_id=c.id
  1981. </if>
  1982. <if test="type==3">
  1983. ,a.consultant_id= null
  1984. ,a.manager_id=c.id
  1985. </if>
  1986. <if test="type==4">
  1987. ,a.consultant_id=c.id
  1988. ,a.manager_id= null
  1989. </if>
  1990. <if test="type==1">
  1991. ,a.manager_id= null
  1992. </if>
  1993. where task_receiver=#{aid,jdbcType=VARCHAR}
  1994. </update>
  1995. <select id="selectEstimateCost" resultType="java.lang.String">
  1996. select ifnull(sum(a.commodity_quantity * ifnull(b.price,0)),0) from t_order_task a
  1997. left join business_project b on a.commodity_id=b.id
  1998. where order_no= #{orderNo}
  1999. </select>
  2000. <select id="listNameByDepAndName" resultType="java.lang.String">
  2001. select
  2002. <if test="type ==0">
  2003. consultant_id
  2004. </if>
  2005. <if test="type ==1">
  2006. manager_id
  2007. </if>
  2008. from t_order_task
  2009. where order_no= #{orderNo}
  2010. group by
  2011. <if test="type ==0">
  2012. consultant_id
  2013. </if>
  2014. <if test="type ==1">
  2015. manager_id
  2016. </if>
  2017. </select>
  2018. <select id="splitProjectList" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  2019. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.project_status as projectStatus,d.contact_mobile receiverMobile,
  2020. e.contract_no contractNo,a.task_receiver taskReceiver, a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  2021. a.commodity_quantity as commodityQuantity,e.approval,l.refund_status outsourceStatus, ifnull(i.alreadyNumber,0) as alreadyNumber,a.task_comment taskComment ,
  2022. f.nickname as userName,h.name as depName, j.name as outsourceName ,ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper,a.member_type memberType,
  2023. date_format(a.split_time,'%Y-%m-%d %H:%i:%S') splitTimes,ad.name splitAname,a.split_id splitId,a.patent_type patentType,a.picture_url pictureUrl,
  2024. ttm.service_life serviceLife,ttm.service_year serviceYear ,ttm.year_sum yearSum ,ttm.contract_term contractTerm,a.process_status processStatus
  2025. from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  2026. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
  2027. left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber
  2028. from task_progress group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name
  2029. from outsource_organization group by order_no) j on a.order_no=j.order_no left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid
  2030. left join t_order_outsource l on a.id=l.tid left join admin ad on ad.id=a.split_aid left join t_task_member ttm on a.id=ttm.tid
  2031. where e.order_status in (0,1,2,3,4,5)
  2032. and split_status =2 and a.split_super= #{tid}
  2033. <if test="type == 1">
  2034. and a.process_status in(0,3)
  2035. </if>
  2036. order by split_id
  2037. </select>
  2038. <select id="selectByidGetCname" resultType="java.lang.String">
  2039. select b.cname from business_project a left join business_category b on a.cid =b.id
  2040. where a.id= #{pid}
  2041. </select>
  2042. <update id="updateByOutsourceToOrderNo">
  2043. update t_order_task set outsource= #{type} where order_no= #{orderNo}
  2044. </update>
  2045. <select id="getLockId" resultType="java.lang.String">
  2046. select id from user_lock_release a left join (select commodity_id from t_order_task
  2047. where order_no = #{orderNo} GROUP by commodity_id ) b on a.business_project_id =b.commodity_id
  2048. where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
  2049. </select>
  2050. <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
  2051. select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province , c.name depName,e.salesman_name salesmanName,
  2052. b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
  2053. a.project_status projectStatus,a.id,b.order_remarks orderRemarks, a.set_up_status setUpStatus , date_format( a.set_up_time , '%Y-%m-%d' ) setUpTime ,
  2054. a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile ,b.legal_person_tel legalPersonTel , a.certificate_number certificateNumber,
  2055. a.declaration_batch declarationBatch, date_format(a.licence_time, '%Y-%m-%d' ) licenceTime, a.commodity_quantity commodityQuantity ,
  2056. ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial, ttm.cost_amount costAmount ,
  2057. (a.commodity_price-ttm.cost_amount)profit, a.high_tech_status highTechStatus, tp.patent_name patentName ,tp.patent_no patentNo ,
  2058. date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime , date_format(tp.authorize_time, '%Y-%m-%d ' ) authorizeTime, ttm.reject_count rejectCount ,
  2059. tm.service_life serviceLife,tm.service_year serviceyear, tm.year_sum yearsum,tm.contract_term contractTerm, a.commodity_price commodityPrice ,
  2060. a.special_comment specialComment,a.task_comment taskComment,ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,
  2061. e.service_type serviceType,e.service_project serviceProject, a.form_retrieve formRetrieve ,a.satisfaction_degree satisfactionDegree,
  2062. toa.type,toa.type_explain typeExplain,b.approval,a.score_status scoreStatus ,a.score_number scoreNumber
  2063. from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id
  2064. left join district_glossory d on c.province=d.id left join task_progress tp on a.id=tp.task_id left join t_task_member tm on a.id=tm.tid
  2065. left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
  2066. left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
  2067. left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2068. from t_order_approval group by order_no) toa on b.order_no=toa.order_no
  2069. <if test="screen ==6">
  2070. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  2071. </if>
  2072. <if test="screen ==7">
  2073. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  2074. </if>
  2075. <if test="screen ==8">
  2076. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  2077. </if>
  2078. <if test="screen ==9">
  2079. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  2080. </if>
  2081. <if test="screen ==10">
  2082. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  2083. </if>
  2084. <if test="screen ==11">
  2085. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  2086. where apply_count &gt; 0)tj on a.id=tj.tid
  2087. </if>
  2088. <if test="type !=null">
  2089. inner join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2090. from t_order_approval where `type` in
  2091. <foreach collection="type" item="item" separator="," open="(" close=")">
  2092. #{item}
  2093. </foreach>
  2094. group by order_no) toa2 on b.order_no=toa2.order_no
  2095. </if>
  2096. where a.split_status in (0,2) and b. delete_sign in (0,2)
  2097. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  2098. <if test="screen ==0">
  2099. and a.project_status in(0,1,2,3)
  2100. </if>
  2101. <if test="screen ==2">
  2102. and a.project_status &gt; 3
  2103. </if>
  2104. <if test="screen ==3">
  2105. and a.set_up_status =1
  2106. </if>
  2107. <if test="screen ==4">
  2108. and a.spot_check_status in (1,2)
  2109. </if>
  2110. <if test="screen ==5">
  2111. and a.spot_check_status =1
  2112. </if>
  2113. <if test="screen ==12">
  2114. and a.publicity_time is not null
  2115. </if>
  2116. <if test="startDate != null and endDate != null">
  2117. and a.task_distribution_time between #{startDate} and #{endDate}
  2118. </if>
  2119. <if test="province !=null">
  2120. and c.province = #{province}
  2121. </if>
  2122. <if test="projectId !=null">
  2123. and a.commodity_id = #{projectId}
  2124. </if>
  2125. <if test="sdStatus !=null">
  2126. <if test="sdStatus==0">
  2127. and a.form_retrieve=0
  2128. </if>
  2129. <if test="sdStatus==1">
  2130. and a.form_retrieve=1
  2131. </if>
  2132. <if test="sdStatus==2">
  2133. and a.form_retrieve=2
  2134. and a.satisfaction_degree=0
  2135. </if>
  2136. <if test="sdStatus==3">
  2137. and a.form_retrieve=2
  2138. and a.satisfaction_degree=1
  2139. </if>
  2140. <if test="sdStatus==4">
  2141. and a.form_retrieve=2
  2142. and a.satisfaction_degree=2
  2143. </if>
  2144. <if test="sdStatus==5">
  2145. and a.form_retrieve=2
  2146. and a.satisfaction_degree=3
  2147. </if>
  2148. </if>
  2149. <if test="deps != null">
  2150. and b.order_dep in
  2151. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2152. #{dep}
  2153. </foreach>
  2154. </if>
  2155. <if test="thchDeps != null">
  2156. and td.id in
  2157. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  2158. #{thchDep}
  2159. </foreach>
  2160. </if>
  2161. <if test="projectStatus !=null">
  2162. and bp.cid= #{projectStatus}
  2163. </if>
  2164. <if test="taskProjectStatus !=null">
  2165. and a.project_status= #{taskProjectStatus}
  2166. </if>
  2167. <if test="projectType !=null">
  2168. and bp.type= #{projectType}
  2169. </if>
  2170. <if test="orderNo !=null">
  2171. and b.order_no = #{orderNo}
  2172. </if>
  2173. <if test="contractNo !=null">
  2174. and b.contract_no = #{contractNo}
  2175. </if>
  2176. <if test="userName !=null">
  2177. and e.buyer_name like concat('%', #{userName},'%')
  2178. </if>
  2179. <if test="thchId !=null">
  2180. and a.task_receiver = #{thchId}
  2181. </if>
  2182. <if test="declarationBatch !=null">
  2183. and a.declaration_batch = #{declarationBatch}
  2184. </if>
  2185. <if test="projectSituation !=null">
  2186. and a.status = #{projectSituation}
  2187. </if>
  2188. <if test=" projectAmount !=null and projectAmount != 9">
  2189. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  2190. </if>
  2191. <if test=" projectAmount == 9">
  2192. and a.commodity_price &gt;= #{amountStart}
  2193. </if>
  2194. <if test="page_sql!=null">
  2195. ${page_sql}
  2196. </if>
  2197. </select>
  2198. <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
  2199. select count(*)
  2200. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2201. <if test="province !=null">
  2202. left join department c on b.order_dep =c.id
  2203. </if>
  2204. <if test="userName !=null">
  2205. left join t_order_mid e on b.order_no =e.order_no
  2206. </if>
  2207. <if test="projectStatus !=null or projectType !=null">
  2208. left join business_project bp on a.commodity_id =bp.id
  2209. </if>
  2210. <if test="thchDeps !=null">
  2211. left join admin ta on a.task_receiver =ta.id
  2212. left join department td on ta.department_id =td.id
  2213. </if>
  2214. <if test="status==3 or status==4">
  2215. left join task_progress tp on a.id=tp.task_id
  2216. </if>
  2217. <if test="screen ==6">
  2218. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  2219. </if>
  2220. <if test="screen ==7">
  2221. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  2222. </if>
  2223. <if test="screen ==8">
  2224. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  2225. </if>
  2226. <if test="screen ==9">
  2227. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  2228. </if>
  2229. <if test="screen ==10">
  2230. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  2231. </if>
  2232. <if test="screen ==11">
  2233. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  2234. where apply_count &gt; 0)tj on a.id=tj.tid
  2235. </if>
  2236. <if test="type !=null">
  2237. inner join
  2238. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2239. from t_order_approval
  2240. where `type` in
  2241. <foreach collection="type" item="item" separator="," open="(" close=")">
  2242. #{item}
  2243. </foreach>
  2244. group by order_no) toa on b.order_no=toa.order_no
  2245. </if>
  2246. where a.split_status in (0,2) and b. delete_sign in (0,2)
  2247. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  2248. <if test="screen ==0">
  2249. and a.project_status in(0,1,2,3)
  2250. </if>
  2251. <if test="screen ==2">
  2252. and a.project_status &gt; 3
  2253. </if>
  2254. <if test="screen ==3">
  2255. and a.set_up_status =1
  2256. </if>
  2257. <if test="screen ==4">
  2258. and a.spot_check_status in (1,2)
  2259. </if>
  2260. <if test="screen ==5">
  2261. and a.spot_check_status =1
  2262. </if>
  2263. <if test="screen ==12">
  2264. and a.publicity_time is not null
  2265. </if>
  2266. <if test="startDate != null and endDate != null">
  2267. and a.task_distribution_time between #{startDate} and #{endDate}
  2268. </if>
  2269. <if test="province !=null">
  2270. and c.province = #{province}
  2271. </if>
  2272. <if test="projectId !=null">
  2273. and a.commodity_id = #{projectId}
  2274. </if>
  2275. <if test="deps != null">
  2276. and b.order_dep in
  2277. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2278. #{dep}
  2279. </foreach>
  2280. </if>
  2281. <if test="thchDeps != null">
  2282. and td.id in
  2283. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  2284. #{thchDep}
  2285. </foreach>
  2286. </if>
  2287. <if test="projectStatus !=null">
  2288. and bp.cid= #{projectStatus}
  2289. </if>
  2290. <if test="sdStatus !=null">
  2291. <if test="sdStatus==0">
  2292. and a.form_retrieve=0
  2293. </if>
  2294. <if test="sdStatus==1">
  2295. and a.form_retrieve=1
  2296. </if>
  2297. <if test="sdStatus==2">
  2298. and a.form_retrieve=2
  2299. and a.satisfaction_degree=0
  2300. </if>
  2301. <if test="sdStatus==3">
  2302. and a.form_retrieve=2
  2303. and a.satisfaction_degree=1
  2304. </if>
  2305. <if test="sdStatus==4">
  2306. and a.form_retrieve=2
  2307. and a.satisfaction_degree=2
  2308. </if>
  2309. <if test="sdStatus==5">
  2310. and a.form_retrieve=2
  2311. and a.satisfaction_degree=3
  2312. </if>
  2313. </if>
  2314. <if test="taskProjectStatus !=null">
  2315. and a.project_status= #{taskProjectStatus}
  2316. </if>
  2317. <if test="projectType !=null">
  2318. and bp.type= #{projectType}
  2319. </if>
  2320. <if test="orderNo !=null">
  2321. and b.order_no = #{orderNo}
  2322. </if>
  2323. <if test="contractNo !=null">
  2324. and b.contract_no = #{contractNo}
  2325. </if>
  2326. <if test="userName !=null">
  2327. and e.buyer_name like concat('%', #{userName},'%')
  2328. </if>
  2329. <if test="thchId !=null">
  2330. and a.task_receiver = #{thchId}
  2331. </if>
  2332. <if test="declarationBatch !=null">
  2333. and a.declaration_batch = #{declarationBatch}
  2334. </if>
  2335. <if test="projectSituation !=null">
  2336. and a.status = #{projectSituation}
  2337. </if>
  2338. <if test=" projectAmount !=null and projectAmount != 9">
  2339. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  2340. </if>
  2341. <if test=" projectAmount == 9">
  2342. and a.commodity_price &gt;= #{amountStart}
  2343. </if>
  2344. </select>
  2345. <select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
  2346. select z.cid bpId, bc.cname projectStatus,z.dispatch_province province,dg.name provinceName,
  2347. z.duty_dep thchDepId,d.name thchDepName,z.distributeCount,z.stockCount,z.completeCount,z.publicityCount,
  2348. z.setUpCount,z.spotCheckCount,z.failCount,z.certificatesCount,z.acceptCount,z.endCount,z.authorizeCount,
  2349. z.rejectCount,z.applyCount,z.amountCount,z.costAmount,z.profit
  2350. from ( select y.dispatch_province, y.cid, y.duty_dep, sum(y.dispatch_count)distributeCount,
  2351. sum(y.stock_count)stockCount, sum(y.complete_count)completeCount,sum(y.promulgate_count)publicityCount,
  2352. sum(y.set_up_count)setUpCount,sum(y.spot_check_count)spotCheckCount,sum(y.fail_count)failCount,
  2353. sum(y.certificates_count)certificatesCount,sum(y.accept_count)acceptCount,sum(y.end_count)endCount,
  2354. sum(y.authorize_count)authorizeCount,sum(y.reject_count)rejectCount, sum(y.apply_count)applyCount,
  2355. sum(y.commodity_price)amountCount,sum(y.cost_amount)costAmount, sum(y.commodity_price-y.cost_amount)profit
  2356. from(select b.dispatch_province, bp.cid, b.duty_dep,
  2357. b.stock_count,b.dispatch_count,b.promulgate_count, b.complete_count,b.set_up_count ,b.spot_check_count ,
  2358. b.fail_count ,b.certificates_count, b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  2359. a.commodity_price ,b.cost_amount, a.task_distribution_time from t_order_task a
  2360. left join t_task_mid b on a.id=b.tid left join business_project bp on a.commodity_id =bp.id
  2361. left join t_order_new ton on a.order_no =ton .order_no
  2362. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  2363. <if test="projectId !=null">
  2364. and a.commodity_id = #{projectId}
  2365. </if>
  2366. <if test="province !=null">
  2367. and b.dispatch_province = #{province}
  2368. </if>
  2369. <if test="thchDeps !=null">
  2370. and b.duty_dep in
  2371. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  2372. #{depId}
  2373. </foreach>
  2374. </if>
  2375. <if test="projectType !=null">
  2376. and bp.`type` = #{projectType}
  2377. </if>
  2378. <if test="projectStatus !=null">
  2379. and bp.cid= #{projectStatus}
  2380. </if>
  2381. <if test="startDate != null and endDate != null">
  2382. and a.task_distribution_time between #{startDate} and #{endDate}
  2383. </if>
  2384. )y
  2385. group by y.dispatch_province, y.cid, y.duty_dep )z
  2386. left join business_category bc on z.cid=bc.id left join district_glossory dg on z.dispatch_province=dg.id
  2387. left join department d on z.duty_dep=d.id
  2388. <if test="page_sql!=null">
  2389. ${page_sql}
  2390. </if>
  2391. </select>
  2392. <select id="selectProvincialStatisticsCount" resultType="java.lang.Integer">
  2393. select count(*)
  2394. from(select y.dispatch_province from (select bp.cid,
  2395. b.dispatch_province,b.duty_dep,a.cname,b.stock_count,b.dispatch_count,b.promulgate_count,
  2396. b.complete_count,b.set_up_count ,b.spot_check_count ,b.fail_count ,b.certificates_count,
  2397. b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  2398. a.commodity_price ,b.cost_amount, a.task_distribution_time
  2399. from t_order_task a
  2400. left join t_task_mid b on a.id=b.tid
  2401. left join business_project bp on a.commodity_id =bp.id
  2402. left join t_order_new ton on a.order_no =ton .order_no
  2403. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  2404. <if test="projectId !=null">
  2405. and a.commodity_id = #{projectId}
  2406. </if>
  2407. <if test="province !=null">
  2408. and b.dispatch_province = #{province}
  2409. </if>
  2410. <if test="thchDeps !=null">
  2411. and b.duty_dep in
  2412. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  2413. #{depId}
  2414. </foreach>
  2415. </if>
  2416. <if test="projectType !=null">
  2417. and bp.`type` = #{projectType}
  2418. </if>
  2419. <if test="projectStatus !=null">
  2420. and bp.cid= #{projectStatus}
  2421. </if>
  2422. <if test="startDate != null and endDate != null">
  2423. and a.task_distribution_time between #{startDate} and #{endDate}
  2424. </if>
  2425. )y group by y.dispatch_province, y.cid, y.duty_dep )x
  2426. </select>
  2427. <select id="managerSelectByPage" resultType="com.goafanti.order.bo.managerListBo">
  2428. select a.id,a.task_distribution_time taskDistributionTime ,tm.province_name provinceName,tm.dep_name depName,
  2429. tm.salesman_name salesmanName, b.contract_no contractNo ,b.order_no orderNo,tm.buyer_name UserName,a.cname ,
  2430. a.commodity_name commodityName,a.commodity_quantity commodityQuantity,dep.name techDepName,a.receiver_name techName,
  2431. a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment,
  2432. b.approval,toa.type,toa.type_explain typeExplain
  2433. from (select task_id from t_task_log a where task_receiver=#{aid}
  2434. UNION select task_id from t_task_log a where task_allocator=#{aid}) x
  2435. left join t_order_task a on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
  2436. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  2437. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  2438. left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2439. from t_order_approval group by order_no) toa on b.order_no=toa.order_no
  2440. <if test="type !=null">
  2441. inner join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2442. from t_order_approval where `type` in
  2443. <foreach collection="type" item="item" separator="," open="(" close=")">
  2444. #{item}
  2445. </foreach>
  2446. group by order_no) toa on b.order_no=toa.order_no
  2447. </if>
  2448. where 1=1
  2449. <if test="orderNo !=null">
  2450. and a.order_no = #{orderNo}
  2451. </if>
  2452. <if test="contractNo !=null">
  2453. and b.contract_no = #{contractNo}
  2454. </if>
  2455. <if test="name !=null">
  2456. and tm.buyer_name like CONCAT('%',#{name},'%')
  2457. </if>
  2458. <if test="thchId !=null">
  2459. and a.task_receiver = #{thchId}
  2460. </if>
  2461. <if test="cid !=null">
  2462. and bp.cid =#{cid}
  2463. </if>
  2464. <if test="projectType !=null">
  2465. and bp.`type` =#{projectType}
  2466. </if>
  2467. <if test="depId !=null">
  2468. and b.order_dep =#{depId}
  2469. </if>
  2470. <if test="techDepId !=null">
  2471. and ad.department_id =#{techDepId}
  2472. </if>
  2473. <if test="declarationBatch !=null">
  2474. and a.declaration_batch =#{declarationBatch}
  2475. </if>
  2476. <if test="commodityPrice !=null">
  2477. and a.commodity_price =#{commodityPrice}
  2478. </if>
  2479. <if test="startTime !=null and endTime !=null">
  2480. and a.task_distribution_time between #{startTime} and #{endTime}
  2481. </if>
  2482. <if test="page_sql!=null">
  2483. ${page_sql}
  2484. </if>
  2485. </select>
  2486. <select id="managerSelectCount" resultType="java.lang.Integer">
  2487. select count(*)
  2488. from (select task_id from t_task_log a where task_receiver= #{aid} UNION
  2489. select task_id from t_task_log a where task_allocator= #{aid}) x
  2490. left join t_order_task a on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
  2491. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  2492. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  2493. <if test="type !=null">
  2494. inner join
  2495. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2496. from t_order_approval
  2497. where `type` in
  2498. <foreach collection="type" item="item" separator="," open="(" close=")">
  2499. #{item}
  2500. </foreach>
  2501. group by order_no) toa on b.order_no=toa.order_no
  2502. </if>
  2503. where 1=1
  2504. <if test="orderNo !=null">
  2505. and a.order_no = #{orderNo}
  2506. </if>
  2507. <if test="contractNo !=null">
  2508. and b.contract_no = #{contractNo}
  2509. </if>
  2510. <if test="name !=null">
  2511. and tm.buyer_name like CONCAT('%',#{name},'%')
  2512. </if>
  2513. <if test="thchId !=null">
  2514. and a.task_receiver = #{thchId}
  2515. </if>
  2516. <if test="cid !=null">
  2517. and bp.cid =#{cid}
  2518. </if>
  2519. <if test="projectType !=null">
  2520. and bp.`type` =#{projectType}
  2521. </if>
  2522. <if test="depId !=null">
  2523. and b.order_dep =#{depId}
  2524. </if>
  2525. <if test="techDepId !=null">
  2526. and ad.department_id =#{techDepId}
  2527. </if>
  2528. <if test="declarationBatch !=null">
  2529. and a.declaration_batch =#{declarationBatch}
  2530. </if>
  2531. <if test="commodityPrice !=null">
  2532. and a.commodity_price =#{commodityPrice}
  2533. </if>
  2534. <if test="startTime !=null and endTime !=null">
  2535. and a.task_distribution_time between #{startTime} and #{endTime}
  2536. </if>
  2537. </select>
  2538. <resultMap id="userOrder" type="com.goafanti.common.bo.UserOrderTask">
  2539. <id column="orderNo" jdbcType="VARCHAR" property="orderNo" />
  2540. <collection ofType="com.goafanti.common.bo.UserTask" property="list">
  2541. <id column="id" jdbcType="VARCHAR" property="id" />
  2542. <result column="commodityName" jdbcType="VARCHAR" property="commodityName" />
  2543. </collection>
  2544. </resultMap>
  2545. <select id="selectUidByproject" resultMap="userOrder">
  2546. select a.order_no orderNo ,b.id,b.commodity_name commodityName from t_order_new a
  2547. left join t_order_task b on a.order_no =b.order_no
  2548. where a.buyer_id = #{uid}
  2549. </select>
  2550. <select id="selectProjectCheck" resultType="com.goafanti.order.bo.OutProjectCheck">
  2551. select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity commodityQuantity,
  2552. c.buyer_name userName ,e.cname ,a.task_distribution_time taskDistributionTime,f.name depName ,a.check_status checkStatus ,
  2553. a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment ,a.official_cost officialCost,a.cost_reduction costReduction,
  2554. a.patent_type patentType
  2555. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2556. left join t_order_mid c on a.order_no =c.order_no
  2557. left join business_project d on a.commodity_id =d.id
  2558. left join business_category e on d.cid =e.id
  2559. left join department f on b.order_dep =f.id
  2560. where check_status =1
  2561. <if test="aid !=null">
  2562. and b.salesman_id = #{aid}
  2563. </if>
  2564. <if test="name !=null">
  2565. and c.buyer_name like concat('%',#{name},'%')
  2566. </if>
  2567. <if test="orderNo !=null">
  2568. and a.order_no = #{orderNo}
  2569. </if>
  2570. <if test="contractNo !=null">
  2571. and b.contract_no = #{contractNo}
  2572. </if>
  2573. <if test="pname !=null">
  2574. and a.commodity_name like concat('%',#{pname},'%')
  2575. </if>
  2576. <if test="deps !=null">
  2577. and b.order_dep in
  2578. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  2579. #{depId}
  2580. </foreach>
  2581. </if>
  2582. <if test="page_sql!=null">
  2583. ${page_sql}
  2584. </if>
  2585. </select>
  2586. <select id="countProjectCheck" resultType="java.lang.Integer">
  2587. select count(*)
  2588. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2589. left join t_order_mid c on a.order_no =c.order_no
  2590. left join business_project d on a.commodity_id =d.id
  2591. left join business_category e on d.cid =e.id
  2592. left join department f on b.order_dep =f.id
  2593. where check_status =1
  2594. <if test="aid !=null">
  2595. and b.salesman_id = #{aid}
  2596. </if>
  2597. <if test="name !=null">
  2598. and c.buyer_name like concat('%',#{name},'%')
  2599. </if>
  2600. <if test="orderNo !=null">
  2601. and a.order_no = #{orderNo}
  2602. </if>
  2603. <if test="contractNo !=null">
  2604. and b.contract_no = #{contractNo}
  2605. </if>
  2606. <if test="pname !=null">
  2607. and a.commodity_name like concat('%',#{pname},'%')
  2608. </if>
  2609. <if test="deps !=null">
  2610. and b.order_dep in
  2611. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  2612. #{depId}
  2613. </foreach>
  2614. </if>
  2615. </select>
  2616. <update id="resstPayment">
  2617. update t_order_task a ,t_task_mid c
  2618. set c.party_amount =0,c.cost_amount =0
  2619. where a.id= #{id} and a.id=c.tid
  2620. </update>
  2621. <update id="updateAddCostAmount">
  2622. update t_task_mid
  2623. set cost_amount =cost_amount + #{cost}
  2624. where tid= #{tid}
  2625. </update>
  2626. <select id="selectAidByParam" resultType="com.goafanti.common.bo.OrderOperator">
  2627. select a.id tid,b.order_no orderNo ,b.salesman_id salesmanId,b.finance_id financeId ,a.task_receiver techId,
  2628. b.salesman_name salesmanName ,b.finance_name financeName ,d.name techName,b.buyer_name buyerName,a.commodity_name projectName
  2629. from t_order_task a left join t_order_mid b on a.order_no=b.order_no
  2630. left join admin d on a.task_receiver=d.id
  2631. where 1=1
  2632. <if test="tid !=null">
  2633. and a.id= #{tid}
  2634. </if>
  2635. </select>
  2636. <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  2637. select a.id,a.order_no orderNo,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,
  2638. b.patent_name_type projectType, c.amount officialAmount,c.proportion85,b.patent_type outPatentType,d.type
  2639. from t_order_task a left join t_order_outsource b on a.id=b.tid left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
  2640. left join business_project d on a.commodity_id=d.id
  2641. where a.id= #{tid}
  2642. </select>
  2643. <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
  2644. select t1. province,dg.name provinceName ,t1.quantity,t1.pass,t1.notPass,ifnull(t1.signBacks,0) signBacks
  2645. from (SELECT e.province ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,sum(if(a.project_status != 10,1,0))notPass,
  2646. sum(ttm.high_new_retrial)signBacks
  2647. from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
  2648. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2649. left join department e on d.department_id =e.id where b.`type` =5 and c.process_status >4 and c.delete_sign in (0,2)
  2650. <if test="depId!=null">
  2651. and e.id= #{depId}
  2652. </if>
  2653. <if test="startDate!=null and endDate!=null">
  2654. and c.sign_time between #{startDate} and #{endDate}
  2655. </if>
  2656. group by e.province )t1 left join district_glossory dg on t1.province=dg.id
  2657. </select>
  2658. <select id="getHighNewRetrial" resultType="java.lang.Integer">
  2659. select count(*) from t_order_new a left join t_order_new b on a.buyer_id =b.buyer_id
  2660. left join t_order_task c on b.order_no =c.order_no left join business_project d on c.commodity_id =d.id
  2661. where a.order_no =#{orderNo} and b.create_time &lt; a.create_time and d.`type` =5
  2662. </select>
  2663. <select id="highNewRetrialList" resultType="com.goafanti.order.bo.OutHighNewRetrialList">
  2664. select t1.province,dg.name provinceName,t1.salesman_id aid,t1.name name,t1.quantity,t1.pass,t1.notPass,t1.signBacks
  2665. from (SELECT e.province,c.salesman_id,d.name ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,
  2666. sum(if(a.project_status != 10,1,0))notPass, sum(ttm.high_new_retrial)signBacks
  2667. from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
  2668. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2669. left join department e on d.department_id =e.id where b.`type` =5 and c.process_status >4 and c.delete_sign in (0,2)
  2670. <if test="province!=null">
  2671. and e.province= #{province}
  2672. </if>
  2673. <if test="depId!=null">
  2674. and e.id= #{depId}
  2675. </if>
  2676. <if test="startDate!=null and endDate!=null">
  2677. and c.sign_time between #{startDate} and #{endDate}
  2678. </if>
  2679. <if test="aid !=null">
  2680. and c.salesman_id = #{aid}
  2681. </if>
  2682. <if test="depId !=null">
  2683. and d.department_id = #{depId}
  2684. </if>
  2685. group by e.province ,c.salesman_id ,d.name )t1 left join district_glossory dg on t1.province=dg.id
  2686. order by
  2687. <if test="sort==0">
  2688. t1.pass
  2689. </if>
  2690. <if test="sort==1">
  2691. t1.notPass
  2692. </if>
  2693. desc
  2694. </select>
  2695. <select id="findMemberList" resultType="com.goafanti.order.bo.OutMemberList">
  2696. select a.id,b.contract_no contractNo,c.buyer_name userName,a.order_no orderNo,b.approval ,c.dep_name depName,
  2697. c.salesman_name salesmanName,c.finance_name financeName,a.commodity_name projectName,a.member_type memberType,
  2698. b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,a.examine_type examineType,
  2699. a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,a.approval approvalType,
  2700. a.commodity_quantity commodityQuantity,a.task_comment taskComment,a.picture_url pictureUrl,
  2701. e.service_life serviceLife ,e.service_year serviceYear,e.year_sum yearSum,e.contract_term contractTerm,
  2702. toa.type,toa.type_explain typeExplain
  2703. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2704. left join t_order_mid c on a.order_no =c.order_no
  2705. left join t_task_member e on a.id=e.tid
  2706. left join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2707. from t_order_approval group by order_no) toa on b.order_no=toa.order_no
  2708. <if test="shiroType ==2 or shiroType ==3">
  2709. left join department d on b.order_dep =d.id
  2710. </if>
  2711. <if test="type !=null">
  2712. inner join (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2713. from t_order_approval
  2714. where `type` in
  2715. <foreach collection="type" item="item" separator="," open="(" close=")">
  2716. #{item}
  2717. </foreach>
  2718. group by order_no) toa2 on b.order_no=toa2.order_no
  2719. </if>
  2720. where b.delete_sign in (0,2)
  2721. and a.process_status in (1,2,3,4)
  2722. <if test="shiroType ==1">
  2723. and b.salesman_id = #{aid}
  2724. </if>
  2725. <if test="shiroType ==2">
  2726. and (d.finance_id = #{aid} or d.retrial_finance_id =#{aid})
  2727. </if>
  2728. <if test="shiroType ==3">
  2729. and d.approval_aid= #{aid}
  2730. </if>
  2731. <!-- <if test="approvalType !=null">-->
  2732. <!-- and a.approval= #{approvalType}-->
  2733. <!-- </if>-->
  2734. <if test="orderNo != null">
  2735. and a.order_no = #{orderNo}
  2736. </if>
  2737. <if test="userName != null">
  2738. and c.buyer_name like concat('%',#{userName},'%')
  2739. </if>
  2740. <if test="deps != null">
  2741. and b.order_dep in
  2742. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2743. #{dep}
  2744. </foreach>
  2745. </if>
  2746. <if test="contractNo != null">
  2747. and b.contract_no =#{contractNo}
  2748. </if>
  2749. <if test="salesmanId != null">
  2750. and b.salesman_id =#{salesmanId}
  2751. </if>
  2752. <if test="projectName != null">
  2753. and a.commodity_name like concat('%',#{projectName},'%')
  2754. </if>
  2755. <if test="amountStatus == 0">
  2756. and b.total_amount &lt; 10
  2757. </if>
  2758. <if test="amountStatus == 1">
  2759. and b.total_amount between 10 and 20
  2760. </if>
  2761. <if test="amountStatus == 2">
  2762. and b.total_amount between 20 and 30
  2763. </if>
  2764. <if test="amountStatus == 3">
  2765. and b.total_amount between 30 and 40
  2766. </if>
  2767. <if test="amountStatus == 4">
  2768. and b.total_amount &gt; 40
  2769. </if>
  2770. <if test="approval != null and approval &lt; 3">
  2771. and b.approval = #{approval}
  2772. </if>
  2773. <if test="approval != null and approval ==4">
  2774. and b.approval in (1,2)
  2775. </if>
  2776. <if test="status != null and status !=5">
  2777. and a.process_status = #{status}
  2778. </if>
  2779. order by a.process_status
  2780. <if test="page_sql!=null">
  2781. ${page_sql}
  2782. </if>
  2783. </select>
  2784. <select id="findMemberCount" resultType="java.lang.Integer">
  2785. select count(*)
  2786. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2787. left join t_order_mid c on a.order_no =c.order_no
  2788. <if test="shiroType ==2 or shiroType ==3">
  2789. left join department d on b.order_dep =d.id
  2790. </if>
  2791. <if test="type !=null">
  2792. inner join
  2793. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2794. from t_order_approval
  2795. where `type` in
  2796. <foreach collection="type" item="item" separator="," open="(" close=")">
  2797. #{item}
  2798. </foreach>
  2799. group by order_no) toa on b.order_no=toa.order_no
  2800. </if>
  2801. where b.delete_sign in (0,2)
  2802. and a.process_status in (1,2,3,4)
  2803. <if test="shiroType ==1">
  2804. and b.salesman_id = #{aid}
  2805. </if>
  2806. <if test="shiroType ==2">
  2807. and (d.finance_id = #{aid} or d.retrial_finance_id =#{aid})
  2808. </if>
  2809. <if test="shiroType ==3">
  2810. and d.approval_aid= #{aid}
  2811. </if>
  2812. <!-- <if test="approvalType !=null">-->
  2813. <!-- and a.approval= #{approvalType}-->
  2814. <!-- </if>-->
  2815. <if test="orderNo != null">
  2816. and a.order_no = #{orderNo}
  2817. </if>
  2818. <if test="userName != null">
  2819. and c.buyer_name like concat('%',#{userName},'%')
  2820. </if>
  2821. <if test="deps != null">
  2822. and b.order_dep in
  2823. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2824. #{dep}
  2825. </foreach>
  2826. </if>
  2827. <if test="contractNo != null">
  2828. and b.contract_no =#{contractNo}
  2829. </if>
  2830. <if test="salesmanId != null">
  2831. and b.salesman_id =#{salesmanId}
  2832. </if>
  2833. <if test="projectName != null">
  2834. and a.commodity_name like concat('%',#{projectName},'%')
  2835. </if>
  2836. <if test="amountStatus == 1">
  2837. and b.total_amount between 10 and 20
  2838. </if>
  2839. <if test="amountStatus == 2">
  2840. and b.total_amount between 20 and 30
  2841. </if>
  2842. <if test="amountStatus == 3">
  2843. and b.total_amount between 30 and 40
  2844. </if>
  2845. <if test="amountStatus == 4">
  2846. and b.total_amount &gt; 40
  2847. </if>
  2848. <if test="approval != null and approval &lt; 3">
  2849. and b.approval = #{approval}
  2850. </if>
  2851. <if test="approval != null and approval ==4">
  2852. and b.approval in (1,2)
  2853. </if>
  2854. <if test="status != null and status !=5">
  2855. and a.process_status = #{status}
  2856. </if>
  2857. </select>
  2858. <select id="selectByAid" resultType="com.goafanti.common.model.TChangeTask">
  2859. select b.id,b.cid from t_order_task a
  2860. left join t_change_task b on a.id=b.tid
  2861. left join new_order_change noc on b.cid =noc.id
  2862. where b.id is not null and noc.process_state &lt; 4 and noc.status in (0,1,2)
  2863. and a.task_receiver = #{aid}
  2864. </select>
  2865. <select id="getSplitCount" resultType="java.lang.Integer">
  2866. select count(*) from t_order_task
  2867. where split_super = #{tid}
  2868. </select>
  2869. <select id="selectProjectSotpList" resultType="com.goafanti.order.bo.OutselectProjectSotp">
  2870. select DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes,dg.name province,c.contract_no contractNo, a.type stopType,a.status stopStatus,
  2871. c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,a.annex_url annexUrl,
  2872. tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason,a.id,b.id tid,
  2873. ttm.stop_status projectStopStatus, ttm.stop_type projectStopType
  2874. from task_stop a left join t_order_task b on a.tid=b.id
  2875. left join t_order_new c on b.order_no =c.order_no
  2876. left join t_task_mid ttm on b.id=ttm.tid
  2877. left join t_order_mid tom on c.order_no =tom.order_no
  2878. left join department d on c.order_dep =d.id
  2879. left join district_glossory dg on d.province =dg.id
  2880. where 1=1
  2881. <if test="shiro ==1">
  2882. and c.salesman_id =#{aid}
  2883. </if>
  2884. <if test="shiro ==2">
  2885. and c.order_dep in
  2886. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2887. #{dep}
  2888. </foreach>
  2889. </if>
  2890. <if test="orderNo !=null">
  2891. and b.order_no = #{orderNo}
  2892. </if>
  2893. <if test="userName !=null">
  2894. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2895. </if>
  2896. <if test="depId !=null">
  2897. and c.order_dep = #{depId}
  2898. </if>
  2899. <if test="contractNo !=null">
  2900. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2901. </if>
  2902. <if test="projectName !=null">
  2903. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2904. </if>
  2905. <if test="status !=null">
  2906. <if test="status==0">
  2907. and a.`type` =0 and a.status =0
  2908. </if>
  2909. <if test="status==1">
  2910. and a.`type` =1 and a.status =0
  2911. </if>
  2912. <if test="status==2">
  2913. and a.`type` =0 and a.status =1
  2914. </if>
  2915. <if test="status==3">
  2916. and a.`type` =1 and a.status =1
  2917. </if>
  2918. <if test="status==4">
  2919. and a.`type` =0 and a.status =2
  2920. </if>
  2921. <if test="status==5">
  2922. and a.`type` =1 and a.status =2
  2923. </if>
  2924. </if>
  2925. <if test="receiverId !=null">
  2926. and b.task_receiver = #{receiverId}
  2927. </if>
  2928. <if test="startTime !=null and endTime !=null">
  2929. and a.create_time BETWEEN #{startTime} and #{endTime}
  2930. </if>
  2931. order by a.create_time desc
  2932. <if test="page_sql!=null">
  2933. ${page_sql}
  2934. </if>
  2935. </select>
  2936. <select id="selectProjectSotpCount" resultType="java.lang.Integer">
  2937. select count(*)
  2938. from task_stop a left join t_order_task b on a.tid=b.id
  2939. left join t_order_new c on b.order_no =c.order_no
  2940. left join t_order_mid tom on c.order_no =tom.order_no
  2941. where 1=1
  2942. <if test="shiro ==1">
  2943. and c.salesman_id =#{aid}
  2944. </if>
  2945. <if test="shiro ==2">
  2946. and c.order_dep in
  2947. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2948. #{dep}
  2949. </foreach>
  2950. </if>
  2951. <if test="orderNo !=null">
  2952. and b.order_no = #{orderNo}
  2953. </if>
  2954. <if test="userName !=null">
  2955. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2956. </if>
  2957. <if test="depId !=null">
  2958. and c.order_dep = #{depId}
  2959. </if>
  2960. <if test="contractNo !=null">
  2961. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2962. </if>
  2963. <if test="projectName !=null">
  2964. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2965. </if>
  2966. <if test="status !=null">
  2967. <if test="status==0">
  2968. and a.`type` =0 and a.status =0
  2969. </if>
  2970. <if test="status==1">
  2971. and a.`type` =1 and a.status =0
  2972. </if>
  2973. <if test="status==2">
  2974. and a.`type` =0 and a.status =1
  2975. </if>
  2976. <if test="status==3">
  2977. and a.`type` =1 and a.status =1
  2978. </if>
  2979. <if test="status==4">
  2980. and a.status=2
  2981. </if>
  2982. </if>
  2983. <if test="receiverId !=null">
  2984. and b.task_receiver = #{receiverId}
  2985. </if>
  2986. <if test="startTime !=null and endTime !=null">
  2987. and a.create_time BETWEEN #{startTime} and #{endTime}
  2988. </if>
  2989. </select>
  2990. <select id="selectOrderNoAllByaid" resultType="java.lang.String">
  2991. select order_no
  2992. from t_order_task
  2993. where task_receiver = #{aid} group by order_no
  2994. </select>
  2995. <delete id="deleteBySplitId" parameterType="java.lang.Integer">
  2996. delete from t_order_task
  2997. where split_super = #{id,jdbcType=INTEGER}
  2998. </delete>
  2999. <update id="updateDimissionTransferManager">
  3000. update t_order_task
  3001. set manager_id= #{transferId}
  3002. where manager_id = #{aid}
  3003. </update>
  3004. <select id="selectAll" resultMap="TOrderTaskMap" >
  3005. select
  3006. <include refid="TOrderTaskAllSql" />
  3007. from t_order_task
  3008. where split_status in (0,2)
  3009. </select>
  3010. <select id="selectTasksByTid" resultMap="TOrderTaskMap" >
  3011. select
  3012. <include refid="TOrderTaskAllSql" />
  3013. from t_order_task
  3014. where order_no in (SELECT order_no from t_order_task where id= #{tid})
  3015. </select>
  3016. <select id="selectAdminTaskByTid" resultType="com.goafanti.order.bo.TOrderTaskBo">
  3017. select a.id,a.task_receiver taskReceiver,a.score_number scoreNumber,c.sort cSort
  3018. from t_order_task a left join business_project b on a.commodity_id =b.id
  3019. left join business_category c on b.cid =c.id
  3020. where c.sort in (3,6,9) and a.score_status =2
  3021. and a.task_receiver in (SELECT task_receiver from t_order_task
  3022. where id = #{tid})
  3023. </select>
  3024. </mapper>