DemandMapper.xml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  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="boutique != null">
  576. and d.boutique = #{boutique,jdbcType=INTEGER}
  577. </if>
  578. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  579. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  580. </if>
  581. <if test="hot != null and hot == 1"><!-- 在首页 -->
  582. and mm.effective = 1
  583. </if>
  584. order by d.serial_number desc
  585. <if test="page_sql!=null">
  586. ${page_sql}
  587. </if>
  588. </select>
  589. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  590. select
  591. count(1)
  592. from demand d
  593. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  594. LEFT JOIN admin a on a.id = d.tech_broker_id
  595. <if test="adminId != null">
  596. LEFT JOIN user u on d.employer_id = u.id
  597. </if>
  598. <if test="hot != null and hot == 1"><!-- 在首页 -->
  599. inner join marketing_management mm on d.id = mm.product_id
  600. </if>
  601. <if test="hot == null"> <!-- 无首页参数 -->
  602. left join marketing_management mm on d.id = mm.product_id
  603. </if>
  604. where d.deleted_sign = 0 and d.data_category = 0
  605. <if test="adminId != null">
  606. and (u.mid = #{adminId,jdbcType=VARCHAR}
  607. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  608. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  609. )
  610. </if>
  611. <if test="serialNumber != null">
  612. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  613. </if>
  614. <if test="province != null">
  615. and ui.province = #{province,jdbcType=INTEGER}
  616. </if>
  617. <if test="auditStatus != null">
  618. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  619. </if>
  620. <if test="name != null">
  621. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  622. </if>
  623. <if test="keyword != null">
  624. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  625. </if>
  626. <if test="username != null">
  627. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  628. </if>
  629. <if test="employerName != null">
  630. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  631. and (d.employer_id is null or d.employer_id='')
  632. </if>
  633. <if test="infoSources != null">
  634. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  635. </if>
  636. <if test="demandType != null">
  637. and d.demand_type = #{demandType,jdbcType=INTEGER}
  638. </if>
  639. <if test="status != null">
  640. and d.status = #{status,jdbcType=INTEGER}
  641. </if>
  642. <if test="releaseStatus != null">
  643. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  644. </if>
  645. <if test="vStart != null">
  646. and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  647. </if>
  648. <if test="vEnd != null">
  649. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  650. </if>
  651. <if test="rStart != null">
  652. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  653. </if>
  654. <if test="rEnd != null">
  655. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  656. </if>
  657. <if test="boutique != null">
  658. and d.boutique = #{boutique,jdbcType=INTEGER}
  659. </if>
  660. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  661. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  662. </if>
  663. <if test="hot != null and hot == 1"><!-- 在首页 -->
  664. and mm.effective = 1
  665. </if>
  666. </select>
  667. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  668. select
  669. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  670. d.name, d.keyword, d.info_sources as infoSources,
  671. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  672. d.employer_name as employerName, oi.licence_province as province, d.status,
  673. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  674. d.employer_id as employerId, d.audit_status as auditStatus,
  675. d.tech_broker_id as techBrokerId,d.boutique
  676. <if test="hot != null and hot == 1"><!-- 在首页 -->
  677. ,1 as hot
  678. </if>
  679. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  680. ,0 as hot
  681. </if>
  682. <if test="hot==null"><!-- 无首页参数 -->
  683. ,ifnull(mm.effective,0) as hot
  684. </if>
  685. from demand d
  686. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  687. LEFT JOIN admin a on a.id = d.tech_broker_id
  688. <if test="adminId != null">
  689. LEFT JOIN user u on d.employer_id = u.id
  690. </if>
  691. <if test="hot != null and hot == 1"><!-- 在首页 -->
  692. inner join marketing_management mm on d.id = mm.product_id
  693. </if>
  694. <if test="hot == null"> <!-- 无首页参数 -->
  695. left join marketing_management mm on d.id = mm.product_id
  696. </if>
  697. where d.deleted_sign = 0 and d.data_category = 1
  698. <if test="adminId != null">
  699. and (u.mid = #{adminId,jdbcType=VARCHAR}
  700. </if>
  701. <if test="adminId != null">
  702. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  703. </if>
  704. <if test="adminId != null">
  705. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  706. )
  707. </if>
  708. <if test="province != null">
  709. and oi.licence_province = #{province,jdbcType=INTEGER}
  710. </if>
  711. <if test="serialNumber != null">
  712. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  713. </if>
  714. <if test="auditStatus != null">
  715. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  716. </if>
  717. <if test="name != null">
  718. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  719. </if>
  720. <if test="keyword != null">
  721. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  722. </if>
  723. <if test="unitName != null">
  724. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  725. </if>
  726. <if test="employerName != null">
  727. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  728. and (d.employer_id is null or d.employer_id='')
  729. </if>
  730. <if test="infoSources != null">
  731. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  732. </if>
  733. <if test="demandType != null">
  734. and d.demand_type = #{demandType,jdbcType=INTEGER}
  735. </if>
  736. <if test="status != null">
  737. and d.status = #{status,jdbcType=INTEGER}
  738. </if>
  739. <if test="releaseStatus != null">
  740. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  741. </if>
  742. <if test="vStart != null">
  743. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  744. </if>
  745. <if test="vEnd != null">
  746. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  747. </if>
  748. <if test="rStart != null">
  749. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  750. </if>
  751. <if test="rEnd != null">
  752. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  753. </if>
  754. <if test="boutique != null">
  755. and d.boutique = #{boutique,jdbcType=INTEGER}
  756. </if>
  757. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  758. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  759. </if>
  760. <if test="hot != null and hot == 1"><!-- 在首页 -->
  761. and mm.effective = 1
  762. </if>
  763. order by d.serial_number desc
  764. <if test="page_sql!=null">
  765. ${page_sql}
  766. </if>
  767. </select>
  768. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  769. select
  770. count(1)
  771. from demand d
  772. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  773. LEFT JOIN admin a on a.id = d.tech_broker_id
  774. <if test="adminId != null">
  775. LEFT JOIN user u on d.employer_id = u.id
  776. </if>
  777. <if test="hot != null and hot == 1"><!-- 在首页 -->
  778. inner join marketing_management mm on d.id = mm.product_id
  779. </if>
  780. <if test="hot == null"> <!-- 无首页参数 -->
  781. left join marketing_management mm on d.id = mm.product_id
  782. </if>
  783. where d.deleted_sign = 0 and d.data_category = 1
  784. <if test="adminId != null">
  785. and (u.mid = #{adminId,jdbcType=VARCHAR}
  786. </if>
  787. <if test="adminId != null">
  788. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  789. </if>
  790. <if test="adminId != null">
  791. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  792. )
  793. </if>
  794. <if test="serialNumber != null">
  795. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  796. </if>
  797. <if test="auditStatus != null">
  798. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  799. </if>
  800. <if test="province != null">
  801. and oi.licence_province = #{province,jdbcType=INTEGER}
  802. </if>
  803. <if test="name != null">
  804. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  805. </if>
  806. <if test="keyword != null">
  807. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  808. </if>
  809. <if test="unitName != null">
  810. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  811. </if>
  812. <if test="employerName != null">
  813. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  814. and (d.employer_id is null or d.employer_id='')
  815. </if>
  816. <if test="infoSources != null">
  817. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  818. </if>
  819. <if test="demandType != null">
  820. and d.demand_type = #{demandType,jdbcType=INTEGER}
  821. </if>
  822. <if test="status != null">
  823. and d.status = #{status,jdbcType=VARCHAR}
  824. </if>
  825. <if test="releaseStatus != null">
  826. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  827. </if>
  828. <if test="vStart != null">
  829. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  830. </if>
  831. <if test="vEnd != null">
  832. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  833. </if>
  834. <if test="rStart != null">
  835. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  836. </if>
  837. <if test="rEnd != null">
  838. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  839. </if>
  840. <if test="boutique != null">
  841. and d.boutique = #{boutique,jdbcType=INTEGER}
  842. </if>
  843. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  844. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  845. </if>
  846. <if test="hot != null and hot == 1"><!-- 在首页 -->
  847. and mm.effective = 1
  848. </if>
  849. </select>
  850. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  851. select
  852. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  853. d.name, d.keyword, d.info_sources as infoSources,
  854. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  855. ui.province, d.status, d.release_status as releaseStatus,
  856. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  857. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  858. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  859. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  860. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  861. u.postal_address as address, u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
  862. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  863. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  864. d.tech_broker_id as techBrokerId, u.mobile as contactsName,
  865. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
  866. from demand d
  867. left join user_identity ui on ui.uid = d.employer_id
  868. <!-- left join user_info info on info.uid = d.employer_id -->
  869. left join user u on u.id = d.employer_id
  870. left join marketing_management mm on d.id = mm.product_id
  871. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  872. </select>
  873. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  874. select
  875. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  876. d.name, d.keyword, d.info_sources as infoSources,
  877. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  878. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  879. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  880. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  881. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  882. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  883. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  884. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  885. d.tech_broker_id as techBrokerId,d.remark,
  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.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
  889. from demand d
  890. left join organization_identity oi on oi.uid = d.employer_id
  891. left join user u on u.id = d.employer_id
  892. left join marketing_management mm on d.id = mm.product_id
  893. where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
  894. </select>
  895. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  896. update demand set deleted_sign = 1
  897. where id in
  898. <foreach item="item" collection="list" open="(" separator="," close=")">
  899. #{item}
  900. </foreach>
  901. </update>
  902. <update id="updateReleaseDate" parameterType="java.lang.String">
  903. update demand set release_date = null
  904. where id = #{id,jdbcType=VARCHAR}
  905. </update>
  906. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  907. select
  908. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  909. d.name, d.keyword, d.demand_type as demandType, d.remark,d.create_time as createTime,
  910. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, ad.name as techBrokerId,
  911. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  912. from demand d
  913. LEFT JOIN admin ad on ad.id = d.tech_broker_id
  914. where d.deleted_sign = 0
  915. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  916. <if test="serialNumber != null">
  917. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  918. </if>
  919. <if test="auditStatus != null">
  920. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  921. </if>
  922. <if test="name != null">
  923. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  924. </if>
  925. <if test="keyword != null">
  926. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  927. </if>
  928. <if test="demandType != null">
  929. and d.demand_type = #{demandType,jdbcType=INTEGER}
  930. </if>
  931. <if test="status != null">
  932. and d.status = #{status,jdbcType=VARCHAR}
  933. </if>
  934. <if test="releaseStatus != null">
  935. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  936. </if>
  937. <if test="vStart != null">
  938. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  939. </if>
  940. <if test="vEnd != null">
  941. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  942. </if>
  943. <if test="rStart != null">
  944. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  945. </if>
  946. <if test="rEnd != null">
  947. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  948. </if>
  949. order by d.serial_number desc
  950. <if test="page_sql!=null">
  951. ${page_sql}
  952. </if>
  953. </select>
  954. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  955. select count(1)
  956. from demand d
  957. where d.deleted_sign = 0
  958. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  959. <if test="serialNumber != null">
  960. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  961. </if>
  962. <if test="auditStatus != null">
  963. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  964. </if>
  965. <if test="name != null">
  966. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  967. </if>
  968. <if test="keyword != null">
  969. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  970. </if>
  971. <if test="demandType != null">
  972. and d.demand_type = #{demandType,jdbcType=INTEGER}
  973. </if>
  974. <if test="status != null">
  975. and d.status = #{status,jdbcType=VARCHAR}
  976. </if>
  977. <if test="releaseStatus != null">
  978. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  979. </if>
  980. <if test="vStart != null">
  981. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  982. </if>
  983. <if test="vEnd != null">
  984. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  985. </if>
  986. <if test="rStart != null">
  987. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  988. </if>
  989. <if test="rEnd != null">
  990. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  991. </if>
  992. </select>
  993. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  994. insert into demand
  995. (id, deleted_sign, audit_status,
  996. status, release_status, create_time,
  997. keyword, data_category, name,
  998. demand_type, problem_des, employer_name,
  999. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark)
  1000. values
  1001. <foreach item="item" index="index" collection="list" separator=",">
  1002. (
  1003. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1004. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  1005. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  1006. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  1007. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  1008. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR}
  1009. )
  1010. </foreach>
  1011. </insert>
  1012. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1013. select
  1014. d.id, d.name, d.keyword,d.data_category as dataCategory,d.picture_url as pictureUrl,
  1015. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  1016. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  1017. d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,d.boutique,
  1018. u.lvl as level
  1019. from demand d
  1020. left join user u on u.id = d.employer_id
  1021. where d.deleted_sign = 0 and d.status = 0
  1022. <if test="keyword != null">
  1023. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1024. </if>
  1025. <if test="industryCategoryA != null">
  1026. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1027. </if>
  1028. <if test="industryCategoryB != null">
  1029. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1030. </if>
  1031. <if test="budgetCostLower != null">
  1032. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1033. </if>
  1034. <if test="budgetCostUpper != null">
  1035. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1036. </if>
  1037. <if test="demandType != null">
  1038. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1039. </if>
  1040. <if test="sign == 1">
  1041. and d.budget_cost is null
  1042. </if>
  1043. and d.deleted_sign = 0
  1044. and d.release_status = 1
  1045. and d.audit_status = 3
  1046. <if test="dateSort == 0">
  1047. order by d.release_date asc
  1048. </if>
  1049. <if test="dateSort == 1">
  1050. order by d.release_date desc
  1051. </if>
  1052. <if test="page_sql!=null">
  1053. ${page_sql}
  1054. </if>
  1055. </select>
  1056. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  1057. select
  1058. count(1)
  1059. from demand d
  1060. where d.deleted_sign = 0 and d.status = 0
  1061. <if test="keyword != null">
  1062. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1063. </if>
  1064. <if test="industryCategoryA != null">
  1065. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1066. </if>
  1067. <if test="industryCategoryB != null">
  1068. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1069. </if>
  1070. <if test="budgetCostLower != null">
  1071. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1072. </if>
  1073. <if test="budgetCostUpper != null">
  1074. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1075. </if>
  1076. <if test="demandType != null">
  1077. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1078. </if>
  1079. <if test="sign == 1">
  1080. and d.budget_cost is null
  1081. </if>
  1082. and d.deleted_sign = 0
  1083. and d.release_status = 1
  1084. and d.audit_status = 3
  1085. </select>
  1086. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  1087. select
  1088. d.id,
  1089. d.employer_name as employerName,
  1090. d.serial_number as serialNumber,
  1091. d.keyword,
  1092. d.data_category as dataCategory,
  1093. d.name,
  1094. d.industry_category_a as industryCategoryA,
  1095. d.industry_category_b as industryCategoryB,
  1096. d.demand_type as demandType,
  1097. d.budget_cost as budgetCost,
  1098. d.problem_des as problemDes,
  1099. d.release_date as releaseDate,
  1100. d.technical_requirements as technicalRequirements,
  1101. d.picture_url as pictureUrl,
  1102. d.text_file_url as textFileUrl,
  1103. d.video_url as videoUrl,
  1104. d.fixed_cycle as fixedCycle,
  1105. d.people_number as peopleNumber,
  1106. d.fixed_scheme as fixedScheme,
  1107. d.cost_escrow as costEscrow,
  1108. d.validity_period as validityPeriod,
  1109. ui.username,
  1110. oi.unit_name as unitName,
  1111. di.id as demandInterestId,
  1112. do.id as demandOrderId,
  1113. do.status as orderStatus
  1114. from demand d
  1115. left join user_identity ui on ui.uid = d.employer_id
  1116. left join organization_identity oi on oi.uid = d.employer_id
  1117. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1118. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1119. where d.id = #{1}
  1120. </select>
  1121. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1122. select
  1123. count(1)
  1124. from demand
  1125. where
  1126. deleted_sign = 0
  1127. and release_status = 1
  1128. and audit_status = 3
  1129. and employer_id = #{uid,jdbcType=VARCHAR}
  1130. </select>
  1131. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1132. SELECT
  1133. id,
  1134. serial_number AS serialNumber,
  1135. data_category AS dataCategory,
  1136. NAME,
  1137. keyword,
  1138. release_date AS releaseDate,
  1139. demand_type AS demandType,
  1140. validity_period AS validityPeriod,
  1141. problem_des as problemDes,
  1142. industry_category_a as industryCategoryA,
  1143. industry_category_b as industryCategoryB,
  1144. budget_cost as budgetCost
  1145. FROM
  1146. demand
  1147. WHERE
  1148. audit_status = 3
  1149. AND release_status = 1
  1150. AND deleted_sign = 0
  1151. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1152. </select>
  1153. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1154. SELECT
  1155. count(1)
  1156. FROM
  1157. demand
  1158. WHERE
  1159. audit_status = 3
  1160. AND release_status = 1
  1161. AND deleted_sign = 0
  1162. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1163. </select>
  1164. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1165. SELECT
  1166. d.id,
  1167. d.name,
  1168. d.keyword,
  1169. d.validity_period as validityPeriod,
  1170. d.industry_category_a AS industryCategoryA,
  1171. d.picture_url as pictureUrl,
  1172. d.employer_contacts_mobile as employerContactsMobile,
  1173. d.data_category as dataCategory,
  1174. fg.name AS industryCategoryAS,
  1175. fgg.name AS industryCategorBS,
  1176. d.budget_cost AS budgetCost,
  1177. d.problem_des AS problemDes,
  1178. dg.name AS province,
  1179. dgg.name AS city,
  1180. interest.id as interestId,
  1181. d.employer_name as employerName,
  1182. u.lvl as level
  1183. FROM
  1184. demand d
  1185. LEFT JOIN `user` u on u.id = d.employer_id
  1186. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1187. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1188. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1189. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1190. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1191. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1192. WHERE
  1193. d.id = #{id,jdbcType=VARCHAR}
  1194. </select>
  1195. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1196. SELECT
  1197. d.id,
  1198. d.name,
  1199. d.keyword,
  1200. d.picture_url as pictureUrl,
  1201. d.validity_period as validityPeriod,
  1202. d.employer_contacts_mobile as employerContactsMobile,
  1203. d.data_category as dataCategory,
  1204. d.industry_category_a AS industryCategoryA,
  1205. fg.name AS industryCategoryAS,
  1206. fgg.name AS industryCategoryBS,
  1207. d.budget_cost AS budgetCost,
  1208. d.problem_des AS problemDes,
  1209. dg.name AS province,
  1210. dgg.name AS city,
  1211. interest.id as interestId,
  1212. d.employer_name as employerName,
  1213. u.lvl as level
  1214. FROM
  1215. demand d
  1216. LEFT JOIN `user` u on u.id = d.employer_id
  1217. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1218. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1219. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1220. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1221. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1222. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1223. WHERE
  1224. d.id = #{id,jdbcType=VARCHAR}
  1225. </select>
  1226. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1227. select
  1228. d.id,
  1229. d.name,
  1230. fg.name as industryCategoryAS,
  1231. fgg.name as industryCategoryBS,
  1232. d.problem_des as problemDes,
  1233. d.budget_cost as budgetCost,
  1234. u.lvl as level
  1235. from
  1236. demand d
  1237. left join user u on u.id = d.employer_id
  1238. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1239. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1240. where
  1241. d.audit_status = 3
  1242. and d.release_status = 1
  1243. and d.deleted_sign = 0
  1244. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1245. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1246. order by d.serial_number desc
  1247. limit 5
  1248. </select>
  1249. <update id="updateEmployerId" parameterType="java.lang.String" >
  1250. update demand set employer_id = null
  1251. where id = #{id,jdbcType=VARCHAR}
  1252. </update>
  1253. <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1254. select
  1255. a.id,a.name,
  1256. b.name as industryCatalog,
  1257. a.picture_url as pictureUrl,
  1258. a.problem_des as sketch,
  1259. a.data_category as ownerType,
  1260. a.employer_name as personName
  1261. from
  1262. demand a
  1263. left join field_glossory b on a.industry_category_a = b.id
  1264. where
  1265. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1266. <if test="industryCategoryA != null and industryCategoryA != ''">
  1267. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1268. </if>
  1269. order by
  1270. a.create_time desc
  1271. <if test="page_sql!=null">
  1272. ${page_sql}
  1273. </if>
  1274. </select>
  1275. <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  1276. select
  1277. count(1)
  1278. from
  1279. demand a
  1280. left
  1281. join field_glossory b
  1282. on
  1283. a.industry_category_a = b.id
  1284. where
  1285. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1286. <if test="industryCategoryA != null and industryCategoryA != ''">
  1287. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1288. </if>
  1289. </select>
  1290. <!-- 查询需求列表 -->
  1291. <select id="selectDemandList"
  1292. resultType="com.goafanti.demand.bo.DemandListBo">
  1293. SELECT
  1294. d.id,
  1295. d.name,
  1296. d.keyword,
  1297. d.data_category as dataCategory,
  1298. d.fixed_budget as fixedbudget,
  1299. d.demand_type as demandType,
  1300. d.picture_url as pictureUrl,
  1301. d.industry_category_a AS industryCategoryA,
  1302. fg.name AS
  1303. industryCategoryAS,
  1304. fgg.name AS industryCategorBS,
  1305. d.budget_cost AS
  1306. budgetCost,
  1307. d.problem_des AS problemDes,
  1308. dg.name AS
  1309. province,
  1310. dgg.name AS
  1311. city,
  1312. d.employer_name as
  1313. employerName,
  1314. u.lvl as
  1315. level
  1316. FROM
  1317. demand d
  1318. LEFT JOIN `user` u on u.id = d.employer_id
  1319. LEFT JOIN
  1320. user_identity ui on ui.uid = d.employer_id
  1321. LEFT JOIN district_glossory
  1322. dg ON dg.id = ui.province
  1323. LEFT JOIN district_glossory dgg ON dgg.id =
  1324. ui.city
  1325. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1326. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1327. WHERE
  1328. <if test="_parameter!= null">
  1329. d.boutique = #{_parameter,jdbcType=INTEGER}
  1330. </if>
  1331. limit 0,30
  1332. </select>
  1333. <!-- 猜你喜欢 -->
  1334. <select id="selectCsutomerLike"
  1335. resultType="com.goafanti.demand.bo.DemandListBo">
  1336. SELECT
  1337. d.id,
  1338. d.name,
  1339. d.keyword,
  1340. d.data_category as dataCategory,
  1341. d.fixed_budget as fixedbudget,
  1342. d.demand_type as demandType,
  1343. d.picture_url as pictureUrl,
  1344. d.industry_category_a AS industryCategoryA,
  1345. fg.name AS
  1346. industryCategoryAS,
  1347. fgg.name AS industryCategorBS,
  1348. d.budget_cost AS
  1349. budgetCost,
  1350. d.problem_des AS problemDes,
  1351. dg.name AS
  1352. province,
  1353. dgg.name AS
  1354. city,
  1355. d.employer_name as
  1356. employerName,
  1357. u.lvl as
  1358. level
  1359. FROM
  1360. demand d
  1361. LEFT JOIN `user` u on u.id = d.employer_id
  1362. LEFT JOIN
  1363. user_identity ui on ui.uid = d.employer_id
  1364. LEFT JOIN district_glossory
  1365. dg ON dg.id = ui.province
  1366. LEFT JOIN district_glossory dgg ON dgg.id =
  1367. ui.city
  1368. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1369. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1370. LEFT JOIN demand_interest interest on interest.demand_id = d.id
  1371. where
  1372. interest.uid = #{uid,jdbcType=INTEGER}
  1373. limit 0,4
  1374. </select>
  1375. </mapper>