TOrderTaskMapper.xml 88 KB

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