TOrderTaskMapper.xml 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401
  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 id="BaseResultMap" type="com.goafanti.common.model.TOrderTask">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  7. <result column="main" jdbcType="INTEGER" property="main" />
  8. <result column="super_id" jdbcType="VARCHAR" property="superId" />
  9. <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
  10. <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
  11. <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
  12. <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
  13. <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
  14. <result column="task_status" jdbcType="INTEGER" property="taskStatus" />
  15. <result column="task_distribution_time" jdbcType="TIMESTAMP" property="taskDistributionTime" />
  16. <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
  17. <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
  18. <result column="task_comment" jdbcType="VARCHAR" property="taskComment" />
  19. <result column="task_start_time" jdbcType="TIMESTAMP" property="taskStartTime" />
  20. <result column="task_end_time" jdbcType="TIMESTAMP" property="taskEndTime" />
  21. <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
  22. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  23. <result column="accept_time" jdbcType="DATE" property="acceptTime" />
  24. <result column="review_time" jdbcType="DATE" property="reviewTime" />
  25. <result column="publicity_time" jdbcType="DATE" property="publicityTime" />
  26. <result column="licence_time" jdbcType="DATE" property="licenceTime" />
  27. <result column="certificate_number" jdbcType="VARCHAR" property="certificateNumber" />
  28. <result column="status" jdbcType="INTEGER" property="status" />
  29. <result column="form_retrieve" jdbcType="INTEGER" property="formRetrieve" />
  30. <result column="task_refund" jdbcType="INTEGER" property="taskRefund" />
  31. <result column="refund_content" jdbcType="VARCHAR" property="refundContent" />
  32. <result column="retrieve_content" jdbcType="VARCHAR" property="retrieveContent" />
  33. <result column="declare_user" jdbcType="VARCHAR" property="declareUser" />
  34. <result column="declare_pwd" jdbcType="VARCHAR" property="declarePwd" />
  35. <result column="set_up_amount" jdbcType="DECIMAL" property="setUpAmount" />
  36. <result column="arrival_money" jdbcType="INTEGER" property="arrivalMoney" />
  37. <result column="outsource_name" jdbcType="VARCHAR" property="outsourceName" />
  38. <result column="outsource_price" jdbcType="DECIMAL" property="outsourcePrice" />
  39. <result column="consultant_id" jdbcType="VARCHAR" property="consultantId" />
  40. <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
  41. <result column="outsource" jdbcType="INTEGER" property="outsource" />
  42. <result column="split_super" jdbcType="INTEGER" property="splitSuper" />
  43. <result column="split_status" jdbcType="INTEGER" property="splitStatus" />
  44. <result column="split_id" jdbcType="INTEGER" property="splitId" />
  45. <result column="split_aid" jdbcType="VARCHAR" property="splitAid" />
  46. <result column="split_time" jdbcType="TIMESTAMP" property="splitTime" />
  47. <result column="cname" jdbcType="VARCHAR" property="cname" />
  48. <result column="receiver_name" jdbcType="VARCHAR" property="receiverName" />
  49. <result column="declaration_batch" jdbcType="INTEGER" property="declarationBatch" />
  50. <result column="cost_reduction" jdbcType="INTEGER" property="costReduction" />
  51. <result column="official_cost" jdbcType="INTEGER" property="officialCost" />
  52. <result column="set_up_status" jdbcType="INTEGER" property="setUpStatus" />
  53. <result column="set_up_time" jdbcType="TIMESTAMP" property="setUpTime" />
  54. <result column="spot_check_status" jdbcType="INTEGER" property="spotCheckStatus" />
  55. <result column="high_tech_status" jdbcType="INTEGER" property="highTechStatus" />
  56. <result column="special_comment" jdbcType="VARCHAR" property="specialComment" />
  57. <result column="if_certification_fee" jdbcType="INTEGER" property="ifCertificationFee" />
  58. <result column="certification_fee" jdbcType="DECIMAL" property="certificationFee" />
  59. <result column="certification_corporate" jdbcType="VARCHAR" property="certificationCorporate" />
  60. <result column="time_record" jdbcType="VARCHAR" property="timeRecord" />
  61. <result column="if_publicity" jdbcType="INTEGER" property="ifPublicity" />
  62. <result column="check_status" jdbcType="INTEGER" property="checkStatus" />
  63. <result column="patent_type" jdbcType="INTEGER" property="patentType" />
  64. <result column="pubicity_url" jdbcType="VARCHAR" property="pubicityUrl" />
  65. <result column="process_status" jdbcType="INTEGER" property="processStatus" />
  66. <result column="member_type" jdbcType="INTEGER" property="memberType" />
  67. <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
  68. <result column="satisfaction_degree" jdbcType="INTEGER" property="satisfactionDegree" />
  69. <result column="satisfaction_degree_url" jdbcType="VARCHAR" property="satisfactionDegreeUrl" />
  70. <result column="tag" jdbcType="INTEGER" property="tag" />
  71. </resultMap>
  72. <sql id="Base_Column_List">
  73. id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
  74. commodity_price, task_status, task_distribution_time, task_allocator, task_receiver,
  75. task_comment, task_start_time, task_end_time, attachment_url, project_status, accept_time,
  76. review_time, publicity_time, licence_time, certificate_number, `status`, form_retrieve,
  77. task_refund, refund_content, retrieve_content, declare_user, declare_pwd, set_up_amount,
  78. arrival_money, outsource_name, outsource_price, consultant_id, manager_id, outsource,
  79. split_super, split_status, split_id, split_aid, split_time, cname, receiver_name,
  80. declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
  81. high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
  82. time_record, if_publicity, check_status, patent_type, pubicity_url, process_status,
  83. member_type, picture_url, satisfaction_degree, satisfaction_degree_url, tag
  84. </sql>
  85. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  86. select
  87. <include refid="Base_Column_List" />
  88. from t_order_task
  89. where id = #{id,jdbcType=INTEGER}
  90. </select>
  91. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  92. delete from t_order_task
  93. where id = #{id,jdbcType=INTEGER}
  94. </delete>
  95. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  96. insert into t_order_task (order_no, main, super_id,
  97. commodity_id, commodity_name, commodity_quantity,
  98. commodity_mode, commodity_price, task_status,
  99. task_distribution_time, task_allocator,
  100. task_receiver, task_comment, task_start_time,
  101. task_end_time, attachment_url, project_status,
  102. accept_time, review_time, publicity_time,
  103. licence_time, certificate_number, `status`,
  104. form_retrieve, task_refund, refund_content,
  105. retrieve_content, declare_user, declare_pwd,
  106. set_up_amount, arrival_money, outsource_name,
  107. outsource_price, consultant_id, manager_id,
  108. outsource, split_super, split_status,
  109. split_id, split_aid, split_time,
  110. cname, receiver_name, declaration_batch,
  111. cost_reduction, official_cost, set_up_status,
  112. set_up_time, spot_check_status, high_tech_status,
  113. special_comment, if_certification_fee, certification_fee,
  114. certification_corporate, time_record, if_publicity,
  115. check_status, patent_type, pubicity_url,
  116. process_status, member_type, picture_url,
  117. satisfaction_degree, satisfaction_degree_url,
  118. tag)
  119. values (#{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{superId,jdbcType=VARCHAR},
  120. #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER},
  121. #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL}, #{taskStatus,jdbcType=INTEGER},
  122. #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR},
  123. #{taskReceiver,jdbcType=VARCHAR}, #{taskComment,jdbcType=VARCHAR}, #{taskStartTime,jdbcType=TIMESTAMP},
  124. #{taskEndTime,jdbcType=TIMESTAMP}, #{attachmentUrl,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
  125. #{acceptTime,jdbcType=DATE}, #{reviewTime,jdbcType=DATE}, #{publicityTime,jdbcType=DATE},
  126. #{licenceTime,jdbcType=DATE}, #{certificateNumber,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  127. #{formRetrieve,jdbcType=INTEGER}, #{taskRefund,jdbcType=INTEGER}, #{refundContent,jdbcType=VARCHAR},
  128. #{retrieveContent,jdbcType=VARCHAR}, #{declareUser,jdbcType=VARCHAR}, #{declarePwd,jdbcType=VARCHAR},
  129. #{setUpAmount,jdbcType=DECIMAL}, #{arrivalMoney,jdbcType=INTEGER}, #{outsourceName,jdbcType=VARCHAR},
  130. #{outsourcePrice,jdbcType=DECIMAL}, #{consultantId,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR},
  131. #{outsource,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{splitStatus,jdbcType=INTEGER},
  132. #{splitId,jdbcType=INTEGER}, #{splitAid,jdbcType=VARCHAR}, #{splitTime,jdbcType=TIMESTAMP},
  133. #{cname,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, #{declarationBatch,jdbcType=INTEGER},
  134. #{costReduction,jdbcType=INTEGER}, #{officialCost,jdbcType=INTEGER}, #{setUpStatus,jdbcType=INTEGER},
  135. #{setUpTime,jdbcType=TIMESTAMP}, #{spotCheckStatus,jdbcType=INTEGER}, #{highTechStatus,jdbcType=INTEGER},
  136. #{specialComment,jdbcType=VARCHAR}, #{ifCertificationFee,jdbcType=INTEGER}, #{certificationFee,jdbcType=DECIMAL},
  137. #{certificationCorporate,jdbcType=VARCHAR}, #{timeRecord,jdbcType=VARCHAR}, #{ifPublicity,jdbcType=INTEGER},
  138. #{checkStatus,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{pubicityUrl,jdbcType=VARCHAR},
  139. #{processStatus,jdbcType=INTEGER}, #{memberType,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR},
  140. #{satisfactionDegree,jdbcType=INTEGER}, #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  141. #{tag,jdbcType=INTEGER})
  142. </insert>
  143. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  144. insert into t_order_task
  145. <trim prefix="(" suffix=")" suffixOverrides=",">
  146. <if test="orderNo != null">
  147. order_no,
  148. </if>
  149. <if test="main != null">
  150. main,
  151. </if>
  152. <if test="superId != null">
  153. super_id,
  154. </if>
  155. <if test="commodityId != null">
  156. commodity_id,
  157. </if>
  158. <if test="commodityName != null">
  159. commodity_name,
  160. </if>
  161. <if test="commodityQuantity != null">
  162. commodity_quantity,
  163. </if>
  164. <if test="commodityMode != null">
  165. commodity_mode,
  166. </if>
  167. <if test="commodityPrice != null">
  168. commodity_price,
  169. </if>
  170. <if test="taskStatus != null">
  171. task_status,
  172. </if>
  173. <if test="taskDistributionTime != null">
  174. task_distribution_time,
  175. </if>
  176. <if test="taskAllocator != null">
  177. task_allocator,
  178. </if>
  179. <if test="taskReceiver != null">
  180. task_receiver,
  181. </if>
  182. <if test="taskComment != null">
  183. task_comment,
  184. </if>
  185. <if test="taskStartTime != null">
  186. task_start_time,
  187. </if>
  188. <if test="taskEndTime != null">
  189. task_end_time,
  190. </if>
  191. <if test="attachmentUrl != null">
  192. attachment_url,
  193. </if>
  194. <if test="projectStatus != null">
  195. project_status,
  196. </if>
  197. <if test="acceptTime != null">
  198. accept_time,
  199. </if>
  200. <if test="reviewTime != null">
  201. review_time,
  202. </if>
  203. <if test="publicityTime != null">
  204. publicity_time,
  205. </if>
  206. <if test="licenceTime != null">
  207. licence_time,
  208. </if>
  209. <if test="certificateNumber != null">
  210. certificate_number,
  211. </if>
  212. <if test="status != null">
  213. `status`,
  214. </if>
  215. <if test="formRetrieve != null">
  216. form_retrieve,
  217. </if>
  218. <if test="taskRefund != null">
  219. task_refund,
  220. </if>
  221. <if test="refundContent != null">
  222. refund_content,
  223. </if>
  224. <if test="retrieveContent != null">
  225. retrieve_content,
  226. </if>
  227. <if test="declareUser != null">
  228. declare_user,
  229. </if>
  230. <if test="declarePwd != null">
  231. declare_pwd,
  232. </if>
  233. <if test="setUpAmount != null">
  234. set_up_amount,
  235. </if>
  236. <if test="arrivalMoney != null">
  237. arrival_money,
  238. </if>
  239. <if test="outsourceName != null">
  240. outsource_name,
  241. </if>
  242. <if test="outsourcePrice != null">
  243. outsource_price,
  244. </if>
  245. <if test="consultantId != null">
  246. consultant_id,
  247. </if>
  248. <if test="managerId != null">
  249. manager_id,
  250. </if>
  251. <if test="outsource != null">
  252. outsource,
  253. </if>
  254. <if test="splitSuper != null">
  255. split_super,
  256. </if>
  257. <if test="splitStatus != null">
  258. split_status,
  259. </if>
  260. <if test="splitId != null">
  261. split_id,
  262. </if>
  263. <if test="splitAid != null">
  264. split_aid,
  265. </if>
  266. <if test="splitTime != null">
  267. split_time,
  268. </if>
  269. <if test="cname != null">
  270. cname,
  271. </if>
  272. <if test="receiverName != null">
  273. receiver_name,
  274. </if>
  275. <if test="declarationBatch != null">
  276. declaration_batch,
  277. </if>
  278. <if test="costReduction != null">
  279. cost_reduction,
  280. </if>
  281. <if test="officialCost != null">
  282. official_cost,
  283. </if>
  284. <if test="setUpStatus != null">
  285. set_up_status,
  286. </if>
  287. <if test="setUpTime != null">
  288. set_up_time,
  289. </if>
  290. <if test="spotCheckStatus != null">
  291. spot_check_status,
  292. </if>
  293. <if test="highTechStatus != null">
  294. high_tech_status,
  295. </if>
  296. <if test="specialComment != null">
  297. special_comment,
  298. </if>
  299. <if test="ifCertificationFee != null">
  300. if_certification_fee,
  301. </if>
  302. <if test="certificationFee != null">
  303. certification_fee,
  304. </if>
  305. <if test="certificationCorporate != null">
  306. certification_corporate,
  307. </if>
  308. <if test="timeRecord != null">
  309. time_record,
  310. </if>
  311. <if test="ifPublicity != null">
  312. if_publicity,
  313. </if>
  314. <if test="checkStatus != null">
  315. check_status,
  316. </if>
  317. <if test="patentType != null">
  318. patent_type,
  319. </if>
  320. <if test="pubicityUrl != null">
  321. pubicity_url,
  322. </if>
  323. <if test="processStatus != null">
  324. process_status,
  325. </if>
  326. <if test="memberType != null">
  327. member_type,
  328. </if>
  329. <if test="pictureUrl != null">
  330. picture_url,
  331. </if>
  332. <if test="satisfactionDegree != null">
  333. satisfaction_degree,
  334. </if>
  335. <if test="satisfactionDegreeUrl != null">
  336. satisfaction_degree_url,
  337. </if>
  338. <if test="tag != null">
  339. tag,
  340. </if>
  341. </trim>
  342. <trim prefix="values (" suffix=")" suffixOverrides=",">
  343. <if test="orderNo != null">
  344. #{orderNo,jdbcType=VARCHAR},
  345. </if>
  346. <if test="main != null">
  347. #{main,jdbcType=INTEGER},
  348. </if>
  349. <if test="superId != null">
  350. #{superId,jdbcType=VARCHAR},
  351. </if>
  352. <if test="commodityId != null">
  353. #{commodityId,jdbcType=VARCHAR},
  354. </if>
  355. <if test="commodityName != null">
  356. #{commodityName,jdbcType=VARCHAR},
  357. </if>
  358. <if test="commodityQuantity != null">
  359. #{commodityQuantity,jdbcType=INTEGER},
  360. </if>
  361. <if test="commodityMode != null">
  362. #{commodityMode,jdbcType=VARCHAR},
  363. </if>
  364. <if test="commodityPrice != null">
  365. #{commodityPrice,jdbcType=DECIMAL},
  366. </if>
  367. <if test="taskStatus != null">
  368. #{taskStatus,jdbcType=INTEGER},
  369. </if>
  370. <if test="taskDistributionTime != null">
  371. #{taskDistributionTime,jdbcType=TIMESTAMP},
  372. </if>
  373. <if test="taskAllocator != null">
  374. #{taskAllocator,jdbcType=VARCHAR},
  375. </if>
  376. <if test="taskReceiver != null">
  377. #{taskReceiver,jdbcType=VARCHAR},
  378. </if>
  379. <if test="taskComment != null">
  380. #{taskComment,jdbcType=VARCHAR},
  381. </if>
  382. <if test="taskStartTime != null">
  383. #{taskStartTime,jdbcType=TIMESTAMP},
  384. </if>
  385. <if test="taskEndTime != null">
  386. #{taskEndTime,jdbcType=TIMESTAMP},
  387. </if>
  388. <if test="attachmentUrl != null">
  389. #{attachmentUrl,jdbcType=VARCHAR},
  390. </if>
  391. <if test="projectStatus != null">
  392. #{projectStatus,jdbcType=INTEGER},
  393. </if>
  394. <if test="acceptTime != null">
  395. #{acceptTime,jdbcType=DATE},
  396. </if>
  397. <if test="reviewTime != null">
  398. #{reviewTime,jdbcType=DATE},
  399. </if>
  400. <if test="publicityTime != null">
  401. #{publicityTime,jdbcType=DATE},
  402. </if>
  403. <if test="licenceTime != null">
  404. #{licenceTime,jdbcType=DATE},
  405. </if>
  406. <if test="certificateNumber != null">
  407. #{certificateNumber,jdbcType=VARCHAR},
  408. </if>
  409. <if test="status != null">
  410. #{status,jdbcType=INTEGER},
  411. </if>
  412. <if test="formRetrieve != null">
  413. #{formRetrieve,jdbcType=INTEGER},
  414. </if>
  415. <if test="taskRefund != null">
  416. #{taskRefund,jdbcType=INTEGER},
  417. </if>
  418. <if test="refundContent != null">
  419. #{refundContent,jdbcType=VARCHAR},
  420. </if>
  421. <if test="retrieveContent != null">
  422. #{retrieveContent,jdbcType=VARCHAR},
  423. </if>
  424. <if test="declareUser != null">
  425. #{declareUser,jdbcType=VARCHAR},
  426. </if>
  427. <if test="declarePwd != null">
  428. #{declarePwd,jdbcType=VARCHAR},
  429. </if>
  430. <if test="setUpAmount != null">
  431. #{setUpAmount,jdbcType=DECIMAL},
  432. </if>
  433. <if test="arrivalMoney != null">
  434. #{arrivalMoney,jdbcType=INTEGER},
  435. </if>
  436. <if test="outsourceName != null">
  437. #{outsourceName,jdbcType=VARCHAR},
  438. </if>
  439. <if test="outsourcePrice != null">
  440. #{outsourcePrice,jdbcType=DECIMAL},
  441. </if>
  442. <if test="consultantId != null">
  443. #{consultantId,jdbcType=VARCHAR},
  444. </if>
  445. <if test="managerId != null">
  446. #{managerId,jdbcType=VARCHAR},
  447. </if>
  448. <if test="outsource != null">
  449. #{outsource,jdbcType=INTEGER},
  450. </if>
  451. <if test="splitSuper != null">
  452. #{splitSuper,jdbcType=INTEGER},
  453. </if>
  454. <if test="splitStatus != null">
  455. #{splitStatus,jdbcType=INTEGER},
  456. </if>
  457. <if test="splitId != null">
  458. #{splitId,jdbcType=INTEGER},
  459. </if>
  460. <if test="splitAid != null">
  461. #{splitAid,jdbcType=VARCHAR},
  462. </if>
  463. <if test="splitTime != null">
  464. #{splitTime,jdbcType=TIMESTAMP},
  465. </if>
  466. <if test="cname != null">
  467. #{cname,jdbcType=VARCHAR},
  468. </if>
  469. <if test="receiverName != null">
  470. #{receiverName,jdbcType=VARCHAR},
  471. </if>
  472. <if test="declarationBatch != null">
  473. #{declarationBatch,jdbcType=INTEGER},
  474. </if>
  475. <if test="costReduction != null">
  476. #{costReduction,jdbcType=INTEGER},
  477. </if>
  478. <if test="officialCost != null">
  479. #{officialCost,jdbcType=INTEGER},
  480. </if>
  481. <if test="setUpStatus != null">
  482. #{setUpStatus,jdbcType=INTEGER},
  483. </if>
  484. <if test="setUpTime != null">
  485. #{setUpTime,jdbcType=TIMESTAMP},
  486. </if>
  487. <if test="spotCheckStatus != null">
  488. #{spotCheckStatus,jdbcType=INTEGER},
  489. </if>
  490. <if test="highTechStatus != null">
  491. #{highTechStatus,jdbcType=INTEGER},
  492. </if>
  493. <if test="specialComment != null">
  494. #{specialComment,jdbcType=VARCHAR},
  495. </if>
  496. <if test="ifCertificationFee != null">
  497. #{ifCertificationFee,jdbcType=INTEGER},
  498. </if>
  499. <if test="certificationFee != null">
  500. #{certificationFee,jdbcType=DECIMAL},
  501. </if>
  502. <if test="certificationCorporate != null">
  503. #{certificationCorporate,jdbcType=VARCHAR},
  504. </if>
  505. <if test="timeRecord != null">
  506. #{timeRecord,jdbcType=VARCHAR},
  507. </if>
  508. <if test="ifPublicity != null">
  509. #{ifPublicity,jdbcType=INTEGER},
  510. </if>
  511. <if test="checkStatus != null">
  512. #{checkStatus,jdbcType=INTEGER},
  513. </if>
  514. <if test="patentType != null">
  515. #{patentType,jdbcType=INTEGER},
  516. </if>
  517. <if test="pubicityUrl != null">
  518. #{pubicityUrl,jdbcType=VARCHAR},
  519. </if>
  520. <if test="processStatus != null">
  521. #{processStatus,jdbcType=INTEGER},
  522. </if>
  523. <if test="memberType != null">
  524. #{memberType,jdbcType=INTEGER},
  525. </if>
  526. <if test="pictureUrl != null">
  527. #{pictureUrl,jdbcType=VARCHAR},
  528. </if>
  529. <if test="satisfactionDegree != null">
  530. #{satisfactionDegree,jdbcType=INTEGER},
  531. </if>
  532. <if test="satisfactionDegreeUrl != null">
  533. #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  534. </if>
  535. <if test="tag != null">
  536. #{tag,jdbcType=INTEGER},
  537. </if>
  538. </trim>
  539. </insert>
  540. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
  541. update t_order_task
  542. <set>
  543. <if test="orderNo != null">
  544. order_no = #{orderNo,jdbcType=VARCHAR},
  545. </if>
  546. <if test="main != null">
  547. main = #{main,jdbcType=INTEGER},
  548. </if>
  549. <if test="superId != null">
  550. super_id = #{superId,jdbcType=VARCHAR},
  551. </if>
  552. <if test="commodityId != null">
  553. commodity_id = #{commodityId,jdbcType=VARCHAR},
  554. </if>
  555. <if test="commodityName != null">
  556. commodity_name = #{commodityName,jdbcType=VARCHAR},
  557. </if>
  558. <if test="commodityQuantity != null">
  559. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  560. </if>
  561. <if test="commodityMode != null">
  562. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  563. </if>
  564. <if test="commodityPrice != null">
  565. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  566. </if>
  567. <if test="taskStatus != null">
  568. task_status = #{taskStatus,jdbcType=INTEGER},
  569. </if>
  570. <if test="taskDistributionTime != null">
  571. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  572. </if>
  573. <if test="taskAllocator != null">
  574. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  575. </if>
  576. <if test="taskReceiver != null">
  577. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  578. </if>
  579. <if test="taskComment != null">
  580. task_comment = #{taskComment,jdbcType=VARCHAR},
  581. </if>
  582. <if test="taskStartTime != null">
  583. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  584. </if>
  585. <if test="taskEndTime != null">
  586. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  587. </if>
  588. <if test="attachmentUrl != null">
  589. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  590. </if>
  591. <if test="projectStatus != null">
  592. project_status = #{projectStatus,jdbcType=INTEGER},
  593. </if>
  594. <if test="acceptTime != null">
  595. accept_time = #{acceptTime,jdbcType=DATE},
  596. </if>
  597. <if test="reviewTime != null">
  598. review_time = #{reviewTime,jdbcType=DATE},
  599. </if>
  600. <if test="publicityTime != null">
  601. publicity_time = #{publicityTime,jdbcType=DATE},
  602. </if>
  603. <if test="licenceTime != null">
  604. licence_time = #{licenceTime,jdbcType=DATE},
  605. </if>
  606. <if test="certificateNumber != null">
  607. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  608. </if>
  609. <if test="status != null">
  610. `status` = #{status,jdbcType=INTEGER},
  611. </if>
  612. <if test="formRetrieve != null">
  613. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  614. </if>
  615. <if test="taskRefund != null">
  616. task_refund = #{taskRefund,jdbcType=INTEGER},
  617. </if>
  618. <if test="refundContent != null">
  619. refund_content = #{refundContent,jdbcType=VARCHAR},
  620. </if>
  621. <if test="retrieveContent != null">
  622. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  623. </if>
  624. <if test="declareUser != null">
  625. declare_user = #{declareUser,jdbcType=VARCHAR},
  626. </if>
  627. <if test="declarePwd != null">
  628. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  629. </if>
  630. <if test="setUpAmount != null">
  631. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  632. </if>
  633. <if test="arrivalMoney != null">
  634. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  635. </if>
  636. <if test="outsourceName != null">
  637. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  638. </if>
  639. <if test="outsourcePrice != null">
  640. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  641. </if>
  642. <if test="consultantId != null">
  643. consultant_id = #{consultantId,jdbcType=VARCHAR},
  644. </if>
  645. <if test="managerId != null">
  646. manager_id = #{managerId,jdbcType=VARCHAR},
  647. </if>
  648. <if test="outsource != null">
  649. outsource = #{outsource,jdbcType=INTEGER},
  650. </if>
  651. <if test="splitSuper != null">
  652. split_super = #{splitSuper,jdbcType=INTEGER},
  653. </if>
  654. <if test="splitStatus != null">
  655. split_status = #{splitStatus,jdbcType=INTEGER},
  656. </if>
  657. <if test="splitId != null">
  658. split_id = #{splitId,jdbcType=INTEGER},
  659. </if>
  660. <if test="splitAid != null">
  661. split_aid = #{splitAid,jdbcType=VARCHAR},
  662. </if>
  663. <if test="splitTime != null">
  664. split_time = #{splitTime,jdbcType=TIMESTAMP},
  665. </if>
  666. <if test="cname != null">
  667. cname = #{cname,jdbcType=VARCHAR},
  668. </if>
  669. <if test="receiverName != null">
  670. receiver_name = #{receiverName,jdbcType=VARCHAR},
  671. </if>
  672. <if test="declarationBatch != null">
  673. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  674. </if>
  675. <if test="costReduction != null">
  676. cost_reduction = #{costReduction,jdbcType=INTEGER},
  677. </if>
  678. <if test="officialCost != null">
  679. official_cost = #{officialCost,jdbcType=INTEGER},
  680. </if>
  681. <if test="setUpStatus != null">
  682. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  683. </if>
  684. <if test="setUpTime != null">
  685. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  686. </if>
  687. <if test="spotCheckStatus != null">
  688. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  689. </if>
  690. <if test="highTechStatus != null">
  691. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  692. </if>
  693. <if test="specialComment != null">
  694. special_comment = #{specialComment,jdbcType=VARCHAR},
  695. </if>
  696. <if test="ifCertificationFee != null">
  697. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  698. </if>
  699. <if test="certificationFee != null">
  700. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  701. </if>
  702. <if test="certificationCorporate != null">
  703. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  704. </if>
  705. <if test="timeRecord != null">
  706. time_record = #{timeRecord,jdbcType=VARCHAR},
  707. </if>
  708. <if test="ifPublicity != null">
  709. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  710. </if>
  711. <if test="checkStatus != null">
  712. check_status = #{checkStatus,jdbcType=INTEGER},
  713. </if>
  714. <if test="patentType != null">
  715. patent_type = #{patentType,jdbcType=INTEGER},
  716. </if>
  717. <if test="pubicityUrl != null">
  718. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
  719. </if>
  720. <if test="processStatus != null">
  721. process_status = #{processStatus,jdbcType=INTEGER},
  722. </if>
  723. <if test="memberType != null">
  724. member_type = #{memberType,jdbcType=INTEGER},
  725. </if>
  726. <if test="pictureUrl != null">
  727. picture_url = #{pictureUrl,jdbcType=VARCHAR},
  728. </if>
  729. <if test="satisfactionDegree != null">
  730. satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
  731. </if>
  732. <if test="satisfactionDegreeUrl != null">
  733. satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  734. </if>
  735. <if test="tag != null">
  736. tag = #{tag,jdbcType=INTEGER},
  737. </if>
  738. </set>
  739. where id = #{id,jdbcType=INTEGER}
  740. </update>
  741. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderTask">
  742. update t_order_task
  743. set order_no = #{orderNo,jdbcType=VARCHAR},
  744. main = #{main,jdbcType=INTEGER},
  745. super_id = #{superId,jdbcType=VARCHAR},
  746. commodity_id = #{commodityId,jdbcType=VARCHAR},
  747. commodity_name = #{commodityName,jdbcType=VARCHAR},
  748. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  749. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  750. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  751. task_status = #{taskStatus,jdbcType=INTEGER},
  752. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  753. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  754. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  755. task_comment = #{taskComment,jdbcType=VARCHAR},
  756. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  757. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  758. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  759. project_status = #{projectStatus,jdbcType=INTEGER},
  760. accept_time = #{acceptTime,jdbcType=DATE},
  761. review_time = #{reviewTime,jdbcType=DATE},
  762. publicity_time = #{publicityTime,jdbcType=DATE},
  763. licence_time = #{licenceTime,jdbcType=DATE},
  764. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  765. `status` = #{status,jdbcType=INTEGER},
  766. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  767. task_refund = #{taskRefund,jdbcType=INTEGER},
  768. refund_content = #{refundContent,jdbcType=VARCHAR},
  769. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  770. declare_user = #{declareUser,jdbcType=VARCHAR},
  771. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  772. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  773. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  774. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  775. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  776. consultant_id = #{consultantId,jdbcType=VARCHAR},
  777. manager_id = #{managerId,jdbcType=VARCHAR},
  778. outsource = #{outsource,jdbcType=INTEGER},
  779. split_super = #{splitSuper,jdbcType=INTEGER},
  780. split_status = #{splitStatus,jdbcType=INTEGER},
  781. split_id = #{splitId,jdbcType=INTEGER},
  782. split_aid = #{splitAid,jdbcType=VARCHAR},
  783. split_time = #{splitTime,jdbcType=TIMESTAMP},
  784. cname = #{cname,jdbcType=VARCHAR},
  785. receiver_name = #{receiverName,jdbcType=VARCHAR},
  786. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  787. cost_reduction = #{costReduction,jdbcType=INTEGER},
  788. official_cost = #{officialCost,jdbcType=INTEGER},
  789. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  790. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  791. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  792. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  793. special_comment = #{specialComment,jdbcType=VARCHAR},
  794. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  795. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  796. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  797. time_record = #{timeRecord,jdbcType=VARCHAR},
  798. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  799. check_status = #{checkStatus,jdbcType=INTEGER},
  800. patent_type = #{patentType,jdbcType=INTEGER},
  801. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
  802. process_status = #{processStatus,jdbcType=INTEGER},
  803. member_type = #{memberType,jdbcType=INTEGER},
  804. picture_url = #{pictureUrl,jdbcType=VARCHAR},
  805. satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
  806. satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  807. tag = #{tag,jdbcType=INTEGER}
  808. where id = #{id,jdbcType=INTEGER}
  809. </update>
  810. <update id="updateBySuperId">
  811. update t_order_task
  812. <set>
  813. <if test="orderNo != null">
  814. order_no = #{orderNo,jdbcType=VARCHAR},
  815. </if>
  816. <if test="main != null">
  817. main = #{main,jdbcType=INTEGER},
  818. </if>
  819. <if test="superId != null">
  820. super_id = #{superId,jdbcType=VARCHAR},
  821. </if>
  822. <if test="commodityId != null">
  823. commodity_id = #{commodityId,jdbcType=VARCHAR},
  824. </if>
  825. <if test="commodityName != null">
  826. commodity_name = #{commodityName,jdbcType=VARCHAR},
  827. </if>
  828. <if test="commodityQuantity != null">
  829. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  830. </if>
  831. <if test="commodityMode != null">
  832. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  833. </if>
  834. <if test="commodityPrice != null">
  835. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  836. </if>
  837. <if test="taskStatus != null">
  838. task_status = #{taskStatus,jdbcType=INTEGER},
  839. </if>
  840. <if test="taskDistributionTime != null">
  841. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  842. </if>
  843. <if test="taskAllocator != null">
  844. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  845. </if>
  846. <if test="taskReceiver != null">
  847. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  848. </if>
  849. <if test="taskComment != null">
  850. task_comment = #{taskComment,jdbcType=VARCHAR},
  851. </if>
  852. <if test="taskStartTime != null">
  853. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  854. </if>
  855. <if test="taskEndTime != null">
  856. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  857. </if>
  858. <if test="attachmentUrl != null">
  859. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  860. </if>
  861. <if test="projectStatus != null">
  862. project_status = #{projectStatus,jdbcType=INTEGER},
  863. </if>
  864. <if test="acceptTime != null">
  865. accept_time = #{acceptTime,jdbcType=DATE},
  866. </if>
  867. <if test="reviewTime != null">
  868. review_time = #{reviewTime,jdbcType=DATE},
  869. </if>
  870. <if test="publicityTime != null">
  871. publicity_time = #{publicityTime,jdbcType=DATE},
  872. </if>
  873. <if test="licenceTime != null">
  874. licence_time = #{licenceTime,jdbcType=DATE},
  875. </if>
  876. <if test="certificateNumber != null">
  877. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  878. </if>
  879. <if test="status != null">
  880. `status` = #{status,jdbcType=INTEGER},
  881. </if>
  882. <if test="formRetrieve != null">
  883. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  884. </if>
  885. <if test="taskRefund != null">
  886. task_refund = #{taskRefund,jdbcType=INTEGER},
  887. </if>
  888. <if test="refundContent != null">
  889. refund_content = #{refundContent,jdbcType=VARCHAR},
  890. </if>
  891. <if test="retrieveContent != null">
  892. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  893. </if>
  894. <if test="declareUser != null">
  895. declare_user = #{declareUser,jdbcType=VARCHAR},
  896. </if>
  897. <if test="declarePwd != null">
  898. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  899. </if>
  900. <if test="setUpAmount != null">
  901. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  902. </if>
  903. <if test="arrivalMoney != null">
  904. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  905. </if>
  906. <if test="outsourceName != null">
  907. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  908. </if>
  909. <if test="outsourcePrice != null">
  910. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  911. </if>
  912. <if test="consultantId != null">
  913. consultant_id = #{consultantId,jdbcType=VARCHAR},
  914. </if>
  915. <if test="managerId != null">
  916. manager_id = #{managerId,jdbcType=VARCHAR},
  917. </if>
  918. <if test="outsource != null">
  919. outsource = #{outsource,jdbcType=INTEGER},
  920. </if>
  921. <if test="splitStatus != null">
  922. split_status = #{splitStatus,jdbcType=INTEGER},
  923. </if>
  924. <if test="splitId != null">
  925. split_id = #{splitId,jdbcType=INTEGER},
  926. </if>
  927. <if test="splitAid != null">
  928. split_aid = #{splitAid,jdbcType=VARCHAR},
  929. </if>
  930. <if test="splitTime != null">
  931. split_time = #{splitTime,jdbcType=TIMESTAMP},
  932. </if>
  933. <if test="cname != null">
  934. cname = #{cname,jdbcType=VARCHAR},
  935. </if>
  936. <if test="receiverName != null">
  937. receiver_name = #{receiverName,jdbcType=VARCHAR},
  938. </if>
  939. <if test="declarationBatch != null">
  940. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  941. </if>
  942. <if test="costReduction != null">
  943. cost_reduction = #{costReduction,jdbcType=INTEGER},
  944. </if>
  945. <if test="officialCost != null">
  946. official_cost = #{officialCost,jdbcType=INTEGER},
  947. </if>
  948. <if test="setUpStatus != null">
  949. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  950. </if>
  951. <if test="setUpTime != null">
  952. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  953. </if>
  954. <if test="spotCheckStatus != null">
  955. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  956. </if>
  957. <if test="highTechStatus != null">
  958. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  959. </if>
  960. <if test="specialComment != null">
  961. special_comment = #{specialComment,jdbcType=VARCHAR},
  962. </if>
  963. <if test="ifCertificationFee != null">
  964. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  965. </if>
  966. <if test="certificationFee != null">
  967. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  968. </if>
  969. <if test="certificationCorporate != null">
  970. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  971. </if>
  972. <if test="timeRecord != null">
  973. time_record = #{timeRecord,jdbcType=VARCHAR},
  974. </if>
  975. <if test="ifPublicity != null">
  976. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  977. </if>
  978. <if test="checkStatus != null">
  979. check_status = #{checkStatus,jdbcType=INTEGER},
  980. </if>
  981. <if test="patentType != null">
  982. patent_type = #{patentType,jdbcType=INTEGER},
  983. </if>
  984. <if test="pubicityUrl != null">
  985. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
  986. </if>
  987. <if test="processStatus != null">
  988. process_status = #{processStatus,jdbcType=INTEGER},
  989. </if>
  990. <if test="memberType != null">
  991. member_type = #{memberType,jdbcType=INTEGER},
  992. </if>
  993. <if test="pictureUrl != null">
  994. picture_url = #{pictureUrl,jdbcType=VARCHAR},
  995. </if>
  996. <if test="satisfactionDegree != null">
  997. satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
  998. </if>
  999. <if test="satisfactionDegreeUrl != null">
  1000. satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
  1001. </if>
  1002. <if test="tag != null">
  1003. tag = #{tag,jdbcType=INTEGER},
  1004. </if>
  1005. </set>
  1006. where split_super = #{splitSuper,jdbcType=INTEGER}
  1007. </update>
  1008. <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1009. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
  1010. a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
  1011. e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1012. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,b.patent_transfer patentTransfer ,
  1013. i.price,a.certificate_number as certificateNumber, a.commodity_id as commodityId,a.manager_id managerId,
  1014. a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,j.contract_term contractTerm,
  1015. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,ttm.stop_type stopType,ttm.stop_status stopStatus,
  1016. a.task_receiver as taskReceiver ,a.if_certification_fee ifCertificationFee , a.split_status splitStatus,
  1017. a.cost_reduction costReduction,a.official_cost officialCost,i.`type` ,d.name ,a.declaration_batch declarationBatch,
  1018. a.patent_type patentType,a.picture_url pictureUrl,j.service_life serviceLife ,j.service_year serviceYear,j.year_sum yearSum,ttm.change,
  1019. ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,ttm.stop_status projectStopStatus
  1020. 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
  1021. 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
  1022. left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id
  1023. left join admin d on a.task_receiver=d.id left join t_task_member j on a.id =j.tid
  1024. left join t_task_mid ttm on a.id=ttm.tid
  1025. where a.super_id is null and a.split_status in(0,1)
  1026. <if test="orderNo != null">
  1027. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1028. </if>
  1029. <if test="type == 1">
  1030. and a.process_status in(0,3)
  1031. </if>
  1032. order by a.id
  1033. </select>
  1034. <select id="selectOrderTaskAll" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1035. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,a.outsource,
  1036. a.outsource_price outsourcePrice,g.name depName,e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1037. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,a.receiver_name receiverName,
  1038. a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
  1039. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus, a.task_receiver as taskReceiver ,
  1040. a.split_status splitStatus,a.split_super splitSuper,a.split_aid splitAid,a.split_time splitTime,a.patent_type patentType,ttm.contract_term contractTerm,
  1041. a.picture_url pictureUrl, ttm.service_life serviceLife ,ttm.service_year serviceYear,ttm.year_sum yearSum,
  1042. tm.last_year lastYear,tm.last_year_capital lastYearCapital,tm.last_year_income lastYearIncome
  1043. 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
  1044. 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
  1045. left join business_category c on i.cid=c.id left join admin d on a.task_receiver=d.id
  1046. left join t_task_member ttm on a.id=ttm.tid left join t_task_mid tm on a.id=tm.tid
  1047. where a.super_id is null and a.process_status in (0,3) and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1048. <if test="splitStatus !=null">
  1049. <if test="splitStatus &lt; 3">
  1050. and a.split_status= #{splitStatus}
  1051. </if>
  1052. <if test="splitStatus ==3">
  1053. and a.split_status in(0,1)
  1054. </if>
  1055. <if test="splitStatus ==4">
  1056. and a.split_status in(0,2)
  1057. </if>
  1058. </if>
  1059. order by a.id
  1060. </select>
  1061. <select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1062. 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,
  1063. 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,
  1064. 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 ,
  1065. 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 ,
  1066. 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,
  1067. date_format(e.create_time ,'%Y-%m-%d')creteTime,a.patent_type patentType
  1068. 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
  1069. 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
  1070. 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
  1071. on a.id=l.tid left join t_task_mid ttm on a.id=ttm.tid where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1072. and a.outsource= #{outsource,jdbcType=INTEGER}
  1073. <if test="role == 0 ">
  1074. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1075. </if>
  1076. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1077. and e.finance_id in
  1078. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1079. #{item}
  1080. </foreach>
  1081. </if>
  1082. <if test="specially == 0 ">
  1083. and a.split_status in (0,2)
  1084. </if>
  1085. <if test="orderNo != null">
  1086. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1087. </if>
  1088. <if test="approval ==0">
  1089. and e.approval = 0
  1090. </if>
  1091. <if test="approval ==1">
  1092. and e.approval in(1,2)
  1093. </if>
  1094. <if test="approval ==2">
  1095. and e.approval in (4,5)
  1096. </if>
  1097. <if test="cid != null">
  1098. and c.id = #{cid}
  1099. </if>
  1100. <if test="outsourceStatus !=null">
  1101. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1102. </if>
  1103. <if test="contractNo != null">
  1104. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1105. </if>
  1106. <if test="projectStatus != null">
  1107. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1108. </if>
  1109. <if test="deps != null">
  1110. and e.order_dep in
  1111. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  1112. #{depId}
  1113. </foreach>
  1114. </if>
  1115. <if test="name != null">
  1116. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1117. </if>
  1118. <if test="taskId != null">
  1119. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1120. </if>
  1121. <if test="taskStatus != null">
  1122. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1123. </if>
  1124. <if test="adminName != null">
  1125. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1126. </if>
  1127. <if test="startTime != null and endTime != null">
  1128. and e.sign_time between #{startTime} and #{endTime}
  1129. </if>
  1130. order by a.task_distribution_time desc
  1131. <if test="page_sql!=null">
  1132. ${page_sql}
  1133. </if>
  1134. </select>
  1135. <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
  1136. select count(*) from t_order_task a
  1137. left join t_order_new e on a.order_no=e.order_no
  1138. <if test="cid != null">
  1139. left join business_project b on a.commodity_id=b.id
  1140. left join business_category c on b.cid=c.id
  1141. </if>
  1142. <if test="name != null">
  1143. left join user f on e.buyer_id=f.id
  1144. </if>
  1145. <if test="outsourceStatus !=null">
  1146. left join t_order_outsource l on a.id=l.tid
  1147. </if>
  1148. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1149. and a.outsource= #{outsource,jdbcType=INTEGER}
  1150. <if test="role == 0 ">
  1151. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1152. </if>
  1153. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1154. and e.finance_id in
  1155. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1156. #{item}
  1157. </foreach>
  1158. </if>
  1159. <if test="specially == 0 ">
  1160. and a.split_status in (0,2)
  1161. </if>
  1162. <if test="orderNo != null">
  1163. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1164. </if>
  1165. <if test="approval ==0">
  1166. and e.approval = 0
  1167. </if>
  1168. <if test="approval ==1">
  1169. and e.approval in(1,2)
  1170. </if>
  1171. <if test="approval ==2">
  1172. and e.approval in (4,5)
  1173. </if>
  1174. <if test="cid != null">
  1175. and c.id = #{cid}
  1176. </if>
  1177. <if test="outsourceStatus !=null">
  1178. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1179. </if>
  1180. <if test="contractNo != null">
  1181. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1182. </if>
  1183. <if test="projectStatus != null">
  1184. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1185. </if>
  1186. <if test="deps != null">
  1187. and e.order_dep in
  1188. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  1189. #{depId}
  1190. </foreach>
  1191. </if>
  1192. <if test="name != null">
  1193. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1194. </if>
  1195. <if test="taskId != null">
  1196. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1197. </if>
  1198. <if test="taskStatus != null">
  1199. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1200. </if>
  1201. <if test="adminName != null">
  1202. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1203. </if>
  1204. <if test="startTime != null and endTime != null">
  1205. and e.sign_time between #{startTime} and #{endTime}
  1206. </if>
  1207. </select>
  1208. <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
  1209. select
  1210. 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,
  1211. 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,
  1212. 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,
  1213. 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,
  1214. 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,
  1215. 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 ,
  1216. 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,
  1217. 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,
  1218. 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,
  1219. a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
  1220. 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 ,
  1221. a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus,
  1222. ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity,
  1223. a.satisfaction_degree satisfactionDegree,a.satisfaction_degree_url satisfactionDegreeUrl
  1224. 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
  1225. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1226. 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
  1227. left join admin g on e.salesman_id=g.id
  1228. where a.id= #{id,jdbcType=VARCHAR}
  1229. </select>
  1230. <select id="selectBySuperId" resultType="com.goafanti.common.model.TOrderTask">
  1231. select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main from t_order_task
  1232. where super_id = #{superId,jdbcType=VARCHAR} group by super_id
  1233. </select>
  1234. <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1235. 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,
  1236. a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
  1237. 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,
  1238. 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,
  1239. a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,ifnull(ttm.cost_amount,0) costAmount,ifnull(ttm.party_amount,0) partyAmount
  1240. 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
  1241. left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id
  1242. 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
  1243. left join t_order_mid tm on a.order_no=tm.order_no left join t_task_mid ttm on a.id=ttm.tid
  1244. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1245. <if test="shiroType == 1 and aid !=null">
  1246. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1247. </if>
  1248. <if test="shiroType == 2 and aid !=null">
  1249. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1250. </if>
  1251. <if test="name != null">
  1252. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1253. </if>
  1254. <if test="thchId != null">
  1255. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1256. </if>
  1257. <if test="cid != null">
  1258. and b.cid = #{cid,jdbcType=VARCHAR}
  1259. </if>
  1260. <if test="outsource != null">
  1261. and a.outsource = #{outsource,jdbcType=INTEGER}
  1262. </if>
  1263. <if test="depId != null">
  1264. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1265. </if>
  1266. <if test="contractNo != null">
  1267. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1268. </if>
  1269. <if test="orderNo != null">
  1270. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1271. </if>
  1272. <if test="taskId != null">
  1273. and a.id= #{taskId,jdbcType=VARCHAR}
  1274. </if>
  1275. <if test="starTime !=null and endTime !=null">
  1276. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1277. </if>
  1278. order by a.task_start_time desc,e.create_time desc
  1279. <if test="page_sql!=null">
  1280. ${page_sql}
  1281. </if>
  1282. </select>
  1283. <select id="selectTaskHoursListCount" resultType="java.lang.Integer">
  1284. 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
  1285. 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
  1286. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1287. <if test="shiroType == 1 and aid !=null">
  1288. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1289. </if>
  1290. <if test="shiroType == 2 and aid !=null">
  1291. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1292. </if>
  1293. <if test="name != null">
  1294. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1295. </if>
  1296. <if test="thchId != null">
  1297. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1298. </if>
  1299. <if test="outsource != null">
  1300. and a.outsource = #{outsource,jdbcType=INTEGER}
  1301. </if>
  1302. <if test="cid != null">
  1303. and b.cid = #{cid,jdbcType=VARCHAR}
  1304. </if>
  1305. <if test="depId != null">
  1306. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1307. </if>
  1308. <if test="contractNo != null">
  1309. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1310. </if>
  1311. <if test="orderNo != null">
  1312. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1313. </if>
  1314. <if test="taskId != null">
  1315. and a.id= #{taskId,jdbcType=VARCHAR}
  1316. </if>
  1317. <if test="starTime !=null and endTime !=null">
  1318. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1319. </if>
  1320. </select>
  1321. <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1322. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  1323. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1324. a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber,
  1325. a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId
  1326. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1327. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1328. left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1329. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1330. left join user f on e.buyer_id=f.id left join department h on e.order_dep=h.id
  1331. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1332. where e.delete_sign in(0,2,3)
  1333. <if test="orderNo != null">
  1334. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1335. </if>
  1336. <if test="name != null">
  1337. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1338. </if>
  1339. <if test="orderNo != null">
  1340. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1341. </if>
  1342. <if test="depId != null">
  1343. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1344. </if>
  1345. <if test="thchId != null">
  1346. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1347. </if>
  1348. <if test="taskId != null">
  1349. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1350. </if>
  1351. <if test="taskStatus != null">
  1352. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1353. </if>
  1354. <if test="adminName != null">
  1355. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1356. </if>
  1357. order by a.task_distribution_time desc
  1358. <if test="page_sql!=null">
  1359. ${page_sql}
  1360. </if>
  1361. </select>
  1362. <select id="selectTaskListCount" resultType="java.lang.Integer">
  1363. select count(*)
  1364. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1365. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1366. left join business_project b on a.commodity_id=b.id
  1367. left join business_category c on b.cid=c.id
  1368. left join admin d on a.task_receiver=d.id
  1369. left join t_order_new e on a.order_no=e.order_no
  1370. left join user f on e.buyer_id=f.id
  1371. left join department h on e.order_dep=h.id
  1372. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1373. where e.delete_sign in(0,2,3)
  1374. <if test="orderNo != null">
  1375. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1376. </if>
  1377. <if test="name != null">
  1378. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1379. </if>
  1380. <if test="depId != null">
  1381. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1382. </if>
  1383. <if test="thchId != null">
  1384. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1385. </if>
  1386. <if test="orderNo != null">
  1387. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1388. </if>
  1389. <if test="taskId != null">
  1390. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1391. </if>
  1392. <if test="taskStatus != null">
  1393. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1394. </if>
  1395. <if test="adminName != null">
  1396. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1397. </if>
  1398. </select>
  1399. <!-- 根据订单编号获得所有的任务负责人 -->
  1400. <select id="getReceiverByOid" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1401. select distinct task_receiver, a.name, a.email, t.id, t.project_status from t_order_task t
  1402. inner join admin a on t.task_receiver = a.id
  1403. where order_no = #{orderNo,jdbcType=VARCHAR} and task_status &gt; 0 and super_id is null
  1404. </select>
  1405. <update id="updateDimissionTransfer" parameterType="java.lang.String">
  1406. update t_order_task a left join t_change_task b on a.id =b.tid
  1407. left join (select * from admin where id= #{transferId,jdbcType=VARCHAR})c on 1=1
  1408. set a.task_allocator= #{aid,jdbcType=VARCHAR},a.task_receiver= c.id,
  1409. a.receiver_name=c.name,b.receiver_name=c.name
  1410. <if test="type==0">
  1411. ,a.consultant_id=c.id
  1412. </if>
  1413. <if test="type==1">
  1414. ,a.manager_id=c.id
  1415. </if>
  1416. <if test="type==3">
  1417. ,a.consultant_id= null
  1418. ,a.manager_id=c.id
  1419. </if>
  1420. <if test="type==4">
  1421. ,a.consultant_id=c.id
  1422. ,a.manager_id= null
  1423. </if>
  1424. <if test="type==1">
  1425. ,a.manager_id= null
  1426. </if>
  1427. where task_receiver=#{aid,jdbcType=VARCHAR}
  1428. </update>
  1429. <select id="selectEstimateCost" resultType="java.lang.String">
  1430. select ifnull(sum(a.commodity_quantity * ifnull(b.price,0)),0) from t_order_task a
  1431. left join business_project b on a.commodity_id=b.id
  1432. where order_no= #{orderNo}
  1433. </select>
  1434. <select id="listNameByDepAndName" resultType="java.lang.String">
  1435. select
  1436. <if test="type ==0">
  1437. consultant_id
  1438. </if>
  1439. <if test="type ==1">
  1440. manager_id
  1441. </if>
  1442. from t_order_task
  1443. where order_no= #{orderNo}
  1444. group by
  1445. <if test="type ==0">
  1446. consultant_id
  1447. </if>
  1448. <if test="type ==1">
  1449. manager_id
  1450. </if>
  1451. </select>
  1452. <select id="splitProjectList" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1453. 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,
  1454. e.contract_no contractNo,a.task_receiver taskReceiver, a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1455. a.commodity_quantity as commodityQuantity,e.approval,l.refund_status outsourceStatus, ifnull(i.alreadyNumber,0) as alreadyNumber,a.task_comment taskComment ,
  1456. 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,
  1457. 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,
  1458. ttm.service_life serviceLife,ttm.service_year serviceYear ,ttm.year_sum yearSum ,ttm.contract_term contractTerm,a.process_status processStatus
  1459. 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
  1460. 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
  1461. left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber
  1462. from task_progress group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name
  1463. 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
  1464. 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
  1465. where e.order_status in (0,1,2,3,4,5)
  1466. and split_status =2 and a.split_super= #{tid}
  1467. <if test="type == 1">
  1468. and a.process_status in(0,3)
  1469. </if>
  1470. order by split_id
  1471. </select>
  1472. <select id="selectByidGetCname" resultType="java.lang.String">
  1473. select b.cname from business_project a left join business_category b on a.cid =b.id
  1474. where a.id= #{pid}
  1475. </select>
  1476. <update id="updateByOutsourceToOrderNo">
  1477. update t_order_task set outsource= #{type} where order_no= #{orderNo}
  1478. </update>
  1479. <select id="getLockId" resultType="java.lang.String">
  1480. select id from user_lock_release a left join (select commodity_id from t_order_task
  1481. where order_no = #{orderNo} GROUP by commodity_id ) b on a.business_project_id =b.commodity_id
  1482. where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
  1483. </select>
  1484. <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
  1485. select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province , c.name depName,e.salesman_name salesmanName,
  1486. b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
  1487. 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 ,
  1488. a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile ,b.legal_person_tel legalPersonTel , a.certificate_number certificateNumber,
  1489. a.declaration_batch declarationBatch, date_format(a.licence_time, '%Y-%m-%d' ) licenceTime, a.commodity_quantity commodityQuantity ,
  1490. ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial, ttm.cost_amount costAmount ,
  1491. (a.commodity_price-ttm.cost_amount)profit, a.high_tech_status highTechStatus, tp.patent_name patentName ,tp.patent_no patentNo ,
  1492. date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime , date_format(tp.authorize_time, '%Y-%m-%d ' ) authorizeTime, ttm.reject_count rejectCount ,
  1493. tm.service_life serviceLife,tm.service_year serviceyear, tm.year_sum yearsum,tm.contract_term contractTerm, a.commodity_price commodityPrice ,
  1494. a.special_comment specialComment,a.task_comment taskComment,ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,
  1495. e.service_type serviceType,e.service_project serviceProject, a.form_retrieve formRetrieve ,a.satisfaction_degree satisfactionDegree
  1496. 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
  1497. 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
  1498. 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
  1499. 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
  1500. <if test="screen ==6">
  1501. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1502. </if>
  1503. <if test="screen ==7">
  1504. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1505. </if>
  1506. <if test="screen ==8">
  1507. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1508. </if>
  1509. <if test="screen ==9">
  1510. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1511. </if>
  1512. <if test="screen ==10">
  1513. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1514. </if>
  1515. <if test="screen ==11">
  1516. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1517. where apply_count &gt; 0)tj on a.id=tj.tid
  1518. </if>
  1519. where a.split_status in (0,2) and b. delete_sign in (0,2)
  1520. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1521. <if test="screen ==0">
  1522. and a.project_status in(0,1,2,3)
  1523. </if>
  1524. <if test="screen ==2">
  1525. and a.project_status &gt; 3
  1526. </if>
  1527. <if test="screen ==3">
  1528. and a.set_up_status =1
  1529. </if>
  1530. <if test="screen ==4">
  1531. and a.spot_check_status in (1,2)
  1532. </if>
  1533. <if test="screen ==5">
  1534. and a.spot_check_status =1
  1535. </if>
  1536. <if test="screen ==12">
  1537. and a.publicity_time is not null
  1538. </if>
  1539. <if test="startDate != null and endDate != null">
  1540. and a.task_distribution_time between #{startDate} and #{endDate}
  1541. </if>
  1542. <if test="province !=null">
  1543. and c.province = #{province}
  1544. </if>
  1545. <if test="projectId !=null">
  1546. and a.commodity_id = #{projectId}
  1547. </if>
  1548. <if test="sdStatus !=null">
  1549. <if test="sdStatus==0">
  1550. and a.form_retrieve=0
  1551. </if>
  1552. <if test="sdStatus==1">
  1553. and a.form_retrieve=1
  1554. </if>
  1555. <if test="sdStatus==2">
  1556. and a.form_retrieve=2
  1557. and a.satisfaction_degree=0
  1558. </if>
  1559. <if test="sdStatus==3">
  1560. and a.form_retrieve=2
  1561. and a.satisfaction_degree=1
  1562. </if>
  1563. <if test="sdStatus==4">
  1564. and a.form_retrieve=2
  1565. and a.satisfaction_degree=2
  1566. </if>
  1567. <if test="sdStatus==5">
  1568. and a.form_retrieve=2
  1569. and a.satisfaction_degree=3
  1570. </if>
  1571. </if>
  1572. <if test="deps != null">
  1573. and b.order_dep in
  1574. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  1575. #{dep}
  1576. </foreach>
  1577. </if>
  1578. <if test="thchDeps != null">
  1579. and td.id in
  1580. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  1581. #{thchDep}
  1582. </foreach>
  1583. </if>
  1584. <if test="projectStatus !=null">
  1585. and bp.cid= #{projectStatus}
  1586. </if>
  1587. <if test="taskProjectStatus !=null">
  1588. and a.project_status= #{taskProjectStatus}
  1589. </if>
  1590. <if test="projectType !=null">
  1591. and bp.type= #{projectType}
  1592. </if>
  1593. <if test="orderNo !=null">
  1594. and b.order_no = #{orderNo}
  1595. </if>
  1596. <if test="contractNo !=null">
  1597. and b.contract_no = #{contractNo}
  1598. </if>
  1599. <if test="userName !=null">
  1600. and e.buyer_name like concat('%', #{userName},'%')
  1601. </if>
  1602. <if test="thchId !=null">
  1603. and a.task_receiver = #{thchId}
  1604. </if>
  1605. <if test="declarationBatch !=null">
  1606. and a.declaration_batch = #{declarationBatch}
  1607. </if>
  1608. <if test="projectSituation !=null">
  1609. and a.status = #{projectSituation}
  1610. </if>
  1611. <if test=" projectAmount !=null and projectAmount != 9">
  1612. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1613. </if>
  1614. <if test=" projectAmount == 9">
  1615. and a.commodity_price &gt;= #{amountStart}
  1616. </if>
  1617. <if test="page_sql!=null">
  1618. ${page_sql}
  1619. </if>
  1620. </select>
  1621. <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
  1622. select count(*)
  1623. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1624. <if test="province !=null">
  1625. left join department c on b.order_dep =c.id
  1626. </if>
  1627. <if test="userName !=null">
  1628. left join t_order_mid e on b.order_no =e.order_no
  1629. </if>
  1630. <if test="projectStatus !=null or projectType !=null">
  1631. left join business_project bp on a.commodity_id =bp.id
  1632. </if>
  1633. <if test="thchDeps !=null">
  1634. left join admin ta on a.task_receiver =ta.id
  1635. left join department td on ta.department_id =td.id
  1636. </if>
  1637. <if test="status==3 or status==4">
  1638. left join task_progress tp on a.id=tp.task_id
  1639. </if>
  1640. <if test="screen ==6">
  1641. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1642. </if>
  1643. <if test="screen ==7">
  1644. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1645. </if>
  1646. <if test="screen ==8">
  1647. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1648. </if>
  1649. <if test="screen ==9">
  1650. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1651. </if>
  1652. <if test="screen ==10">
  1653. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1654. </if>
  1655. <if test="screen ==11">
  1656. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1657. where apply_count &gt; 0)tj on a.id=tj.tid
  1658. </if>
  1659. where a.split_status in (0,2) and b. delete_sign in (0,2)
  1660. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1661. <if test="screen ==0">
  1662. and a.project_status in(0,1,2,3)
  1663. </if>
  1664. <if test="screen ==2">
  1665. and a.project_status &gt; 3
  1666. </if>
  1667. <if test="screen ==3">
  1668. and a.set_up_status =1
  1669. </if>
  1670. <if test="screen ==4">
  1671. and a.spot_check_status in (1,2)
  1672. </if>
  1673. <if test="screen ==5">
  1674. and a.spot_check_status =1
  1675. </if>
  1676. <if test="screen ==12">
  1677. and a.publicity_time is not null
  1678. </if>
  1679. <if test="startDate != null and endDate != null">
  1680. and a.task_distribution_time between #{startDate} and #{endDate}
  1681. </if>
  1682. <if test="province !=null">
  1683. and c.province = #{province}
  1684. </if>
  1685. <if test="projectId !=null">
  1686. and a.commodity_id = #{projectId}
  1687. </if>
  1688. <if test="deps != null">
  1689. and b.order_dep in
  1690. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  1691. #{dep}
  1692. </foreach>
  1693. </if>
  1694. <if test="thchDeps != null">
  1695. and td.id in
  1696. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  1697. #{thchDep}
  1698. </foreach>
  1699. </if>
  1700. <if test="projectStatus !=null">
  1701. and bp.cid= #{projectStatus}
  1702. </if>
  1703. <if test="sdStatus !=null">
  1704. <if test="sdStatus==0">
  1705. and a.form_retrieve=0
  1706. </if>
  1707. <if test="sdStatus==1">
  1708. and a.form_retrieve=1
  1709. </if>
  1710. <if test="sdStatus==2">
  1711. and a.form_retrieve=2
  1712. and a.satisfaction_degree=0
  1713. </if>
  1714. <if test="sdStatus==3">
  1715. and a.form_retrieve=2
  1716. and a.satisfaction_degree=1
  1717. </if>
  1718. <if test="sdStatus==4">
  1719. and a.form_retrieve=2
  1720. and a.satisfaction_degree=2
  1721. </if>
  1722. <if test="sdStatus==5">
  1723. and a.form_retrieve=2
  1724. and a.satisfaction_degree=3
  1725. </if>
  1726. </if>
  1727. <if test="taskProjectStatus !=null">
  1728. and a.project_status= #{taskProjectStatus}
  1729. </if>
  1730. <if test="projectType !=null">
  1731. and bp.type= #{projectType}
  1732. </if>
  1733. <if test="orderNo !=null">
  1734. and b.order_no = #{orderNo}
  1735. </if>
  1736. <if test="contractNo !=null">
  1737. and b.contract_no = #{contractNo}
  1738. </if>
  1739. <if test="userName !=null">
  1740. and e.buyer_name like concat('%', #{userName},'%')
  1741. </if>
  1742. <if test="thchId !=null">
  1743. and a.task_receiver = #{thchId}
  1744. </if>
  1745. <if test="declarationBatch !=null">
  1746. and a.declaration_batch = #{declarationBatch}
  1747. </if>
  1748. <if test="projectSituation !=null">
  1749. and a.status = #{projectSituation}
  1750. </if>
  1751. <if test=" projectAmount !=null and projectAmount != 9">
  1752. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1753. </if>
  1754. <if test=" projectAmount == 9">
  1755. and a.commodity_price &gt;= #{amountStart}
  1756. </if>
  1757. </select>
  1758. <select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
  1759. select z.cid bpId, bc.cname projectStatus,z.dispatch_province province,dg.name provinceName,
  1760. z.duty_dep thchDepId,d.name thchDepName,z.distributeCount,z.stockCount,z.completeCount,z.publicityCount,
  1761. z.setUpCount,z.spotCheckCount,z.failCount,z.certificatesCount,z.acceptCount,z.endCount,z.authorizeCount,
  1762. z.rejectCount,z.applyCount,z.amountCount,z.costAmount,z.profit
  1763. from ( select y.dispatch_province, y.cid, y.duty_dep, sum(y.dispatch_count)distributeCount,
  1764. sum(y.stock_count)stockCount, sum(y.complete_count)completeCount,sum(y.promulgate_count)publicityCount,
  1765. sum(y.set_up_count)setUpCount,sum(y.spot_check_count)spotCheckCount,sum(y.fail_count)failCount,
  1766. sum(y.certificates_count)certificatesCount,sum(y.accept_count)acceptCount,sum(y.end_count)endCount,
  1767. sum(y.authorize_count)authorizeCount,sum(y.reject_count)rejectCount, sum(y.apply_count)applyCount,
  1768. sum(y.commodity_price)amountCount,sum(y.cost_amount)costAmount, sum(y.commodity_price-y.cost_amount)profit
  1769. from(select b.dispatch_province, bp.cid, b.duty_dep,
  1770. b.stock_count,b.dispatch_count,b.promulgate_count, b.complete_count,b.set_up_count ,b.spot_check_count ,
  1771. b.fail_count ,b.certificates_count, b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  1772. a.commodity_price ,b.cost_amount, a.task_distribution_time from t_order_task a
  1773. left join t_task_mid b on a.id=b.tid left join business_project bp on a.commodity_id =bp.id
  1774. left join t_order_new ton on a.order_no =ton .order_no
  1775. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  1776. <if test="projectId !=null">
  1777. and a.commodity_id = #{projectId}
  1778. </if>
  1779. <if test="province !=null">
  1780. and b.dispatch_province = #{province}
  1781. </if>
  1782. <if test="thchDeps !=null">
  1783. and b.duty_dep in
  1784. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  1785. #{depId}
  1786. </foreach>
  1787. </if>
  1788. <if test="projectType !=null">
  1789. and bp.`type` = #{projectType}
  1790. </if>
  1791. <if test="projectStatus !=null">
  1792. and bp.cid= #{projectStatus}
  1793. </if>
  1794. <if test="startDate != null and endDate != null">
  1795. and a.task_distribution_time between #{startDate} and #{endDate}
  1796. </if>
  1797. )y
  1798. group by y.dispatch_province, y.cid, y.duty_dep )z
  1799. left join business_category bc on z.cid=bc.id left join district_glossory dg on z.dispatch_province=dg.id
  1800. left join department d on z.duty_dep=d.id
  1801. <if test="page_sql!=null">
  1802. ${page_sql}
  1803. </if>
  1804. </select>
  1805. <select id="selectProvincialStatisticsCount" resultType="java.lang.Integer">
  1806. select count(*)
  1807. from(select y.dispatch_province from (select bp.cid,
  1808. b.dispatch_province,b.duty_dep,a.cname,b.stock_count,b.dispatch_count,b.promulgate_count,
  1809. b.complete_count,b.set_up_count ,b.spot_check_count ,b.fail_count ,b.certificates_count,
  1810. b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  1811. a.commodity_price ,b.cost_amount, a.task_distribution_time
  1812. from t_order_task a
  1813. left join t_task_mid b on a.id=b.tid
  1814. left join business_project bp on a.commodity_id =bp.id
  1815. left join t_order_new ton on a.order_no =ton .order_no
  1816. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  1817. <if test="projectId !=null">
  1818. and a.commodity_id = #{projectId}
  1819. </if>
  1820. <if test="province !=null">
  1821. and b.dispatch_province = #{province}
  1822. </if>
  1823. <if test="thchDeps !=null">
  1824. and b.duty_dep in
  1825. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  1826. #{depId}
  1827. </foreach>
  1828. </if>
  1829. <if test="projectType !=null">
  1830. and bp.`type` = #{projectType}
  1831. </if>
  1832. <if test="projectStatus !=null">
  1833. and bp.cid= #{projectStatus}
  1834. </if>
  1835. <if test="startDate != null and endDate != null">
  1836. and a.task_distribution_time between #{startDate} and #{endDate}
  1837. </if>
  1838. )y group by y.dispatch_province, y.cid, y.duty_dep )x
  1839. </select>
  1840. <select id="managerSelectByPage" resultType="com.goafanti.order.bo.managerListBo">
  1841. select a.id,a.task_distribution_time taskDistributionTime ,tm.province_name provinceName,tm.dep_name depName,
  1842. tm.salesman_name salesmanName, b.contract_no contractNo ,b.order_no orderNo,tm.buyer_name UserName,a.cname ,
  1843. a.commodity_name commodityName,a.commodity_quantity commodityQuantity,dep.name techDepName,a.receiver_name techName,
  1844. a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment
  1845. from (select task_id from t_task_log a where task_receiver=#{aid}
  1846. UNION select task_id from t_task_log a where task_allocator=#{aid}) x
  1847. 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
  1848. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1849. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1850. where 1=1
  1851. <if test="orderNo !=null">
  1852. and a.order_no = #{orderNo}
  1853. </if>
  1854. <if test="contractNo !=null">
  1855. and b.contract_no = #{contractNo}
  1856. </if>
  1857. <if test="name !=null">
  1858. and tm.buyer_name like CONCAT('%',#{name},'%')
  1859. </if>
  1860. <if test="thchId !=null">
  1861. and a.task_receiver = #{thchId}
  1862. </if>
  1863. <if test="cid !=null">
  1864. and bp.cid =#{cid}
  1865. </if>
  1866. <if test="projectType !=null">
  1867. and bp.`type` =#{projectType}
  1868. </if>
  1869. <if test="depId !=null">
  1870. and b.order_dep =#{depId}
  1871. </if>
  1872. <if test="techDepId !=null">
  1873. and ad.department_id =#{techDepId}
  1874. </if>
  1875. <if test="declarationBatch !=null">
  1876. and a.declaration_batch =#{declarationBatch}
  1877. </if>
  1878. <if test="commodityPrice !=null">
  1879. and a.commodity_price =#{commodityPrice}
  1880. </if>
  1881. <if test="startTime !=null and endTime !=null">
  1882. and a.task_distribution_time between #{startTime} and #{endTime}
  1883. </if>
  1884. <if test="page_sql!=null">
  1885. ${page_sql}
  1886. </if>
  1887. </select>
  1888. <select id="managerSelectCount" resultType="java.lang.Integer">
  1889. select count(*)
  1890. from (select task_id from t_task_log a where task_receiver= #{aid} UNION
  1891. select task_id from t_task_log a where task_allocator= #{aid}) x
  1892. 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
  1893. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1894. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1895. where 1=1
  1896. <if test="orderNo !=null">
  1897. and a.order_no = #{orderNo}
  1898. </if>
  1899. <if test="contractNo !=null">
  1900. and b.contract_no = #{contractNo}
  1901. </if>
  1902. <if test="name !=null">
  1903. and tm.buyer_name like CONCAT('%',#{name},'%')
  1904. </if>
  1905. <if test="thchId !=null">
  1906. and a.task_receiver = #{thchId}
  1907. </if>
  1908. <if test="cid !=null">
  1909. and bp.cid =#{cid}
  1910. </if>
  1911. <if test="projectType !=null">
  1912. and bp.`type` =#{projectType}
  1913. </if>
  1914. <if test="depId !=null">
  1915. and b.order_dep =#{depId}
  1916. </if>
  1917. <if test="techDepId !=null">
  1918. and ad.department_id =#{techDepId}
  1919. </if>
  1920. <if test="declarationBatch !=null">
  1921. and a.declaration_batch =#{declarationBatch}
  1922. </if>
  1923. <if test="commodityPrice !=null">
  1924. and a.commodity_price =#{commodityPrice}
  1925. </if>
  1926. <if test="startTime !=null and endTime !=null">
  1927. and a.task_distribution_time between #{startTime} and #{endTime}
  1928. </if>
  1929. </select>
  1930. <resultMap id="userOrder" type="com.goafanti.common.bo.UserOrderTask">
  1931. <id column="orderNo" jdbcType="VARCHAR" property="orderNo" />
  1932. <collection ofType="com.goafanti.common.bo.UserTask" property="list">
  1933. <id column="id" jdbcType="VARCHAR" property="id" />
  1934. <result column="commodityName" jdbcType="VARCHAR" property="commodityName" />
  1935. </collection>
  1936. </resultMap>
  1937. <select id="selectUidByproject" resultMap="userOrder">
  1938. select a.order_no orderNo ,b.id,b.commodity_name commodityName from t_order_new a
  1939. left join t_order_task b on a.order_no =b.order_no
  1940. where a.buyer_id = #{uid}
  1941. </select>
  1942. <select id="selectProjectCheck" resultType="com.goafanti.order.bo.OutProjectCheck">
  1943. select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity commodityQuantity,
  1944. c.buyer_name userName ,e.cname ,a.task_distribution_time taskDistributionTime,f.name depName ,a.check_status checkStatus ,
  1945. a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment ,a.official_cost officialCost,a.cost_reduction costReduction,
  1946. a.patent_type patentType
  1947. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1948. left join t_order_mid c on a.order_no =c.order_no
  1949. left join business_project d on a.commodity_id =d.id
  1950. left join business_category e on d.cid =e.id
  1951. left join department f on b.order_dep =f.id
  1952. where check_status =1
  1953. <if test="aid !=null">
  1954. and b.salesman_id = #{aid}
  1955. </if>
  1956. <if test="name !=null">
  1957. and c.buyer_name like concat('%',#{name},'%')
  1958. </if>
  1959. <if test="orderNo !=null">
  1960. and a.order_no = #{orderNo}
  1961. </if>
  1962. <if test="contractNo !=null">
  1963. and b.contract_no = #{contractNo}
  1964. </if>
  1965. <if test="pname !=null">
  1966. and a.commodity_name like concat('%',#{pname},'%')
  1967. </if>
  1968. <if test="deps !=null">
  1969. and b.order_dep in
  1970. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  1971. #{depId}
  1972. </foreach>
  1973. </if>
  1974. <if test="page_sql!=null">
  1975. ${page_sql}
  1976. </if>
  1977. </select>
  1978. <select id="countProjectCheck" resultType="java.lang.Integer">
  1979. select count(*)
  1980. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1981. left join t_order_mid c on a.order_no =c.order_no
  1982. left join business_project d on a.commodity_id =d.id
  1983. left join business_category e on d.cid =e.id
  1984. left join department f on b.order_dep =f.id
  1985. where check_status =1
  1986. <if test="aid !=null">
  1987. and b.salesman_id = #{aid}
  1988. </if>
  1989. <if test="name !=null">
  1990. and c.buyer_name like concat('%',#{name},'%')
  1991. </if>
  1992. <if test="orderNo !=null">
  1993. and a.order_no = #{orderNo}
  1994. </if>
  1995. <if test="contractNo !=null">
  1996. and b.contract_no = #{contractNo}
  1997. </if>
  1998. <if test="pname !=null">
  1999. and a.commodity_name like concat('%',#{pname},'%')
  2000. </if>
  2001. <if test="deps !=null">
  2002. and b.order_dep in
  2003. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  2004. #{depId}
  2005. </foreach>
  2006. </if>
  2007. </select>
  2008. <update id="resstPayment">
  2009. update t_order_task a ,t_task_mid c
  2010. set c.party_amount =0,c.cost_amount =0
  2011. where a.id= #{id} and a.id=c.tid
  2012. </update>
  2013. <update id="updateAddCostAmount">
  2014. update t_task_mid
  2015. set cost_amount =cost_amount + #{cost}
  2016. where tid= #{tid}
  2017. </update>
  2018. <select id="selectAidByParam" resultType="com.goafanti.common.bo.OrderOperator">
  2019. select a.id tid,b.order_no orderNo ,b.salesman_id salesmanId,b.finance_id financeId ,a.task_receiver techId,
  2020. b.salesman_name salesmanName ,b.finance_name financeName ,d.name techName,b.buyer_name buyerName,a.commodity_name projectName
  2021. from t_order_task a left join t_order_mid b on a.order_no=b.order_no
  2022. left join admin d on a.task_receiver=d.id
  2023. where 1=1
  2024. <if test="tid !=null">
  2025. and a.id= #{tid}
  2026. </if>
  2027. </select>
  2028. <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  2029. select a.id,a.order_no orderNo,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,
  2030. b.patent_name_type projectType, c.amount officialAmount,c.proportion85,b.patent_type outPatentType,d.type
  2031. 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`
  2032. left join business_project d on a.commodity_id=d.id
  2033. where a.id= #{tid}
  2034. </select>
  2035. <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
  2036. select t1. province,dg.name provinceName ,t1.quantity,t1.pass,t1.notPass,ifnull(t1.signBacks,0) signBacks
  2037. 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,
  2038. sum(ttm.high_new_retrial)signBacks
  2039. 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
  2040. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2041. 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)
  2042. <if test="depId!=null">
  2043. and e.id= #{depId}
  2044. </if>
  2045. <if test="startDate!=null and endDate!=null">
  2046. and c.sign_time between #{startDate} and #{endDate}
  2047. </if>
  2048. group by e.province )t1 left join district_glossory dg on t1.province=dg.id
  2049. </select>
  2050. <select id="getHighNewRetrial" resultType="java.lang.Integer">
  2051. select count(*) from t_order_new a left join t_order_new b on a.buyer_id =b.buyer_id
  2052. left join t_order_task c on b.order_no =c.order_no left join business_project d on c.commodity_id =d.id
  2053. where a.order_no =#{orderNo} and b.create_time &lt; a.create_time and d.`type` =5
  2054. </select>
  2055. <select id="highNewRetrialList" resultType="com.goafanti.order.bo.OutHighNewRetrialList">
  2056. select t1.province,dg.name provinceName,t1.salesman_id aid,t1.name name,t1.quantity,t1.pass,t1.notPass,t1.signBacks
  2057. from (SELECT e.province,c.salesman_id,d.name ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,
  2058. sum(if(a.project_status != 10,1,0))notPass, sum(ttm.high_new_retrial)signBacks
  2059. 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
  2060. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2061. 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)
  2062. <if test="province!=null">
  2063. and e.province= #{province}
  2064. </if>
  2065. <if test="depId!=null">
  2066. and e.id= #{depId}
  2067. </if>
  2068. <if test="startDate!=null and endDate!=null">
  2069. and c.sign_time between #{startDate} and #{endDate}
  2070. </if>
  2071. <if test="aid !=null">
  2072. and c.salesman_id = #{aid}
  2073. </if>
  2074. <if test="depId !=null">
  2075. and d.department_id = #{depId}
  2076. </if>
  2077. group by e.province ,c.salesman_id ,d.name )t1 left join district_glossory dg on t1.province=dg.id
  2078. order by
  2079. <if test="sort==0">
  2080. t1.pass
  2081. </if>
  2082. <if test="sort==1">
  2083. t1.notPass
  2084. </if>
  2085. desc
  2086. </select>
  2087. <select id="findMemberList" resultType="com.goafanti.order.bo.OutMemberList">
  2088. select a.id,b.contract_no contractNo,c.buyer_name userName,a.order_no orderNo,b.approval ,c.dep_name depName,
  2089. c.salesman_name salesmanName,c.finance_name financeName,a.commodity_name projectName,a.member_type memberType,
  2090. b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,
  2091. a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,
  2092. a.commodity_quantity commodityQuantity,a.task_comment taskComment,a.picture_url pictureUrl,
  2093. e.service_life serviceLife ,e.service_year serviceYear,e.year_sum yearSum
  2094. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2095. left join t_order_mid c on a.order_no =c.order_no
  2096. left join t_task_member e on a.id=e.tid
  2097. <if test="shiroType ==2">
  2098. left join department d on b.order_dep =d.id
  2099. </if>
  2100. where b.delete_sign in (0,2)
  2101. and a.process_status in (1,2,3,4)
  2102. <if test="shiroType ==1">
  2103. and b.salesman_id = #{aid}
  2104. </if>
  2105. <if test="shiroType ==2">
  2106. and d.finance_id = #{aid}
  2107. </if>
  2108. <if test="orderNo != null">
  2109. and a.order_no = #{orderNo}
  2110. </if>
  2111. <if test="userName != null">
  2112. and c.buyer_name like concat('%',#{userName},'%')
  2113. </if>
  2114. <if test="deps != null">
  2115. and b.order_dep in
  2116. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2117. #{dep}
  2118. </foreach>
  2119. </if>
  2120. <if test="contractNo != null">
  2121. and b.contract_no =#{contractNo}
  2122. </if>
  2123. <if test="salesmanId != null">
  2124. and b.salesman_id =#{salesmanId}
  2125. </if>
  2126. <if test="projectName != null">
  2127. and a.commodity_name like concat('%',#{projectName},'%')
  2128. </if>
  2129. <if test="amountStatus == 0">
  2130. and b.total_amount &lt; 10
  2131. </if>
  2132. <if test="amountStatus == 1">
  2133. and b.total_amount between 10 and 20
  2134. </if>
  2135. <if test="amountStatus == 2">
  2136. and b.total_amount between 20 and 30
  2137. </if>
  2138. <if test="amountStatus == 3">
  2139. and b.total_amount between 30 and 40
  2140. </if>
  2141. <if test="amountStatus == 4">
  2142. and b.total_amount &gt; 40
  2143. </if>
  2144. <if test="approval != null and approval &lt; 3">
  2145. and b.approval = #{approval}
  2146. </if>
  2147. <if test="approval != null and approval ==4">
  2148. and b.approval in (1,2)
  2149. </if>
  2150. <if test="status != null and status !=5">
  2151. and a.process_status = #{status}
  2152. </if>
  2153. order by a.process_status
  2154. <if test="page_sql!=null">
  2155. ${page_sql}
  2156. </if>
  2157. </select>
  2158. <select id="findMemberCount" resultType="java.lang.Integer">
  2159. select count(*)
  2160. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2161. left join t_order_mid c on a.order_no =c.order_no
  2162. <if test="shiroType ==2">
  2163. left join department d on b.order_dep =d.id
  2164. </if>
  2165. where b.delete_sign in (0,2)
  2166. and a.process_status in (1,2,3,4)
  2167. <if test="shiroType ==1">
  2168. and b.salesman_id = #{aid}
  2169. </if>
  2170. <if test="shiroType ==2">
  2171. and d.finance_id = #{aid}
  2172. </if>
  2173. <if test="orderNo != null">
  2174. and a.order_no = #{orderNo}
  2175. </if>
  2176. <if test="userName != null">
  2177. and c.buyer_name like concat('%',#{userName},'%')
  2178. </if>
  2179. <if test="deps != null">
  2180. and b.order_dep in
  2181. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2182. #{dep}
  2183. </foreach>
  2184. </if>
  2185. <if test="contractNo != null">
  2186. and b.contract_no =#{contractNo}
  2187. </if>
  2188. <if test="salesmanId != null">
  2189. and b.salesman_id =#{salesmanId}
  2190. </if>
  2191. <if test="projectName != null">
  2192. and a.commodity_name like concat('%',#{projectName},'%')
  2193. </if>
  2194. <if test="amountStatus == 1">
  2195. and b.total_amount between 10 and 20
  2196. </if>
  2197. <if test="amountStatus == 2">
  2198. and b.total_amount between 20 and 30
  2199. </if>
  2200. <if test="amountStatus == 3">
  2201. and b.total_amount between 30 and 40
  2202. </if>
  2203. <if test="amountStatus == 4">
  2204. and b.total_amount &gt; 40
  2205. </if>
  2206. <if test="approval != null and approval &lt; 3">
  2207. and b.approval = #{approval}
  2208. </if>
  2209. <if test="approval != null and approval ==4">
  2210. and b.approval in (1,2)
  2211. </if>
  2212. <if test="status != null and status !=5">
  2213. and a.process_status = #{status}
  2214. </if>
  2215. </select>
  2216. <select id="selectByAid" resultType="com.goafanti.common.model.TChangeTask">
  2217. select b.id,b.cid from t_order_task a
  2218. left join t_change_task b on a.id=b.tid
  2219. left join new_order_change noc on b.cid =noc.id
  2220. where b.id is not null and noc.process_state &lt; 4 and noc.status in (0,1,2)
  2221. and a.task_receiver = #{aid}
  2222. </select>
  2223. <select id="getSplitCount" resultType="java.lang.Integer">
  2224. select count(*) from t_order_task
  2225. where split_super = #{tid}
  2226. </select>
  2227. <select id="selectProjectSotpList" resultType="com.goafanti.order.bo.OutselectProjectSotp">
  2228. 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,
  2229. c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,a.annex_url annexUrl,
  2230. tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason,a.id,b.id tid,
  2231. ttm.stop_status projectStopStatus, ttm.stop_type projectStopType
  2232. from task_stop a left join t_order_task b on a.tid=b.id
  2233. left join t_order_new c on b.order_no =c.order_no
  2234. left join t_task_mid ttm on b.id=ttm.tid
  2235. left join t_order_mid tom on c.order_no =tom.order_no
  2236. left join department d on c.order_dep =d.id
  2237. left join district_glossory dg on d.province =dg.id
  2238. where 1=1
  2239. <if test="shiro ==1">
  2240. and c.salesman_id =#{aid}
  2241. </if>
  2242. <if test="shiro ==2">
  2243. and c.order_dep in
  2244. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2245. #{dep}
  2246. </foreach>
  2247. </if>
  2248. <if test="orderNo !=null">
  2249. and b.order_no = #{orderNo}
  2250. </if>
  2251. <if test="userName !=null">
  2252. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2253. </if>
  2254. <if test="depId !=null">
  2255. and c.order_dep = #{depId}
  2256. </if>
  2257. <if test="contractNo !=null">
  2258. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2259. </if>
  2260. <if test="projectName !=null">
  2261. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2262. </if>
  2263. <if test="status !=null">
  2264. <if test="status==0">
  2265. and a.`type` =0 and a.status =0
  2266. </if>
  2267. <if test="status==1">
  2268. and a.`type` =1 and a.status =0
  2269. </if>
  2270. <if test="status==2">
  2271. and a.`type` =0 and a.status =1
  2272. </if>
  2273. <if test="status==3">
  2274. and a.`type` =1 and a.status =1
  2275. </if>
  2276. <if test="status==4">
  2277. and a.`type` =0 and a.status =2
  2278. </if>
  2279. <if test="status==5">
  2280. and a.`type` =1 and a.status =2
  2281. </if>
  2282. </if>
  2283. <if test="receiverId !=null">
  2284. and b.task_receiver = #{receiverId}
  2285. </if>
  2286. <if test="startTime !=null and endTime !=null">
  2287. and a.create_time BETWEEN #{startTime} and #{endTime}
  2288. </if>
  2289. order by a.create_time desc
  2290. <if test="page_sql!=null">
  2291. ${page_sql}
  2292. </if>
  2293. </select>
  2294. <select id="selectProjectSotpCount" resultType="java.lang.Integer">
  2295. select count(*)
  2296. from task_stop a left join t_order_task b on a.tid=b.id
  2297. left join t_order_new c on b.order_no =c.order_no
  2298. left join t_order_mid tom on c.order_no =tom.order_no
  2299. where 1=1
  2300. <if test="shiro ==1">
  2301. and c.salesman_id =#{aid}
  2302. </if>
  2303. <if test="shiro ==2">
  2304. and c.order_dep in
  2305. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2306. #{dep}
  2307. </foreach>
  2308. </if>
  2309. <if test="orderNo !=null">
  2310. and b.order_no = #{orderNo}
  2311. </if>
  2312. <if test="userName !=null">
  2313. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2314. </if>
  2315. <if test="depId !=null">
  2316. and c.order_dep = #{depId}
  2317. </if>
  2318. <if test="contractNo !=null">
  2319. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2320. </if>
  2321. <if test="projectName !=null">
  2322. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2323. </if>
  2324. <if test="status !=null">
  2325. <if test="status==0">
  2326. and a.`type` =0 and a.status =0
  2327. </if>
  2328. <if test="status==1">
  2329. and a.`type` =1 and a.status =0
  2330. </if>
  2331. <if test="status==2">
  2332. and a.`type` =0 and a.status =1
  2333. </if>
  2334. <if test="status==3">
  2335. and a.`type` =1 and a.status =1
  2336. </if>
  2337. <if test="status==4">
  2338. and a.status=2
  2339. </if>
  2340. </if>
  2341. <if test="receiverId !=null">
  2342. and b.task_receiver = #{receiverId}
  2343. </if>
  2344. <if test="startTime !=null and endTime !=null">
  2345. and a.create_time BETWEEN #{startTime} and #{endTime}
  2346. </if>
  2347. </select>
  2348. <delete id="deleteBySplitId" parameterType="java.lang.Integer">
  2349. delete from t_order_task
  2350. where split_super = #{id,jdbcType=INTEGER}
  2351. </delete>
  2352. <update id="updateDimissionTransferManager">
  2353. update t_order_task
  2354. set manager_id= #{transferId}
  2355. where manager_id = #{aid}
  2356. </update>
  2357. </mapper>