TOrderTaskMapper.xml 149 KB

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