DemandMapper.xml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424
  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.DemandMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Demand" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
  7. <result column="data_category" property="dataCategory" jdbcType="INTEGER" />
  8. <result column="name" property="name" jdbcType="VARCHAR" />
  9. <result column="keyword" property="keyword" jdbcType="VARCHAR" />
  10. <result column="info_sources" property="infoSources" jdbcType="INTEGER" />
  11. <result column="industry_category_a" property="industryCategoryA" jdbcType="INTEGER" />
  12. <result column="industry_category_b" property="industryCategoryB" jdbcType="INTEGER" />
  13. <result column="industry_category_c" property="industryCategoryC" jdbcType="INTEGER" />
  14. <result column="demand_type" property="demandType" jdbcType="INTEGER" />
  15. <result column="problem_des" property="problemDes" jdbcType="LONGVARCHAR" />
  16. <result column="technical_requirements" property="technicalRequirements" jdbcType="VARCHAR" />
  17. <result column="picture_url" property="pictureUrl" jdbcType="LONGVARCHAR" />
  18. <result column="text_file_url" property="textFileUrl" jdbcType="VARCHAR" />
  19. <result column="video_url" property="videoUrl" jdbcType="VARCHAR" />
  20. <result column="fixed_budget" property="fixedBudget" jdbcType="DECIMAL" />
  21. <result column="fixed_cycle" property="fixedCycle" jdbcType="VARCHAR" />
  22. <result column="people_number" property="peopleNumber" jdbcType="INTEGER" />
  23. <result column="fixed_scheme" property="fixedScheme" jdbcType="VARCHAR" />
  24. <result column="cost_escrow" property="costEscrow" jdbcType="DECIMAL" />
  25. <result column="budget_cost" property="budgetCost" jdbcType="DECIMAL" />
  26. <result column="validity_period" property="validityPeriod" jdbcType="TIMESTAMP" />
  27. <result column="employer_id" property="employerId" jdbcType="VARCHAR" />
  28. <result column="employer_name" property="employerName" jdbcType="VARCHAR" />
  29. <result column="employer_address" property="employerAddress" jdbcType="VARCHAR" />
  30. <result column="employer_contacts" property="employerContacts" jdbcType="VARCHAR" />
  31. <result column="employer_contacts_mobile" property="employerContactsMobile" jdbcType="VARCHAR" />
  32. <result column="employer_contacts_mailbox" property="employerContactsMailbox" jdbcType="VARCHAR" />
  33. <result column="contacts" property="contacts" jdbcType="INTEGER" />
  34. <result column="status" property="status" jdbcType="INTEGER" />
  35. <result column="release_status" property="releaseStatus" jdbcType="INTEGER" />
  36. <result column="release_date" property="releaseDate" jdbcType="TIMESTAMP" />
  37. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  38. <result column="principal_id" property="principalId" jdbcType="VARCHAR" />
  39. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  40. <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
  41. <result column="tech_broker_id" property="techBrokerId" jdbcType="VARCHAR" />
  42. <result column="boutique" property="boutique" jdbcType="INTEGER" />
  43. <result column="uid" property="uid" jdbcType="VARCHAR" />
  44. </resultMap>
  45. <sql id="Base_Column_List" >
  46. id, serial_number, data_category, name, keyword, info_sources, industry_category_a,
  47. industry_category_b, industry_category_c, demand_type, problem_des, technical_requirements,
  48. picture_url, text_file_url, video_url, fixed_budget, fixed_cycle, people_number,
  49. fixed_scheme, cost_escrow, budget_cost, validity_period, employer_id, employer_name,
  50. employer_address, employer_contacts, employer_contacts_mobile, employer_contacts_mailbox,
  51. contacts, status, release_status, release_date, create_time, principal_id, deleted_sign,
  52. audit_status, tech_broker_id,boutique
  53. </sql>
  54. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  55. select
  56. <include refid="Base_Column_List" />
  57. from demand
  58. where id = #{id,jdbcType=VARCHAR}
  59. </select>
  60. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  61. delete from demand
  62. where id = #{id,jdbcType=VARCHAR}
  63. </delete>
  64. <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
  65. insert into demand (id, serial_number, data_category,
  66. name, keyword, info_sources,
  67. industry_category_a, industry_category_b, industry_category_c,
  68. demand_type, problem_des, technical_requirements,
  69. picture_url, text_file_url, video_url,
  70. fixed_budget, fixed_cycle, people_number,
  71. fixed_scheme, cost_escrow, budget_cost,
  72. validity_period, employer_id, employer_name,
  73. employer_address, employer_contacts, employer_contacts_mobile,
  74. employer_contacts_mailbox, contacts, status,
  75. release_status, release_date, create_time,
  76. principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark)
  77. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  78. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER},
  79. #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER},
  80. #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR},
  81. #{pictureUrl,jdbcType=LONGVARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR},
  82. #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER},
  83. #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL},
  84. #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR},
  85. #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR},
  86. #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  87. #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  88. #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
  89. #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
  90. </insert>
  91. <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
  92. insert into demand
  93. <trim prefix="(" suffix=")" suffixOverrides="," >
  94. <if test="id != null" >
  95. id,
  96. </if>
  97. <if test="serialNumber != null" >
  98. serial_number,
  99. </if>
  100. <if test="dataCategory != null" >
  101. data_category,
  102. </if>
  103. <if test="name != null" >
  104. name,
  105. </if>
  106. <if test="keyword != null" >
  107. keyword,
  108. </if>
  109. <if test="infoSources != null" >
  110. info_sources,
  111. </if>
  112. <if test="industryCategoryA != null" >
  113. industry_category_a,
  114. </if>
  115. <if test="industryCategoryB != null" >
  116. industry_category_b,
  117. </if>
  118. <if test="industryCategoryC != null" >
  119. industry_category_c,
  120. </if>
  121. <if test="demandType != null" >
  122. demand_type,
  123. </if>
  124. <if test="problemDes != null" >
  125. problem_des,
  126. </if>
  127. <if test="technicalRequirements != null" >
  128. technical_requirements,
  129. </if>
  130. <if test="pictureUrl != null" >
  131. picture_url,
  132. </if>
  133. <if test="textFileUrl != null" >
  134. text_file_url,
  135. </if>
  136. <if test="videoUrl != null" >
  137. video_url,
  138. </if>
  139. <if test="fixedBudget != null" >
  140. fixed_budget,
  141. </if>
  142. <if test="fixedCycle != null" >
  143. fixed_cycle,
  144. </if>
  145. <if test="peopleNumber != null" >
  146. people_number,
  147. </if>
  148. <if test="fixedScheme != null" >
  149. fixed_scheme,
  150. </if>
  151. <if test="costEscrow != null" >
  152. cost_escrow,
  153. </if>
  154. <if test="budgetCost != null" >
  155. budget_cost,
  156. </if>
  157. <if test="validityPeriod != null" >
  158. validity_period,
  159. </if>
  160. <if test="employerId != null" >
  161. employer_id,
  162. </if>
  163. <if test="employerName != null" >
  164. employer_name,
  165. </if>
  166. <if test="employerAddress != null" >
  167. employer_address,
  168. </if>
  169. <if test="employerContacts != null" >
  170. employer_contacts,
  171. </if>
  172. <if test="employerContactsMobile != null" >
  173. employer_contacts_mobile,
  174. </if>
  175. <if test="employerContactsMailbox != null" >
  176. employer_contacts_mailbox,
  177. </if>
  178. <if test="contacts != null" >
  179. contacts,
  180. </if>
  181. <if test="status != null" >
  182. status,
  183. </if>
  184. <if test="releaseStatus != null" >
  185. release_status,
  186. </if>
  187. <if test="releaseDate != null" >
  188. release_date,
  189. </if>
  190. <if test="createTime != null" >
  191. create_time,
  192. </if>
  193. <if test="principalId != null" >
  194. principal_id,
  195. </if>
  196. <if test="deletedSign != null" >
  197. deleted_sign,
  198. </if>
  199. <if test="auditStatus != null" >
  200. audit_status,
  201. </if>
  202. <if test="techBrokerId != null" >
  203. tech_broker_id,
  204. </if>
  205. <if test="boutique != null" >
  206. boutique,
  207. </if>
  208. <if test="remark != null" >
  209. remark,
  210. </if>
  211. </trim>
  212. <trim prefix="values (" suffix=")" suffixOverrides="," >
  213. <if test="id != null" >
  214. #{id,jdbcType=VARCHAR},
  215. </if>
  216. <if test="serialNumber != null" >
  217. #{serialNumber,jdbcType=INTEGER},
  218. </if>
  219. <if test="dataCategory != null" >
  220. #{dataCategory,jdbcType=INTEGER},
  221. </if>
  222. <if test="name != null" >
  223. #{name,jdbcType=VARCHAR},
  224. </if>
  225. <if test="keyword != null" >
  226. #{keyword,jdbcType=VARCHAR},
  227. </if>
  228. <if test="infoSources != null" >
  229. #{infoSources,jdbcType=INTEGER},
  230. </if>
  231. <if test="industryCategoryA != null" >
  232. #{industryCategoryA,jdbcType=INTEGER},
  233. </if>
  234. <if test="industryCategoryB != null" >
  235. #{industryCategoryB,jdbcType=INTEGER},
  236. </if>
  237. <if test="industryCategoryC != null" >
  238. #{industryCategoryC,jdbcType=INTEGER},
  239. </if>
  240. <if test="demandType != null" >
  241. #{demandType,jdbcType=INTEGER},
  242. </if>
  243. <if test="problemDes != null" >
  244. #{problemDes,jdbcType=VARCHAR},
  245. </if>
  246. <if test="technicalRequirements != null" >
  247. #{technicalRequirements,jdbcType=VARCHAR},
  248. </if>
  249. <if test="pictureUrl != null" >
  250. #{pictureUrl,jdbcType=LONGVARCHAR},
  251. </if>
  252. <if test="textFileUrl != null" >
  253. #{textFileUrl,jdbcType=VARCHAR},
  254. </if>
  255. <if test="videoUrl != null" >
  256. #{videoUrl,jdbcType=VARCHAR},
  257. </if>
  258. <if test="fixedBudget != null" >
  259. #{fixedBudget,jdbcType=DECIMAL},
  260. </if>
  261. <if test="fixedCycle != null" >
  262. #{fixedCycle,jdbcType=VARCHAR},
  263. </if>
  264. <if test="peopleNumber != null" >
  265. #{peopleNumber,jdbcType=INTEGER},
  266. </if>
  267. <if test="fixedScheme != null" >
  268. #{fixedScheme,jdbcType=VARCHAR},
  269. </if>
  270. <if test="costEscrow != null" >
  271. #{costEscrow,jdbcType=DECIMAL},
  272. </if>
  273. <if test="budgetCost != null" >
  274. #{budgetCost,jdbcType=DECIMAL},
  275. </if>
  276. <if test="validityPeriod != null" >
  277. #{validityPeriod,jdbcType=TIMESTAMP},
  278. </if>
  279. <if test="employerId != null" >
  280. #{employerId,jdbcType=VARCHAR},
  281. </if>
  282. <if test="employerName != null" >
  283. #{employerName,jdbcType=VARCHAR},
  284. </if>
  285. <if test="employerAddress != null" >
  286. #{employerAddress,jdbcType=VARCHAR},
  287. </if>
  288. <if test="employerContacts != null" >
  289. #{employerContacts,jdbcType=VARCHAR},
  290. </if>
  291. <if test="employerContactsMobile != null" >
  292. #{employerContactsMobile,jdbcType=VARCHAR},
  293. </if>
  294. <if test="employerContactsMailbox != null" >
  295. #{employerContactsMailbox,jdbcType=VARCHAR},
  296. </if>
  297. <if test="contacts != null" >
  298. #{contacts,jdbcType=INTEGER},
  299. </if>
  300. <if test="status != null" >
  301. #{status,jdbcType=INTEGER},
  302. </if>
  303. <if test="releaseStatus != null" >
  304. #{releaseStatus,jdbcType=INTEGER},
  305. </if>
  306. <if test="releaseDate != null" >
  307. #{releaseDate,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="createTime != null" >
  310. #{createTime,jdbcType=TIMESTAMP},
  311. </if>
  312. <if test="principalId != null" >
  313. #{principalId,jdbcType=VARCHAR},
  314. </if>
  315. <if test="deletedSign != null" >
  316. #{deletedSign,jdbcType=INTEGER},
  317. </if>
  318. <if test="auditStatus != null" >
  319. #{auditStatus,jdbcType=INTEGER},
  320. </if>
  321. <if test="techBrokerId != null" >
  322. #{techBrokerId,jdbcType=VARCHAR},
  323. </if>
  324. <if test="boutique != null" >
  325. #{boutique,jdbcType=INTEGER},
  326. </if>
  327. <if test="remark != null" >
  328. #{remark,jdbcType=VARCHAR},
  329. </if>
  330. </trim>
  331. </insert>
  332. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
  333. update demand
  334. <set >
  335. <if test="serialNumber != null" >
  336. serial_number = #{serialNumber,jdbcType=INTEGER},
  337. </if>
  338. <if test="dataCategory != null" >
  339. data_category = #{dataCategory,jdbcType=INTEGER},
  340. </if>
  341. <if test="name != null" >
  342. name = #{name,jdbcType=VARCHAR},
  343. </if>
  344. <if test="keyword != null" >
  345. keyword = #{keyword,jdbcType=VARCHAR},
  346. </if>
  347. <if test="infoSources != null" >
  348. info_sources = #{infoSources,jdbcType=INTEGER},
  349. </if>
  350. <if test="industryCategoryA != null" >
  351. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  352. </if>
  353. <if test="industryCategoryB != null" >
  354. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  355. </if>
  356. <if test="industryCategoryC != null" >
  357. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  358. </if>
  359. <if test="demandType != null" >
  360. demand_type = #{demandType,jdbcType=INTEGER},
  361. </if>
  362. <if test="problemDes != null" >
  363. problem_des = #{problemDes,jdbcType=VARCHAR},
  364. </if>
  365. <if test="technicalRequirements != null" >
  366. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  367. </if>
  368. <if test="pictureUrl != null" >
  369. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  370. </if>
  371. <if test="textFileUrl != null" >
  372. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  373. </if>
  374. <if test="videoUrl != null" >
  375. video_url = #{videoUrl,jdbcType=VARCHAR},
  376. </if>
  377. <if test="fixedBudget != null" >
  378. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  379. </if>
  380. <if test="fixedCycle != null" >
  381. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  382. </if>
  383. <if test="peopleNumber != null" >
  384. people_number = #{peopleNumber,jdbcType=INTEGER},
  385. </if>
  386. <if test="fixedScheme != null" >
  387. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  388. </if>
  389. <if test="costEscrow != null" >
  390. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  391. </if>
  392. <if test="budgetCost != null" >
  393. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  394. </if>
  395. <if test="validityPeriod != null" >
  396. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  397. </if>
  398. <if test="employerId != null" >
  399. employer_id = #{employerId,jdbcType=VARCHAR},
  400. </if>
  401. <if test="employerName != null" >
  402. employer_name = #{employerName,jdbcType=VARCHAR},
  403. </if>
  404. <if test="employerAddress != null" >
  405. employer_address = #{employerAddress,jdbcType=VARCHAR},
  406. </if>
  407. <if test="employerContacts != null" >
  408. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  409. </if>
  410. <if test="employerContactsMobile != null" >
  411. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  412. </if>
  413. <if test="employerContactsMailbox != null" >
  414. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  415. </if>
  416. <if test="contacts != null" >
  417. contacts = #{contacts,jdbcType=INTEGER},
  418. </if>
  419. <if test="status != null" >
  420. status = #{status,jdbcType=INTEGER},
  421. </if>
  422. <if test="releaseStatus != null" >
  423. release_status = #{releaseStatus,jdbcType=INTEGER},
  424. </if>
  425. <if test="releaseDate != null" >
  426. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  427. </if>
  428. <if test="createTime != null" >
  429. create_time = #{createTime,jdbcType=TIMESTAMP},
  430. </if>
  431. <if test="principalId != null" >
  432. principal_id = #{principalId,jdbcType=VARCHAR},
  433. </if>
  434. <if test="deletedSign != null" >
  435. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  436. </if>
  437. <if test="auditStatus != null" >
  438. audit_status = #{auditStatus,jdbcType=INTEGER},
  439. </if>
  440. <if test="techBrokerId != null" >
  441. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  442. </if>
  443. <if test="boutique != null">
  444. boutique = #{boutique,jdbcType=INTEGER},
  445. </if>
  446. <if test="remark != null" >
  447. remark = #{remark,jdbcType=VARCHAR},
  448. </if>
  449. </set>
  450. where id = #{id,jdbcType=VARCHAR}
  451. </update>
  452. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
  453. update demand
  454. set serial_number = #{serialNumber,jdbcType=INTEGER},
  455. data_category = #{dataCategory,jdbcType=INTEGER},
  456. name = #{name,jdbcType=VARCHAR},
  457. keyword = #{keyword,jdbcType=VARCHAR},
  458. info_sources = #{infoSources,jdbcType=INTEGER},
  459. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  460. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  461. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  462. demand_type = #{demandType,jdbcType=INTEGER},
  463. problem_des = #{problemDes,jdbcType=VARCHAR},
  464. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  465. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  466. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  467. video_url = #{videoUrl,jdbcType=VARCHAR},
  468. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  469. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  470. people_number = #{peopleNumber,jdbcType=INTEGER},
  471. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  472. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  473. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  474. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  475. employer_id = #{employerId,jdbcType=VARCHAR},
  476. employer_name = #{employerName,jdbcType=VARCHAR},
  477. employer_address = #{employerAddress,jdbcType=VARCHAR},
  478. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  479. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  480. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  481. contacts = #{contacts,jdbcType=INTEGER},
  482. status = #{status,jdbcType=INTEGER},
  483. release_status = #{releaseStatus,jdbcType=INTEGER},
  484. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  485. create_time = #{createTime,jdbcType=TIMESTAMP},
  486. principal_id = #{principalId,jdbcType=VARCHAR},
  487. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  488. audit_status = #{auditStatus,jdbcType=INTEGER},
  489. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  490. boutique = #{boutique,jdbcType=INTEGER}
  491. where id = #{id,jdbcType=VARCHAR}
  492. </update>
  493. <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  494. select
  495. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  496. d.name, d.keyword, d.info_sources as infoSources,
  497. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  498. d.employer_name as employerName, ui.province, d.status,
  499. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  500. d.employer_id as employerId, d.audit_status as auditStatus,d.boutique
  501. <if test="hot != null and hot == 1"><!-- 在首页 -->
  502. ,1 as hot
  503. </if>
  504. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  505. ,0 as hot
  506. </if>
  507. <if test="hot==null"><!-- 无首页参数 -->
  508. ,ifnull(mm.effective,0) as hot
  509. </if>
  510. from demand d
  511. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  512. LEFT JOIN admin a on a.id = d.tech_broker_id
  513. <if test="adminId != null">
  514. LEFT JOIN user u on d.employer_id = u.id
  515. </if>
  516. <if test="hot != null and hot == 1"><!-- 在首页 -->
  517. inner join marketing_management mm on d.id = mm.product_id
  518. </if>
  519. <if test="hot == null"> <!-- 无首页参数 -->
  520. left join marketing_management mm on d.id = mm.product_id
  521. </if>
  522. where d.deleted_sign = 0 and d.data_category = 0
  523. <if test="adminId != null">
  524. and (u.mid = #{adminId,jdbcType=VARCHAR}
  525. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  526. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  527. )
  528. </if>
  529. <if test="province != null">
  530. and ui.province = #{province,jdbcType=INTEGER}
  531. </if>
  532. <if test="auditStatus != null">
  533. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  534. </if>
  535. <if test="serialNumber != null">
  536. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  537. </if>
  538. <if test="name != null">
  539. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  540. </if>
  541. <if test="keyword != null">
  542. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  543. </if>
  544. <if test="username != null">
  545. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  546. </if>
  547. <if test="employerName != null">
  548. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  549. and (d.employer_id is null or d.employer_id='')
  550. </if>
  551. <if test="infoSources != null">
  552. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  553. </if>
  554. <if test="demandType != null">
  555. and d.demand_type = #{demandType,jdbcType=INTEGER}
  556. </if>
  557. <if test="status != null">
  558. and d.status = #{status,jdbcType=VARCHAR}
  559. </if>
  560. <if test="releaseStatus != null">
  561. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  562. </if>
  563. <if test="vStart != null">
  564. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  565. </if>
  566. <if test="vEnd != null">
  567. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  568. </if>
  569. <if test="rStart != null">
  570. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  571. </if>
  572. <if test="rEnd != null">
  573. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  574. </if>
  575. <if test="cStart != null">
  576. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  577. </if>
  578. <if test="cEnd != null">
  579. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  580. </if>
  581. <if test="boutique != null">
  582. and d.boutique = #{boutique,jdbcType=INTEGER}
  583. </if>
  584. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  585. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  586. </if>
  587. <if test="hot != null and hot == 1"><!-- 在首页 -->
  588. and mm.effective = 1
  589. </if>
  590. order by d.serial_number desc
  591. <if test="page_sql!=null">
  592. ${page_sql}
  593. </if>
  594. </select>
  595. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  596. select
  597. count(1)
  598. from demand d
  599. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  600. LEFT JOIN admin a on a.id = d.tech_broker_id
  601. <if test="adminId != null">
  602. LEFT JOIN user u on d.employer_id = u.id
  603. </if>
  604. <if test="hot != null and hot == 1"><!-- 在首页 -->
  605. inner join marketing_management mm on d.id = mm.product_id
  606. </if>
  607. <if test="hot == null"> <!-- 无首页参数 -->
  608. left join marketing_management mm on d.id = mm.product_id
  609. </if>
  610. where d.deleted_sign = 0 and d.data_category = 0
  611. <if test="adminId != null">
  612. and (u.mid = #{adminId,jdbcType=VARCHAR}
  613. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  614. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  615. )
  616. </if>
  617. <if test="serialNumber != null">
  618. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  619. </if>
  620. <if test="province != null">
  621. and ui.province = #{province,jdbcType=INTEGER}
  622. </if>
  623. <if test="auditStatus != null">
  624. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  625. </if>
  626. <if test="name != null">
  627. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  628. </if>
  629. <if test="keyword != null">
  630. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  631. </if>
  632. <if test="username != null">
  633. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  634. </if>
  635. <if test="employerName != null">
  636. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  637. and (d.employer_id is null or d.employer_id='')
  638. </if>
  639. <if test="infoSources != null">
  640. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  641. </if>
  642. <if test="demandType != null">
  643. and d.demand_type = #{demandType,jdbcType=INTEGER}
  644. </if>
  645. <if test="status != null">
  646. and d.status = #{status,jdbcType=INTEGER}
  647. </if>
  648. <if test="releaseStatus != null">
  649. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  650. </if>
  651. <if test="vStart != null">
  652. and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  653. </if>
  654. <if test="vEnd != null">
  655. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  656. </if>
  657. <if test="rStart != null">
  658. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  659. </if>
  660. <if test="rEnd != null">
  661. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  662. </if>
  663. <if test="cStart != null">
  664. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  665. </if>
  666. <if test="cEnd != null">
  667. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  668. </if>
  669. <if test="boutique != null">
  670. and d.boutique = #{boutique,jdbcType=INTEGER}
  671. </if>
  672. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  673. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  674. </if>
  675. <if test="hot != null and hot == 1"><!-- 在首页 -->
  676. and mm.effective = 1
  677. </if>
  678. </select>
  679. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  680. select
  681. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  682. d.name, d.keyword, d.info_sources as infoSources,
  683. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  684. d.employer_name as employerName, oi.licence_province as province, d.status,
  685. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  686. d.employer_id as employerId, d.audit_status as auditStatus,
  687. d.tech_broker_id as techBrokerId,d.boutique
  688. <if test="hot != null and hot == 1"><!-- 在首页 -->
  689. ,1 as hot
  690. </if>
  691. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  692. ,0 as hot
  693. </if>
  694. <if test="hot==null"><!-- 无首页参数 -->
  695. ,ifnull(mm.effective,0) as hot
  696. </if>
  697. from demand d
  698. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  699. LEFT JOIN admin a on a.id = d.tech_broker_id
  700. <if test="adminId != null">
  701. LEFT JOIN user u on d.employer_id = u.id
  702. </if>
  703. <if test="hot != null and hot == 1"><!-- 在首页 -->
  704. inner join marketing_management mm on d.id = mm.product_id
  705. </if>
  706. <if test="hot == null"> <!-- 无首页参数 -->
  707. left join marketing_management mm on d.id = mm.product_id
  708. </if>
  709. where d.deleted_sign = 0 and d.data_category = 1
  710. <if test="adminId != null">
  711. and (u.mid = #{adminId,jdbcType=VARCHAR}
  712. </if>
  713. <if test="adminId != null">
  714. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  715. </if>
  716. <if test="adminId != null">
  717. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  718. )
  719. </if>
  720. <if test="province != null">
  721. and oi.licence_province = #{province,jdbcType=INTEGER}
  722. </if>
  723. <if test="serialNumber != null">
  724. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  725. </if>
  726. <if test="auditStatus != null">
  727. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  728. </if>
  729. <if test="name != null">
  730. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  731. </if>
  732. <if test="keyword != null">
  733. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  734. </if>
  735. <if test="unitName != null">
  736. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  737. </if>
  738. <if test="employerName != null">
  739. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  740. and (d.employer_id is null or d.employer_id='')
  741. </if>
  742. <if test="infoSources != null">
  743. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  744. </if>
  745. <if test="demandType != null">
  746. and d.demand_type = #{demandType,jdbcType=INTEGER}
  747. </if>
  748. <if test="status != null">
  749. and d.status = #{status,jdbcType=INTEGER}
  750. </if>
  751. <if test="releaseStatus != null">
  752. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  753. </if>
  754. <if test="vStart != null">
  755. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  756. </if>
  757. <if test="vEnd != null">
  758. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  759. </if>
  760. <if test="rStart != null">
  761. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  762. </if>
  763. <if test="rEnd != null">
  764. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  765. </if>
  766. <if test="cStart != null">
  767. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  768. </if>
  769. <if test="cEnd != null">
  770. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  771. </if>
  772. <if test="boutique != null">
  773. and d.boutique = #{boutique,jdbcType=INTEGER}
  774. </if>
  775. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  776. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  777. </if>
  778. <if test="hot != null and hot == 1"><!-- 在首页 -->
  779. and mm.effective = 1
  780. </if>
  781. order by d.serial_number desc
  782. <if test="page_sql!=null">
  783. ${page_sql}
  784. </if>
  785. </select>
  786. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  787. select
  788. count(1)
  789. from demand d
  790. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  791. LEFT JOIN admin a on a.id = d.tech_broker_id
  792. <if test="adminId != null">
  793. LEFT JOIN user u on d.employer_id = u.id
  794. </if>
  795. <if test="hot != null and hot == 1"><!-- 在首页 -->
  796. inner join marketing_management mm on d.id = mm.product_id
  797. </if>
  798. <if test="hot == null"> <!-- 无首页参数 -->
  799. left join marketing_management mm on d.id = mm.product_id
  800. </if>
  801. where d.deleted_sign = 0 and d.data_category = 1
  802. <if test="adminId != null">
  803. and (u.mid = #{adminId,jdbcType=VARCHAR}
  804. </if>
  805. <if test="adminId != null">
  806. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  807. </if>
  808. <if test="adminId != null">
  809. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  810. )
  811. </if>
  812. <if test="serialNumber != null">
  813. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  814. </if>
  815. <if test="auditStatus != null">
  816. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  817. </if>
  818. <if test="province != null">
  819. and oi.licence_province = #{province,jdbcType=INTEGER}
  820. </if>
  821. <if test="name != null">
  822. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  823. </if>
  824. <if test="keyword != null">
  825. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  826. </if>
  827. <if test="unitName != null">
  828. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  829. </if>
  830. <if test="employerName != null">
  831. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  832. and (d.employer_id is null or d.employer_id='')
  833. </if>
  834. <if test="infoSources != null">
  835. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  836. </if>
  837. <if test="demandType != null">
  838. and d.demand_type = #{demandType,jdbcType=INTEGER}
  839. </if>
  840. <if test="status != null">
  841. and d.status = #{status,jdbcType=VARCHAR}
  842. </if>
  843. <if test="releaseStatus != null">
  844. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  845. </if>
  846. <if test="vStart != null">
  847. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  848. </if>
  849. <if test="vEnd != null">
  850. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  851. </if>
  852. <if test="rStart != null">
  853. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  854. </if>
  855. <if test="rEnd != null">
  856. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  857. </if>
  858. <if test="cStart != null">
  859. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  860. </if>
  861. <if test="cEnd != null">
  862. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  863. </if>
  864. <if test="boutique != null">
  865. and d.boutique = #{boutique,jdbcType=INTEGER}
  866. </if>
  867. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  868. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  869. </if>
  870. <if test="hot != null and hot == 1"><!-- 在首页 -->
  871. and mm.effective = 1
  872. </if>
  873. </select>
  874. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  875. select
  876. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  877. d.name, d.keyword, d.info_sources as infoSources,
  878. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  879. ui.province, d.status, d.release_status as releaseStatus,
  880. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  881. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  882. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  883. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  884. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  885. u.postal_address as address, u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
  886. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  887. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  888. d.tech_broker_id as techBrokerId, u.mobile as contactsName,
  889. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
  890. from demand d
  891. left join user_identity ui on ui.uid = d.employer_id
  892. <!-- left join user_info info on info.uid = d.employer_id -->
  893. left join user u on u.id = d.employer_id
  894. left join marketing_management mm on d.id = mm.product_id
  895. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  896. </select>
  897. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  898. select
  899. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  900. d.name, d.keyword, d.info_sources as infoSources,
  901. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  902. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  903. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  904. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  905. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  906. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  907. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  908. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  909. d.tech_broker_id as techBrokerId,d.remark,
  910. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  911. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  912. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
  913. from demand d
  914. left join organization_identity oi on oi.uid = d.employer_id
  915. left join user u on u.id = d.employer_id
  916. left join marketing_management mm on d.id = mm.product_id
  917. where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
  918. </select>
  919. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  920. update demand set deleted_sign = 1
  921. where id in
  922. <foreach item="item" collection="list" open="(" separator="," close=")">
  923. #{item}
  924. </foreach>
  925. </update>
  926. <update id="updateReleaseDate" parameterType="java.lang.String">
  927. update demand set release_date = null
  928. where id = #{id,jdbcType=VARCHAR}
  929. </update>
  930. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  931. select
  932. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  933. d.name, d.keyword, d.demand_type as demandType, d.remark,d.create_time as createTime,
  934. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, ad.name as techBrokerId,
  935. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  936. from demand d
  937. LEFT JOIN admin ad on ad.id = d.tech_broker_id
  938. where d.deleted_sign = 0
  939. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  940. <if test="serialNumber != null">
  941. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  942. </if>
  943. <if test="auditStatus != null">
  944. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  945. </if>
  946. <if test="name != null">
  947. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  948. </if>
  949. <if test="keyword != null">
  950. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  951. </if>
  952. <if test="demandType != null">
  953. and d.demand_type = #{demandType,jdbcType=INTEGER}
  954. </if>
  955. <if test="status != null">
  956. and d.status = #{status,jdbcType=VARCHAR}
  957. </if>
  958. <if test="releaseStatus != null">
  959. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  960. </if>
  961. <if test="vStart != null">
  962. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  963. </if>
  964. <if test="vEnd != null">
  965. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  966. </if>
  967. <if test="rStart != null">
  968. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  969. </if>
  970. <if test="rEnd != null">
  971. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  972. </if>
  973. order by d.serial_number desc
  974. <if test="page_sql!=null">
  975. ${page_sql}
  976. </if>
  977. </select>
  978. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  979. select count(1)
  980. from demand d
  981. where d.deleted_sign = 0
  982. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  983. <if test="serialNumber != null">
  984. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  985. </if>
  986. <if test="auditStatus != null">
  987. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  988. </if>
  989. <if test="name != null">
  990. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  991. </if>
  992. <if test="keyword != null">
  993. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  994. </if>
  995. <if test="demandType != null">
  996. and d.demand_type = #{demandType,jdbcType=INTEGER}
  997. </if>
  998. <if test="status != null">
  999. and d.status = #{status,jdbcType=VARCHAR}
  1000. </if>
  1001. <if test="releaseStatus != null">
  1002. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1003. </if>
  1004. <if test="vStart != null">
  1005. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1006. </if>
  1007. <if test="vEnd != null">
  1008. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1009. </if>
  1010. <if test="rStart != null">
  1011. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1012. </if>
  1013. <if test="rEnd != null">
  1014. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1015. </if>
  1016. </select>
  1017. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  1018. insert into demand
  1019. (id, deleted_sign, audit_status,
  1020. status, release_status, create_time,
  1021. keyword, data_category, name,
  1022. demand_type, problem_des, employer_name,
  1023. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark)
  1024. values
  1025. <foreach item="item" index="index" collection="list" separator=",">
  1026. (
  1027. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1028. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  1029. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  1030. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  1031. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  1032. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR}
  1033. )
  1034. </foreach>
  1035. </insert>
  1036. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1037. select
  1038. d.id, d.name, d.keyword,d.data_category as dataCategory,d.picture_url as pictureUrl,
  1039. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  1040. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  1041. d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,d.boutique,
  1042. u.lvl as level
  1043. from demand d
  1044. left join user u on u.id = d.employer_id
  1045. where d.deleted_sign = 0 and d.status = 0
  1046. <if test="keyword != null">
  1047. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1048. </if>
  1049. <if test="industryCategoryA != null">
  1050. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1051. </if>
  1052. <if test="industryCategoryB != null">
  1053. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1054. </if>
  1055. <if test="budgetCostLower != null">
  1056. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1057. </if>
  1058. <if test="budgetCostUpper != null">
  1059. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1060. </if>
  1061. <if test="demandType != null">
  1062. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1063. </if>
  1064. <if test="sign == 1">
  1065. and d.budget_cost is null
  1066. </if>
  1067. and d.deleted_sign = 0
  1068. and d.release_status = 1
  1069. and d.audit_status = 3
  1070. <if test="dateSort == 0">
  1071. order by d.release_date asc
  1072. </if>
  1073. <if test="dateSort == 1">
  1074. order by d.release_date desc
  1075. </if>
  1076. <if test="page_sql!=null">
  1077. ${page_sql}
  1078. </if>
  1079. </select>
  1080. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  1081. select
  1082. count(1)
  1083. from demand d
  1084. where d.deleted_sign = 0 and d.status = 0
  1085. <if test="keyword != null">
  1086. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1087. </if>
  1088. <if test="industryCategoryA != null">
  1089. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1090. </if>
  1091. <if test="industryCategoryB != null">
  1092. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1093. </if>
  1094. <if test="budgetCostLower != null">
  1095. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1096. </if>
  1097. <if test="budgetCostUpper != null">
  1098. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1099. </if>
  1100. <if test="demandType != null">
  1101. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1102. </if>
  1103. <if test="sign == 1">
  1104. and d.budget_cost is null
  1105. </if>
  1106. and d.deleted_sign = 0
  1107. and d.release_status = 1
  1108. and d.audit_status = 3
  1109. </select>
  1110. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  1111. select
  1112. d.id,
  1113. d.employer_name as employerName,
  1114. d.serial_number as serialNumber,
  1115. d.keyword,
  1116. d.data_category as dataCategory,
  1117. d.name,
  1118. d.industry_category_a as industryCategoryA,
  1119. d.industry_category_b as industryCategoryB,
  1120. d.demand_type as demandType,
  1121. d.budget_cost as budgetCost,
  1122. d.problem_des as problemDes,
  1123. d.release_date as releaseDate,
  1124. d.technical_requirements as technicalRequirements,
  1125. d.picture_url as pictureUrl,
  1126. d.text_file_url as textFileUrl,
  1127. d.video_url as videoUrl,
  1128. d.fixed_cycle as fixedCycle,
  1129. d.people_number as peopleNumber,
  1130. d.fixed_scheme as fixedScheme,
  1131. d.cost_escrow as costEscrow,
  1132. d.validity_period as validityPeriod,
  1133. ui.username,
  1134. oi.unit_name as unitName,
  1135. di.id as demandInterestId,
  1136. do.id as demandOrderId,
  1137. do.status as orderStatus
  1138. from demand d
  1139. left join user_identity ui on ui.uid = d.employer_id
  1140. left join organization_identity oi on oi.uid = d.employer_id
  1141. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1142. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1143. where d.id = #{1}
  1144. </select>
  1145. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1146. select
  1147. count(1)
  1148. from demand
  1149. where
  1150. deleted_sign = 0
  1151. and release_status = 1
  1152. and audit_status = 3
  1153. and employer_id = #{uid,jdbcType=VARCHAR}
  1154. </select>
  1155. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1156. SELECT
  1157. id,
  1158. serial_number AS serialNumber,
  1159. data_category AS dataCategory,
  1160. NAME,
  1161. keyword,
  1162. release_date AS releaseDate,
  1163. demand_type AS demandType,
  1164. validity_period AS validityPeriod,
  1165. problem_des as problemDes,
  1166. industry_category_a as industryCategoryA,
  1167. industry_category_b as industryCategoryB,
  1168. budget_cost as budgetCost
  1169. FROM
  1170. demand
  1171. WHERE
  1172. audit_status = 3
  1173. AND release_status = 1
  1174. AND deleted_sign = 0
  1175. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1176. </select>
  1177. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1178. SELECT
  1179. count(1)
  1180. FROM
  1181. demand
  1182. WHERE
  1183. audit_status = 3
  1184. AND release_status = 1
  1185. AND deleted_sign = 0
  1186. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1187. </select>
  1188. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1189. SELECT
  1190. d.id,
  1191. d.name,
  1192. d.keyword,
  1193. d.validity_period as validityPeriod,
  1194. d.industry_category_a AS industryCategoryA,
  1195. d.picture_url as pictureUrl,
  1196. d.employer_contacts_mobile as employerContactsMobile,
  1197. d.data_category as dataCategory,
  1198. fg.name AS industryCategoryAS,
  1199. fgg.name AS industryCategorBS,
  1200. d.budget_cost AS budgetCost,
  1201. d.problem_des AS problemDes,
  1202. dg.name AS province,
  1203. dgg.name AS city,
  1204. interest.id as interestId,
  1205. d.employer_name as employerName,
  1206. u.lvl as level
  1207. FROM
  1208. demand d
  1209. LEFT JOIN `user` u on u.id = d.employer_id
  1210. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1211. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1212. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1213. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1214. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1215. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1216. WHERE
  1217. d.id = #{id,jdbcType=VARCHAR}
  1218. </select>
  1219. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1220. SELECT
  1221. d.id,
  1222. d.name,
  1223. d.keyword,
  1224. d.picture_url as pictureUrl,
  1225. d.validity_period as validityPeriod,
  1226. d.employer_contacts_mobile as employerContactsMobile,
  1227. d.data_category as dataCategory,
  1228. d.industry_category_a AS industryCategoryA,
  1229. fg.name AS industryCategoryAS,
  1230. fgg.name AS industryCategoryBS,
  1231. d.budget_cost AS budgetCost,
  1232. d.problem_des AS problemDes,
  1233. dg.name AS province,
  1234. dgg.name AS city,
  1235. interest.id as interestId,
  1236. d.employer_name as employerName,
  1237. u.lvl as level
  1238. FROM
  1239. demand d
  1240. LEFT JOIN `user` u on u.id = d.employer_id
  1241. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1242. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1243. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1244. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1245. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1246. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1247. WHERE
  1248. d.id = #{id,jdbcType=VARCHAR}
  1249. </select>
  1250. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1251. select
  1252. d.id,
  1253. d.name,
  1254. fg.name as industryCategoryAS,
  1255. fgg.name as industryCategoryBS,
  1256. d.problem_des as problemDes,
  1257. d.budget_cost as budgetCost,
  1258. u.lvl as level
  1259. from
  1260. demand d
  1261. left join user u on u.id = d.employer_id
  1262. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1263. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1264. where
  1265. d.audit_status = 3
  1266. and d.release_status = 1
  1267. and d.deleted_sign = 0
  1268. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1269. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1270. order by d.serial_number desc
  1271. limit 5
  1272. </select>
  1273. <update id="updateEmployerId" parameterType="java.lang.String" >
  1274. update demand set employer_id = null
  1275. where id = #{id,jdbcType=VARCHAR}
  1276. </update>
  1277. <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1278. select
  1279. a.id,a.name,
  1280. b.name as industryCatalog,
  1281. a.picture_url as pictureUrl,
  1282. a.problem_des as sketch,
  1283. a.data_category as ownerType,
  1284. a.employer_name as personName
  1285. from
  1286. demand a
  1287. left join field_glossory b on a.industry_category_a = b.id
  1288. where
  1289. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1290. <if test="industryCategoryA != null and industryCategoryA != ''">
  1291. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1292. </if>
  1293. order by
  1294. a.create_time desc
  1295. <if test="page_sql!=null">
  1296. ${page_sql}
  1297. </if>
  1298. </select>
  1299. <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  1300. select
  1301. count(1)
  1302. from
  1303. demand a
  1304. left
  1305. join field_glossory b
  1306. on
  1307. a.industry_category_a = b.id
  1308. where
  1309. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1310. <if test="industryCategoryA != null and industryCategoryA != ''">
  1311. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1312. </if>
  1313. </select>
  1314. <!-- 查询需求列表 -->
  1315. <select id="selectDemandList"
  1316. resultType="com.goafanti.demand.bo.DemandListBo">
  1317. SELECT
  1318. d.id,
  1319. d.name,
  1320. d.keyword,
  1321. d.data_category as dataCategory,
  1322. d.fixed_budget as fixedbudget,
  1323. d.demand_type as demandType,
  1324. d.picture_url as pictureUrl,
  1325. d.industry_category_a AS industryCategoryA,
  1326. fg.name AS
  1327. industryCategoryAS,
  1328. fgg.name AS industryCategorBS,
  1329. d.budget_cost AS
  1330. budgetCost,
  1331. d.problem_des AS problemDes,
  1332. dg.name AS
  1333. province,
  1334. dgg.name AS
  1335. city,
  1336. d.employer_name as
  1337. employerName,
  1338. u.lvl as
  1339. level
  1340. FROM
  1341. demand d
  1342. LEFT JOIN `user` u on u.id = d.employer_id
  1343. LEFT JOIN
  1344. user_identity ui on ui.uid = d.employer_id
  1345. LEFT JOIN district_glossory
  1346. dg ON dg.id = ui.province
  1347. LEFT JOIN district_glossory dgg ON dgg.id =
  1348. ui.city
  1349. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1350. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1351. WHERE
  1352. <if test="_parameter!= null">
  1353. d.boutique = #{_parameter,jdbcType=INTEGER}
  1354. </if>
  1355. limit 0,30
  1356. </select>
  1357. <!-- 猜你喜欢 -->
  1358. <select id="selectCsutomerLike"
  1359. resultType="com.goafanti.demand.bo.DemandListBo">
  1360. SELECT
  1361. d.id,
  1362. d.name,
  1363. d.keyword,
  1364. d.data_category as dataCategory,
  1365. d.fixed_budget as fixedbudget,
  1366. d.demand_type as demandType,
  1367. d.picture_url as pictureUrl,
  1368. d.industry_category_a AS industryCategoryA,
  1369. fg.name AS
  1370. industryCategoryAS,
  1371. fgg.name AS industryCategorBS,
  1372. d.budget_cost AS
  1373. budgetCost,
  1374. d.problem_des AS problemDes,
  1375. dg.name AS
  1376. province,
  1377. dgg.name AS
  1378. city,
  1379. d.employer_name as
  1380. employerName,
  1381. u.lvl as
  1382. level
  1383. FROM
  1384. demand d
  1385. LEFT JOIN `user` u on u.id = d.employer_id
  1386. LEFT JOIN
  1387. user_identity ui on ui.uid = d.employer_id
  1388. LEFT JOIN district_glossory
  1389. dg ON dg.id = ui.province
  1390. LEFT JOIN district_glossory dgg ON dgg.id =
  1391. ui.city
  1392. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1393. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1394. LEFT JOIN demand_interest interest on interest.demand_id = d.id
  1395. where
  1396. interest.uid = #{uid,jdbcType=INTEGER}
  1397. limit 0,4
  1398. </select>
  1399. </mapper>