TOrderTaskMapper.xml 150 KB

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