DemandMapper.xml 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  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="VARCHAR" />
  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. </resultMap>
  43. <sql id="Base_Column_List" >
  44. id, serial_number, data_category, name, keyword, info_sources, industry_category_a,
  45. industry_category_b, industry_category_c, demand_type, problem_des, technical_requirements,
  46. picture_url, text_file_url, video_url, fixed_budget, fixed_cycle, people_number,
  47. fixed_scheme, cost_escrow, budget_cost, validity_period, employer_id, employer_name,
  48. employer_address, employer_contacts, employer_contacts_mobile, employer_contacts_mailbox,
  49. contacts, status, release_status, release_date, create_time, principal_id, deleted_sign,
  50. audit_status, tech_broker_id
  51. </sql>
  52. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  53. select
  54. <include refid="Base_Column_List" />
  55. from demand
  56. where id = #{id,jdbcType=VARCHAR}
  57. </select>
  58. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  59. delete from demand
  60. where id = #{id,jdbcType=VARCHAR}
  61. </delete>
  62. <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
  63. insert into demand (id, serial_number, data_category,
  64. name, keyword, info_sources,
  65. industry_category_a, industry_category_b, industry_category_c,
  66. demand_type, problem_des, technical_requirements,
  67. picture_url, text_file_url, video_url,
  68. fixed_budget, fixed_cycle, people_number,
  69. fixed_scheme, cost_escrow, budget_cost,
  70. validity_period, employer_id, employer_name,
  71. employer_address, employer_contacts, employer_contacts_mobile,
  72. employer_contacts_mailbox, contacts, status,
  73. release_status, release_date, create_time,
  74. principal_id, deleted_sign, audit_status, tech_broker_id)
  75. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  76. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER},
  77. #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER},
  78. #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR},
  79. #{pictureUrl,jdbcType=LONGVARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR},
  80. #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER},
  81. #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL},
  82. #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR},
  83. #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR},
  84. #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  85. #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  86. #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
  87. #{techBrokerId,jdbcType=VARCHAR})
  88. </insert>
  89. <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
  90. insert into demand
  91. <trim prefix="(" suffix=")" suffixOverrides="," >
  92. <if test="id != null" >
  93. id,
  94. </if>
  95. <if test="serialNumber != null" >
  96. serial_number,
  97. </if>
  98. <if test="dataCategory != null" >
  99. data_category,
  100. </if>
  101. <if test="name != null" >
  102. name,
  103. </if>
  104. <if test="keyword != null" >
  105. keyword,
  106. </if>
  107. <if test="infoSources != null" >
  108. info_sources,
  109. </if>
  110. <if test="industryCategoryA != null" >
  111. industry_category_a,
  112. </if>
  113. <if test="industryCategoryB != null" >
  114. industry_category_b,
  115. </if>
  116. <if test="industryCategoryC != null" >
  117. industry_category_c,
  118. </if>
  119. <if test="demandType != null" >
  120. demand_type,
  121. </if>
  122. <if test="problemDes != null" >
  123. problem_des,
  124. </if>
  125. <if test="technicalRequirements != null" >
  126. technical_requirements,
  127. </if>
  128. <if test="pictureUrl != null" >
  129. picture_url,
  130. </if>
  131. <if test="textFileUrl != null" >
  132. text_file_url,
  133. </if>
  134. <if test="videoUrl != null" >
  135. video_url,
  136. </if>
  137. <if test="fixedBudget != null" >
  138. fixed_budget,
  139. </if>
  140. <if test="fixedCycle != null" >
  141. fixed_cycle,
  142. </if>
  143. <if test="peopleNumber != null" >
  144. people_number,
  145. </if>
  146. <if test="fixedScheme != null" >
  147. fixed_scheme,
  148. </if>
  149. <if test="costEscrow != null" >
  150. cost_escrow,
  151. </if>
  152. <if test="budgetCost != null" >
  153. budget_cost,
  154. </if>
  155. <if test="validityPeriod != null" >
  156. validity_period,
  157. </if>
  158. <if test="employerId != null" >
  159. employer_id,
  160. </if>
  161. <if test="employerName != null" >
  162. employer_name,
  163. </if>
  164. <if test="employerAddress != null" >
  165. employer_address,
  166. </if>
  167. <if test="employerContacts != null" >
  168. employer_contacts,
  169. </if>
  170. <if test="employerContactsMobile != null" >
  171. employer_contacts_mobile,
  172. </if>
  173. <if test="employerContactsMailbox != null" >
  174. employer_contacts_mailbox,
  175. </if>
  176. <if test="contacts != null" >
  177. contacts,
  178. </if>
  179. <if test="status != null" >
  180. status,
  181. </if>
  182. <if test="releaseStatus != null" >
  183. release_status,
  184. </if>
  185. <if test="releaseDate != null" >
  186. release_date,
  187. </if>
  188. <if test="createTime != null" >
  189. create_time,
  190. </if>
  191. <if test="principalId != null" >
  192. principal_id,
  193. </if>
  194. <if test="deletedSign != null" >
  195. deleted_sign,
  196. </if>
  197. <if test="auditStatus != null" >
  198. audit_status,
  199. </if>
  200. <if test="techBrokerId != null" >
  201. tech_broker_id,
  202. </if>
  203. </trim>
  204. <trim prefix="values (" suffix=")" suffixOverrides="," >
  205. <if test="id != null" >
  206. #{id,jdbcType=VARCHAR},
  207. </if>
  208. <if test="serialNumber != null" >
  209. #{serialNumber,jdbcType=INTEGER},
  210. </if>
  211. <if test="dataCategory != null" >
  212. #{dataCategory,jdbcType=INTEGER},
  213. </if>
  214. <if test="name != null" >
  215. #{name,jdbcType=VARCHAR},
  216. </if>
  217. <if test="keyword != null" >
  218. #{keyword,jdbcType=VARCHAR},
  219. </if>
  220. <if test="infoSources != null" >
  221. #{infoSources,jdbcType=INTEGER},
  222. </if>
  223. <if test="industryCategoryA != null" >
  224. #{industryCategoryA,jdbcType=INTEGER},
  225. </if>
  226. <if test="industryCategoryB != null" >
  227. #{industryCategoryB,jdbcType=INTEGER},
  228. </if>
  229. <if test="industryCategoryC != null" >
  230. #{industryCategoryC,jdbcType=INTEGER},
  231. </if>
  232. <if test="demandType != null" >
  233. #{demandType,jdbcType=INTEGER},
  234. </if>
  235. <if test="problemDes != null" >
  236. #{problemDes,jdbcType=VARCHAR},
  237. </if>
  238. <if test="technicalRequirements != null" >
  239. #{technicalRequirements,jdbcType=VARCHAR},
  240. </if>
  241. <if test="pictureUrl != null" >
  242. #{pictureUrl,jdbcType=LONGVARCHAR},
  243. </if>
  244. <if test="textFileUrl != null" >
  245. #{textFileUrl,jdbcType=VARCHAR},
  246. </if>
  247. <if test="videoUrl != null" >
  248. #{videoUrl,jdbcType=VARCHAR},
  249. </if>
  250. <if test="fixedBudget != null" >
  251. #{fixedBudget,jdbcType=DECIMAL},
  252. </if>
  253. <if test="fixedCycle != null" >
  254. #{fixedCycle,jdbcType=VARCHAR},
  255. </if>
  256. <if test="peopleNumber != null" >
  257. #{peopleNumber,jdbcType=INTEGER},
  258. </if>
  259. <if test="fixedScheme != null" >
  260. #{fixedScheme,jdbcType=VARCHAR},
  261. </if>
  262. <if test="costEscrow != null" >
  263. #{costEscrow,jdbcType=DECIMAL},
  264. </if>
  265. <if test="budgetCost != null" >
  266. #{budgetCost,jdbcType=DECIMAL},
  267. </if>
  268. <if test="validityPeriod != null" >
  269. #{validityPeriod,jdbcType=TIMESTAMP},
  270. </if>
  271. <if test="employerId != null" >
  272. #{employerId,jdbcType=VARCHAR},
  273. </if>
  274. <if test="employerName != null" >
  275. #{employerName,jdbcType=VARCHAR},
  276. </if>
  277. <if test="employerAddress != null" >
  278. #{employerAddress,jdbcType=VARCHAR},
  279. </if>
  280. <if test="employerContacts != null" >
  281. #{employerContacts,jdbcType=VARCHAR},
  282. </if>
  283. <if test="employerContactsMobile != null" >
  284. #{employerContactsMobile,jdbcType=VARCHAR},
  285. </if>
  286. <if test="employerContactsMailbox != null" >
  287. #{employerContactsMailbox,jdbcType=VARCHAR},
  288. </if>
  289. <if test="contacts != null" >
  290. #{contacts,jdbcType=INTEGER},
  291. </if>
  292. <if test="status != null" >
  293. #{status,jdbcType=INTEGER},
  294. </if>
  295. <if test="releaseStatus != null" >
  296. #{releaseStatus,jdbcType=INTEGER},
  297. </if>
  298. <if test="releaseDate != null" >
  299. #{releaseDate,jdbcType=TIMESTAMP},
  300. </if>
  301. <if test="createTime != null" >
  302. #{createTime,jdbcType=TIMESTAMP},
  303. </if>
  304. <if test="principalId != null" >
  305. #{principalId,jdbcType=VARCHAR},
  306. </if>
  307. <if test="deletedSign != null" >
  308. #{deletedSign,jdbcType=INTEGER},
  309. </if>
  310. <if test="auditStatus != null" >
  311. #{auditStatus,jdbcType=INTEGER},
  312. </if>
  313. <if test="techBrokerId != null" >
  314. #{techBrokerId,jdbcType=VARCHAR},
  315. </if>
  316. </trim>
  317. </insert>
  318. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
  319. update demand
  320. <set >
  321. <if test="serialNumber != null" >
  322. serial_number = #{serialNumber,jdbcType=INTEGER},
  323. </if>
  324. <if test="dataCategory != null" >
  325. data_category = #{dataCategory,jdbcType=INTEGER},
  326. </if>
  327. <if test="name != null" >
  328. name = #{name,jdbcType=VARCHAR},
  329. </if>
  330. <if test="keyword != null" >
  331. keyword = #{keyword,jdbcType=VARCHAR},
  332. </if>
  333. <if test="infoSources != null" >
  334. info_sources = #{infoSources,jdbcType=INTEGER},
  335. </if>
  336. <if test="industryCategoryA != null" >
  337. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  338. </if>
  339. <if test="industryCategoryB != null" >
  340. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  341. </if>
  342. <if test="industryCategoryC != null" >
  343. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  344. </if>
  345. <if test="demandType != null" >
  346. demand_type = #{demandType,jdbcType=INTEGER},
  347. </if>
  348. <if test="problemDes != null" >
  349. problem_des = #{problemDes,jdbcType=VARCHAR},
  350. </if>
  351. <if test="technicalRequirements != null" >
  352. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  353. </if>
  354. <if test="pictureUrl != null" >
  355. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  356. </if>
  357. <if test="textFileUrl != null" >
  358. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  359. </if>
  360. <if test="videoUrl != null" >
  361. video_url = #{videoUrl,jdbcType=VARCHAR},
  362. </if>
  363. <if test="fixedBudget != null" >
  364. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  365. </if>
  366. <if test="fixedCycle != null" >
  367. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  368. </if>
  369. <if test="peopleNumber != null" >
  370. people_number = #{peopleNumber,jdbcType=INTEGER},
  371. </if>
  372. <if test="fixedScheme != null" >
  373. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  374. </if>
  375. <if test="costEscrow != null" >
  376. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  377. </if>
  378. <if test="budgetCost != null" >
  379. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  380. </if>
  381. <if test="validityPeriod != null" >
  382. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  383. </if>
  384. <if test="employerId != null" >
  385. employer_id = #{employerId,jdbcType=VARCHAR},
  386. </if>
  387. <if test="employerName != null" >
  388. employer_name = #{employerName,jdbcType=VARCHAR},
  389. </if>
  390. <if test="employerAddress != null" >
  391. employer_address = #{employerAddress,jdbcType=VARCHAR},
  392. </if>
  393. <if test="employerContacts != null" >
  394. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  395. </if>
  396. <if test="employerContactsMobile != null" >
  397. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  398. </if>
  399. <if test="employerContactsMailbox != null" >
  400. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  401. </if>
  402. <if test="contacts != null" >
  403. contacts = #{contacts,jdbcType=INTEGER},
  404. </if>
  405. <if test="status != null" >
  406. status = #{status,jdbcType=INTEGER},
  407. </if>
  408. <if test="releaseStatus != null" >
  409. release_status = #{releaseStatus,jdbcType=INTEGER},
  410. </if>
  411. <if test="releaseDate != null" >
  412. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  413. </if>
  414. <if test="createTime != null" >
  415. create_time = #{createTime,jdbcType=TIMESTAMP},
  416. </if>
  417. <if test="principalId != null" >
  418. principal_id = #{principalId,jdbcType=VARCHAR},
  419. </if>
  420. <if test="deletedSign != null" >
  421. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  422. </if>
  423. <if test="auditStatus != null" >
  424. audit_status = #{auditStatus,jdbcType=INTEGER},
  425. </if>
  426. <if test="techBrokerId != null" >
  427. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  428. </if>
  429. </set>
  430. where id = #{id,jdbcType=VARCHAR}
  431. </update>
  432. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
  433. update demand
  434. set serial_number = #{serialNumber,jdbcType=INTEGER},
  435. data_category = #{dataCategory,jdbcType=INTEGER},
  436. name = #{name,jdbcType=VARCHAR},
  437. keyword = #{keyword,jdbcType=VARCHAR},
  438. info_sources = #{infoSources,jdbcType=INTEGER},
  439. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  440. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  441. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  442. demand_type = #{demandType,jdbcType=INTEGER},
  443. problem_des = #{problemDes,jdbcType=VARCHAR},
  444. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  445. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  446. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  447. video_url = #{videoUrl,jdbcType=VARCHAR},
  448. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  449. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  450. people_number = #{peopleNumber,jdbcType=INTEGER},
  451. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  452. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  453. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  454. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  455. employer_id = #{employerId,jdbcType=VARCHAR},
  456. employer_name = #{employerName,jdbcType=VARCHAR},
  457. employer_address = #{employerAddress,jdbcType=VARCHAR},
  458. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  459. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  460. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  461. contacts = #{contacts,jdbcType=INTEGER},
  462. status = #{status,jdbcType=INTEGER},
  463. release_status = #{releaseStatus,jdbcType=INTEGER},
  464. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  465. create_time = #{createTime,jdbcType=TIMESTAMP},
  466. principal_id = #{principalId,jdbcType=VARCHAR},
  467. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  468. audit_status = #{auditStatus,jdbcType=INTEGER},
  469. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  470. where id = #{id,jdbcType=VARCHAR}
  471. </update>
  472. <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  473. select
  474. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  475. d.name, d.keyword, d.info_sources as infoSources,
  476. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  477. d.employer_name as employerName, ui.province, d.status,
  478. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,
  479. d.employer_id as employerId, d.audit_status as auditStatus
  480. from demand d
  481. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  482. LEFT JOIN admin a on a.id = d.tech_broker_id
  483. <if test="adminId != null">
  484. LEFT JOIN user u on d.employer_id = u.id
  485. </if>
  486. where d.deleted_sign = 0 and d.data_category = 0
  487. <if test="adminId != null">
  488. and (u.mid = #{adminId,jdbcType=VARCHAR}
  489. </if>
  490. <if test="adminId != null">
  491. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  492. </if>
  493. <if test="adminId != null">
  494. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  495. )
  496. </if>
  497. <if test="province != null">
  498. and ui.province = #{province,jdbcType=INTEGER}
  499. </if>
  500. <if test="auditStatus != null">
  501. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  502. </if>
  503. <if test="serialNumber != null">
  504. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  505. </if>
  506. <if test="name != null">
  507. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  508. </if>
  509. <if test="keyword != null">
  510. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  511. </if>
  512. <if test="username != null">
  513. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  514. </if>
  515. <if test="employerName != null">
  516. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  517. </if>
  518. <if test="infoSources != null">
  519. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  520. </if>
  521. <if test="demandType != null">
  522. and d.demand_type = #{demandType,jdbcType=INTEGER}
  523. </if>
  524. <if test="status != null">
  525. and d.status = #{status,jdbcType=VARCHAR}
  526. </if>
  527. <if test="releaseStatus != null">
  528. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  529. </if>
  530. <if test="vStart != null">
  531. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  532. </if>
  533. <if test="vEnd != null">
  534. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  535. </if>
  536. <if test="rStart != null">
  537. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  538. </if>
  539. <if test="rEnd != null">
  540. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  541. </if>
  542. order by d.serial_number desc
  543. <if test="page_sql!=null">
  544. ${page_sql}
  545. </if>
  546. </select>
  547. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  548. select
  549. count(1)
  550. from demand d
  551. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  552. LEFT JOIN admin a on a.id = d.tech_broker_id
  553. <if test="adminId != null">
  554. LEFT JOIN user u on d.employer_id = u.id
  555. </if>
  556. where d.deleted_sign = 0 and d.data_category = 0
  557. <if test="adminId != null">
  558. and (u.mid = #{adminId,jdbcType=VARCHAR}
  559. </if>
  560. <if test="adminId != null">
  561. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  562. </if>
  563. <if test="adminId != null">
  564. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  565. )
  566. </if>
  567. <if test="serialNumber != null">
  568. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  569. </if>
  570. <if test="province != null">
  571. and ui.province = #{province,jdbcType=INTEGER}
  572. </if>
  573. <if test="auditStatus != null">
  574. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  575. </if>
  576. <if test="name != null">
  577. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  578. </if>
  579. <if test="keyword != null">
  580. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  581. </if>
  582. <if test="username != null">
  583. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  584. </if>
  585. <if test="employerName != null">
  586. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  587. </if>
  588. <if test="infoSources != null">
  589. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  590. </if>
  591. <if test="demandType != null">
  592. and d.demand_type = #{demandType,jdbcType=INTEGER}
  593. </if>
  594. <if test="status != null">
  595. and d.status = #{status,jdbcType=INTEGER}
  596. </if>
  597. <if test="releaseStatus != null">
  598. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  599. </if>
  600. <if test="vStart != null">
  601. and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  602. </if>
  603. <if test="vEnd != null">
  604. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  605. </if>
  606. <if test="rStart != null">
  607. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  608. </if>
  609. <if test="rEnd != null">
  610. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  611. </if>
  612. </select>
  613. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  614. select
  615. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  616. d.name, d.keyword, d.info_sources as infoSources,
  617. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  618. d.employer_name as employerName, oi.licence_province as province, d.status,
  619. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,
  620. d.employer_id as employerId, d.audit_status as auditStatus,
  621. d.tech_broker_id as techBrokerId
  622. from demand d
  623. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  624. LEFT JOIN admin a on a.id = d.tech_broker_id
  625. <if test="adminId != null">
  626. LEFT JOIN user u on d.employer_id = u.id
  627. </if>
  628. where d.deleted_sign = 0 and d.data_category = 1
  629. <if test="adminId != null">
  630. and (u.mid = #{adminId,jdbcType=VARCHAR}
  631. </if>
  632. <if test="adminId != null">
  633. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  634. </if>
  635. <if test="adminId != null">
  636. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  637. )
  638. </if>
  639. <if test="province != null">
  640. and oi.licence_province = #{province,jdbcType=INTEGER}
  641. </if>
  642. <if test="serialNumber != null">
  643. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  644. </if>
  645. <if test="auditStatus != null">
  646. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  647. </if>
  648. <if test="name != null">
  649. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  650. </if>
  651. <if test="keyword != null">
  652. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  653. </if>
  654. <if test="unitName != null">
  655. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  656. </if>
  657. <if test="employerName != null">
  658. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  659. </if>
  660. <if test="infoSources != null">
  661. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  662. </if>
  663. <if test="demandType != null">
  664. and d.demand_type = #{demandType,jdbcType=INTEGER}
  665. </if>
  666. <if test="status != null">
  667. and d.status = #{status,jdbcType=INTEGER}
  668. </if>
  669. <if test="releaseStatus != null">
  670. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  671. </if>
  672. <if test="vStart != null">
  673. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  674. </if>
  675. <if test="vEnd != null">
  676. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  677. </if>
  678. <if test="rStart != null">
  679. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  680. </if>
  681. <if test="rEnd != null">
  682. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  683. </if>
  684. order by d.serial_number desc
  685. <if test="page_sql!=null">
  686. ${page_sql}
  687. </if>
  688. </select>
  689. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  690. select
  691. count(1)
  692. from demand d
  693. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  694. LEFT JOIN admin a on a.id = d.tech_broker_id
  695. <if test="adminId != null">
  696. LEFT JOIN user u on d.employer_id = u.id
  697. </if>
  698. where d.deleted_sign = 0 and d.data_category = 1
  699. <if test="adminId != null">
  700. and (u.mid = #{adminId,jdbcType=VARCHAR}
  701. </if>
  702. <if test="adminId != null">
  703. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  704. </if>
  705. <if test="adminId != null">
  706. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  707. )
  708. </if>
  709. <if test="serialNumber != null">
  710. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  711. </if>
  712. <if test="auditStatus != null">
  713. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  714. </if>
  715. <if test="province != null">
  716. and oi.licence_province = #{province,jdbcType=INTEGER}
  717. </if>
  718. <if test="name != null">
  719. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  720. </if>
  721. <if test="keyword != null">
  722. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  723. </if>
  724. <if test="unitName != null">
  725. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  726. </if>
  727. <if test="employerName != null">
  728. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  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=VARCHAR}
  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. </select>
  755. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  756. select
  757. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  758. d.name, d.keyword, d.info_sources as infoSources,
  759. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  760. ui.province, d.status, d.release_status as releaseStatus,
  761. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  762. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  763. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  764. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  765. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  766. info.postal_address as address, u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
  767. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  768. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName
  769. from demand d
  770. left join user_identity ui on ui.uid = d.employer_id
  771. left join user_info info on info.uid = d.employer_id
  772. left join user u on u.id = d.employer_id
  773. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  774. </select>
  775. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  776. select
  777. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  778. d.name, d.keyword, d.info_sources as infoSources,
  779. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  780. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  781. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  782. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  783. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  784. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  785. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  786. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  787. d.tech_broker_id as techBrokerId,
  788. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  789. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName
  790. from demand d
  791. left join organization_identity oi on oi.uid = d.employer_id
  792. left join user u on u.id = d.employer_id
  793. where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
  794. </select>
  795. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  796. update demand set deleted_sign = 1
  797. where id in
  798. <foreach item="item" collection="list" open="(" separator="," close=")">
  799. #{item}
  800. </foreach>
  801. </update>
  802. <update id="updateReleaseDate" parameterType="java.lang.String">
  803. update demand set release_date = null
  804. where id = #{id,jdbcType=VARCHAR}
  805. </update>
  806. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  807. select
  808. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  809. d.name, d.keyword, d.demand_type as demandType,
  810. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  811. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  812. from demand d
  813. where d.deleted_sign = 0
  814. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  815. <if test="serialNumber != null">
  816. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  817. </if>
  818. <if test="auditStatus != null">
  819. and d.audit_status = #{auditStatus,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="demandType != null">
  828. and d.demand_type = #{demandType,jdbcType=INTEGER}
  829. </if>
  830. <if test="status != null">
  831. and d.status = #{status,jdbcType=VARCHAR}
  832. </if>
  833. <if test="releaseStatus != null">
  834. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  835. </if>
  836. <if test="vStart != null">
  837. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  838. </if>
  839. <if test="vEnd != null">
  840. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  841. </if>
  842. <if test="rStart != null">
  843. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  844. </if>
  845. <if test="rEnd != null">
  846. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  847. </if>
  848. order by d.serial_number desc
  849. <if test="page_sql!=null">
  850. ${page_sql}
  851. </if>
  852. </select>
  853. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  854. select count(1)
  855. from demand d
  856. where d.deleted_sign = 0
  857. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  858. <if test="serialNumber != null">
  859. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  860. </if>
  861. <if test="auditStatus != null">
  862. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  863. </if>
  864. <if test="name != null">
  865. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  866. </if>
  867. <if test="keyword != null">
  868. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  869. </if>
  870. <if test="demandType != null">
  871. and d.demand_type = #{demandType,jdbcType=INTEGER}
  872. </if>
  873. <if test="status != null">
  874. and d.status = #{status,jdbcType=VARCHAR}
  875. </if>
  876. <if test="releaseStatus != null">
  877. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  878. </if>
  879. <if test="vStart != null">
  880. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  881. </if>
  882. <if test="vEnd != null">
  883. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  884. </if>
  885. <if test="rStart != null">
  886. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  887. </if>
  888. <if test="rEnd != null">
  889. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  890. </if>
  891. </select>
  892. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  893. insert into demand
  894. (id, deleted_sign, audit_status,
  895. status, release_status, create_time,
  896. keyword, data_category, name,
  897. demand_type, problem_des, employer_name,
  898. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources)
  899. values
  900. <foreach item="item" index="index" collection="list" separator=",">
  901. (
  902. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  903. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  904. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  905. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  906. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  907. #{item.infoSources,jdbcType=INTEGER}
  908. )
  909. </foreach>
  910. </insert>
  911. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  912. select
  913. d.id, d.name, d.keyword,
  914. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  915. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  916. d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,
  917. u.lvl as level
  918. from demand d
  919. left join user u on u.id = d.employer_id
  920. where d.deleted_sign = 0 and d.status = 0
  921. <if test="keyword != null">
  922. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  923. </if>
  924. <if test="industryCategoryA != null">
  925. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  926. </if>
  927. <if test="industryCategoryB != null">
  928. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  929. </if>
  930. <if test="budgetCostLower != null">
  931. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  932. </if>
  933. <if test="budgetCostUpper != null">
  934. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  935. </if>
  936. <if test="demandType != null">
  937. and d.demand_type = #{demandType,jdbcType=INTEGER}
  938. </if>
  939. <if test="sign == 1">
  940. and d.budget_cost is null
  941. </if>
  942. and d.deleted_sign = 0
  943. and d.release_status = 1
  944. and d.audit_status = 3
  945. order by d.release_date desc
  946. <if test="page_sql!=null">
  947. ${page_sql}
  948. </if>
  949. </select>
  950. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  951. select
  952. count(1)
  953. from demand d
  954. where d.deleted_sign = 0 and d.status = 0
  955. <if test="keyword != null">
  956. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  957. </if>
  958. <if test="industryCategoryA != null">
  959. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  960. </if>
  961. <if test="industryCategoryB != null">
  962. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  963. </if>
  964. <if test="budgetCostLower != null">
  965. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  966. </if>
  967. <if test="budgetCostUpper != null">
  968. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  969. </if>
  970. <if test="demandType != null">
  971. and d.demand_type = #{demandType,jdbcType=INTEGER}
  972. </if>
  973. <if test="sign == 1">
  974. and d.budget_cost is null
  975. </if>
  976. and d.deleted_sign = 0
  977. and d.release_status = 1
  978. and d.audit_status = 3
  979. </select>
  980. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  981. select
  982. d.id,
  983. d.employer_name as employerName,
  984. d.serial_number as serialNumber,
  985. d.keyword,
  986. d.data_category as dataCategory,
  987. d.name,
  988. d.industry_category_a as industryCategoryA,
  989. d.industry_category_b as industryCategoryB,
  990. d.demand_type as demandType,
  991. d.budget_cost as budgetCost,
  992. d.problem_des as problemDes,
  993. d.release_date as releaseDate,
  994. d.technical_requirements as technicalRequirements,
  995. d.picture_url as pictureUrl,
  996. d.text_file_url as textFileUrl,
  997. d.video_url as videoUrl,
  998. d.fixed_cycle as fixedCycle,
  999. d.people_number as peopleNumber,
  1000. d.fixed_scheme as fixedScheme,
  1001. d.cost_escrow as costEscrow,
  1002. d.validity_period as validityPeriod,
  1003. ui.username,
  1004. oi.unit_name as unitName,
  1005. di.id as demandInterestId,
  1006. do.id as demandOrderId,
  1007. do.status as orderStatus
  1008. from demand d
  1009. left join user_identity ui on ui.uid = d.employer_id
  1010. left join organization_identity oi on oi.uid = d.employer_id
  1011. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1012. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1013. where d.id = #{1}
  1014. </select>
  1015. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1016. select
  1017. count(1)
  1018. from demand
  1019. where
  1020. deleted_sign = 0
  1021. and release_status = 1
  1022. and audit_status = 3
  1023. and employer_id = #{uid,jdbcType=VARCHAR}
  1024. </select>
  1025. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1026. SELECT
  1027. id,
  1028. serial_number AS serialNumber,
  1029. data_category AS dataCategory,
  1030. NAME,
  1031. keyword,
  1032. release_date AS releaseDate,
  1033. demand_type AS demandType,
  1034. validity_period AS validityPeriod,
  1035. problem_des as problemDes,
  1036. industry_category_a as industryCategoryA,
  1037. industry_category_b as industryCategoryB,
  1038. budget_cost as budgetCost
  1039. FROM
  1040. demand
  1041. WHERE
  1042. audit_status = 3
  1043. AND release_status = 1
  1044. AND deleted_sign = 0
  1045. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1046. </select>
  1047. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1048. SELECT
  1049. count(1)
  1050. FROM
  1051. demand
  1052. WHERE
  1053. audit_status = 3
  1054. AND release_status = 1
  1055. AND deleted_sign = 0
  1056. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1057. </select>
  1058. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1059. SELECT
  1060. d.id,
  1061. d.name,
  1062. d.keyword,
  1063. d.industry_category_a AS industryCategoryA,
  1064. fg.name AS industryCategoryAS,
  1065. fgg.name AS industryCategorBS,
  1066. d.budget_cost AS budgetCost,
  1067. d.problem_des AS problemDes,
  1068. dg.name AS province,
  1069. dgg.name AS city,
  1070. interest.id as interestId,
  1071. d.employer_name as employerName,
  1072. u.lvl as level
  1073. FROM
  1074. demand d
  1075. LEFT JOIN <![CDATA[ user ]]> u on u.id = d.employer_id
  1076. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1077. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1078. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1079. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1080. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1081. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1082. WHERE
  1083. d.id = #{id,jdbcType=VARCHAR}
  1084. </select>
  1085. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1086. SELECT
  1087. d.id,
  1088. d.name,
  1089. d.keyword,
  1090. d.industry_category_a AS industryCategoryA,
  1091. fg.name AS industryCategoryB,
  1092. fgg.name AS industryCategoryC,
  1093. d.budget_cost AS budgetCost,
  1094. d.problem_des AS problemDes,
  1095. dg.name AS province,
  1096. dgg.name AS city,
  1097. interest.id as interestId,
  1098. d.employer_name as employerName,
  1099. u.lvl as level
  1100. FROM
  1101. demand d
  1102. LEFT JOIN <![CDATA[ user ]]> u on u.id = d.employer_id
  1103. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1104. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1105. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1106. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1107. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1108. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1109. WHERE
  1110. d.id = #{id,jdbcType=VARCHAR}
  1111. </select>
  1112. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1113. select
  1114. d.id,
  1115. d.name,
  1116. fg.name as industryCategoryAS,
  1117. fgg.name as industryCategoryBS,
  1118. d.problem_des as problemDes,
  1119. d.budget_cost as budgetCost,
  1120. u.lvl as level
  1121. from
  1122. demand d
  1123. left join user u on u.id = d.employer_id
  1124. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1125. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1126. where
  1127. d.audit_status = 3
  1128. and d.release_status = 1
  1129. and d.deleted_sign = 0
  1130. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1131. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1132. order by d.serial_number desc
  1133. limit 5
  1134. </select>
  1135. <update id="updateEmployerId" parameterType="java.lang.String" >
  1136. update demand set employer_id = null
  1137. where id = #{id,jdbcType=VARCHAR}
  1138. </update>
  1139. </mapper>