DemandMapper.xml 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  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="mid != 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="mid != null">
  488. and u.mid = #{mid,jdbcType=VARCHAR}
  489. </if>
  490. <if test="principal != null">
  491. and d.principal_id = #{principal,jdbcType=VARCHAR}
  492. </if>
  493. <if test="techBroker != null">
  494. and d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
  495. </if>
  496. <if test="province != null">
  497. and ui.province = #{province,jdbcType=INTEGER}
  498. </if>
  499. <if test="auditStatus != null">
  500. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  501. </if>
  502. <if test="serialNumber != null">
  503. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  504. </if>
  505. <if test="name != null">
  506. and d.name = #{name,jdbcType=VARCHAR}
  507. </if>
  508. <if test="keyword != null">
  509. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  510. </if>
  511. <if test="username != null">
  512. and ui.username = #{username,jdbcType=VARCHAR}
  513. </if>
  514. <if test="infoSources != null">
  515. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  516. </if>
  517. <if test="demandType != null">
  518. and d.demand_type = #{demandType,jdbcType=INTEGER}
  519. </if>
  520. <if test="status != null">
  521. and d.status = #{status,jdbcType=VARCHAR}
  522. </if>
  523. <if test="releaseStatus != null">
  524. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  525. </if>
  526. <if test="vStart != null">
  527. and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  528. </if>
  529. <if test="vEnd != null">
  530. and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  531. </if>
  532. <if test="rStart != null">
  533. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  534. </if>
  535. <if test="rEnd != null">
  536. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  537. </if>
  538. order by d.serial_number desc
  539. <if test="page_sql!=null">
  540. ${page_sql}
  541. </if>
  542. </select>
  543. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  544. select
  545. count(1)
  546. from demand d
  547. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  548. LEFT JOIN admin a on a.id = d.tech_broker_id
  549. <if test="mid != null">
  550. LEFT JOIN user u on d.employer_id = u.id
  551. </if>
  552. where d.deleted_sign = 0 and d.data_category = 0
  553. <if test="mid != null">
  554. and u.mid = #{mid,jdbcType=VARCHAR}
  555. </if>
  556. <if test="principal != null">
  557. and d.principal_id = #{principal,jdbcType=VARCHAR}
  558. </if>
  559. <if test="techBroker != null">
  560. and d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
  561. </if>
  562. <if test="serialNumber != null">
  563. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  564. </if>
  565. <if test="province != null">
  566. and ui.province = #{province,jdbcType=INTEGER}
  567. </if>
  568. <if test="auditStatus != null">
  569. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  570. </if>
  571. <if test="name != null">
  572. and d.name = #{name,jdbcType=VARCHAR}
  573. </if>
  574. <if test="keyword != null">
  575. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  576. </if>
  577. <if test="username != null">
  578. and ui.username = #{username,jdbcType=VARCHAR}
  579. </if>
  580. <if test="infoSources != null">
  581. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  582. </if>
  583. <if test="demandType != null">
  584. and d.demand_type = #{demandType,jdbcType=INTEGER}
  585. </if>
  586. <if test="status != null">
  587. and d.status = #{status,jdbcType=INTEGER}
  588. </if>
  589. <if test="releaseStatus != null">
  590. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  591. </if>
  592. <if test="vStart != null">
  593. and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  594. </if>
  595. <if test="vEnd != null">
  596. and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  597. </if>
  598. <if test="rStart != null">
  599. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  600. </if>
  601. <if test="rEnd != null">
  602. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  603. </if>
  604. </select>
  605. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  606. select
  607. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  608. d.name, d.keyword, d.info_sources as infoSources,
  609. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  610. d.employer_name as employerName, oi.licence_province as province, d.status,
  611. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,
  612. d.employer_id as employerId, d.audit_status as auditStatus,
  613. d.tech_broker_id as techBrokerId
  614. from demand d
  615. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  616. LEFT JOIN admin a on a.id = d.tech_broker_id
  617. <if test="mid != null">
  618. LEFT JOIN user u on d.employer_id = u.id
  619. </if>
  620. where d.deleted_sign = 0 and d.data_category = 1
  621. <if test="mid != null">
  622. and u.mid = #{mid,jdbcType=VARCHAR}
  623. </if>
  624. <if test="principal != null">
  625. and d.principal_id = #{principal,jdbcType=VARCHAR}
  626. </if>
  627. <if test="techBroker != null">
  628. and d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
  629. </if>
  630. <if test="province != null">
  631. and oi.licence_province = #{province,jdbcType=INTEGER}
  632. </if>
  633. <if test="serialNumber != null">
  634. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  635. </if>
  636. <if test="auditStatus != null">
  637. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  638. </if>
  639. <if test="name != null">
  640. and d.name = #{name,jdbcType=VARCHAR}
  641. </if>
  642. <if test="keyword != null">
  643. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  644. </if>
  645. <if test="username != null">
  646. and oi.unit_name = #{username,jdbcType=VARCHAR}
  647. </if>
  648. <if test="infoSources != null">
  649. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  650. </if>
  651. <if test="demandType != null">
  652. and d.demand_type = #{demandType,jdbcType=INTEGER}
  653. </if>
  654. <if test="status != null">
  655. and d.status = #{status,jdbcType=INTEGER}
  656. </if>
  657. <if test="releaseStatus != null">
  658. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  659. </if>
  660. <if test="vStart != null">
  661. and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  662. </if>
  663. <if test="vEnd != null">
  664. and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  665. </if>
  666. <if test="rStart != null">
  667. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  668. </if>
  669. <if test="rEnd != null">
  670. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  671. </if>
  672. order by d.serial_number desc
  673. <if test="page_sql!=null">
  674. ${page_sql}
  675. </if>
  676. </select>
  677. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  678. select
  679. count(1)
  680. from demand d
  681. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  682. LEFT JOIN admin a on a.id = d.tech_broker_id
  683. <if test="mid != null">
  684. LEFT JOIN user u on d.employer_id = u.id
  685. </if>
  686. where d.deleted_sign = 0 and d.data_category = 1
  687. <if test="mid != null">
  688. and u.mid = #{mid,jdbcType=VARCHAR}
  689. </if>
  690. <if test="principal != null">
  691. and d.principal_id = #{principal,jdbcType=VARCHAR}
  692. </if>
  693. <if test="techBroker != null">
  694. and d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
  695. </if>
  696. <if test="serialNumber != null">
  697. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  698. </if>
  699. <if test="auditStatus != null">
  700. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  701. </if>
  702. <if test="province != null">
  703. and oi.licence_province = #{province,jdbcType=INTEGER}
  704. </if>
  705. <if test="name != null">
  706. and d.name = #{name,jdbcType=VARCHAR}
  707. </if>
  708. <if test="keyword != null">
  709. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  710. </if>
  711. <if test="username != null">
  712. and oi.unit_name = #{username,jdbcType=VARCHAR}
  713. </if>
  714. <if test="infoSources != null">
  715. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  716. </if>
  717. <if test="demandType != null">
  718. and d.demand_type = #{demandType,jdbcType=INTEGER}
  719. </if>
  720. <if test="status != null">
  721. and d.status = #{status,jdbcType=VARCHAR}
  722. </if>
  723. <if test="releaseStatus != null">
  724. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  725. </if>
  726. <if test="vStart != null">
  727. and d.validity_veriod <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  728. </if>
  729. <if test="vEnd != null">
  730. and d.validity_veriod <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  731. </if>
  732. <if test="rStart != null">
  733. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  734. </if>
  735. <if test="rEnd != null">
  736. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  737. </if>
  738. </select>
  739. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  740. select
  741. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  742. d.name, d.keyword, d.info_sources as infoSources,
  743. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  744. ui.province, d.status, d.release_status as releaseStatus,
  745. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  746. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  747. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  748. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  749. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  750. info.postal_address as address, u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus
  751. from demand d
  752. left join user_identity ui on ui.uid = d.employer_id
  753. left join user_info info on info.uid = d.employer_id
  754. left join user u on u.id = d.employer_id
  755. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  756. </select>
  757. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  758. select
  759. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  760. d.name, d.keyword, d.info_sources as infoSources,
  761. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  762. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  763. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  764. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  765. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  766. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  767. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  768. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  769. d.tech_broker_id as techBrokerId
  770. from demand d
  771. left join organization_identity oi on oi.uid = d.employer_id
  772. left join user u on u.id = d.employer_id
  773. where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
  774. </select>
  775. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  776. update demand set deleted_sign = 1
  777. where id in
  778. <foreach item="item" collection="list" open="(" separator="," close=")">
  779. #{item}
  780. </foreach>
  781. </update>
  782. <update id="updateReleaseDate" parameterType="java.lang.String">
  783. update demand set release_date = null
  784. where id = #{id,jdbcType=VARCHAR}
  785. </update>
  786. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  787. select
  788. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  789. d.name, d.keyword, d.demand_type as demandType,
  790. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  791. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  792. from demand d
  793. where d.deleted_sign = 0
  794. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  795. <if test="serialNumber != null">
  796. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  797. </if>
  798. <if test="auditStatus != null">
  799. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  800. </if>
  801. <if test="name != null">
  802. and d.name = #{name,jdbcType=VARCHAR}
  803. </if>
  804. <if test="keyword != null">
  805. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  806. </if>
  807. <if test="demandType != null">
  808. and d.demand_type = #{demandType,jdbcType=INTEGER}
  809. </if>
  810. <if test="status != null">
  811. and d.status = #{status,jdbcType=VARCHAR}
  812. </if>
  813. <if test="releaseStatus != null">
  814. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  815. </if>
  816. <if test="vStart != null">
  817. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  818. </if>
  819. <if test="vEnd != null">
  820. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  821. </if>
  822. <if test="rStart != null">
  823. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  824. </if>
  825. <if test="rEnd != null">
  826. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  827. </if>
  828. order by d.serial_number desc
  829. <if test="page_sql!=null">
  830. ${page_sql}
  831. </if>
  832. </select>
  833. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  834. select count(1)
  835. from demand d
  836. where d.deleted_sign = 0
  837. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  838. <if test="serialNumber != null">
  839. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  840. </if>
  841. <if test="auditStatus != null">
  842. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  843. </if>
  844. <if test="name != null">
  845. and d.name = #{name,jdbcType=VARCHAR}
  846. </if>
  847. <if test="keyword != null">
  848. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  849. </if>
  850. <if test="demandType != null">
  851. and d.demand_type = #{demandType,jdbcType=INTEGER}
  852. </if>
  853. <if test="status != null">
  854. and d.status = #{status,jdbcType=VARCHAR}
  855. </if>
  856. <if test="releaseStatus != null">
  857. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  858. </if>
  859. <if test="vStart != null">
  860. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  861. </if>
  862. <if test="vEnd != null">
  863. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  864. </if>
  865. <if test="rStart != null">
  866. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  867. </if>
  868. <if test="rEnd != null">
  869. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  870. </if>
  871. </select>
  872. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  873. insert into demand
  874. (id, deleted_sign, audit_status,
  875. status, release_status, create_time,
  876. keyword, data_category, name,
  877. demand_type, problem_des, employer_name,
  878. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources)
  879. values
  880. <foreach item="item" index="index" collection="list" separator=",">
  881. (
  882. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  883. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  884. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  885. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  886. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  887. #{item.infoSources,jdbcType=INTEGER}
  888. )
  889. </foreach>
  890. </insert>
  891. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  892. select
  893. d.id, d.name, d.keyword,
  894. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  895. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  896. d.problem_des as problemDes, d.release_date as releaseDate, ui.username,
  897. oi.unit_name as unitName, u.lvl as level
  898. from demand d
  899. left join user_identity ui on d.employer_id = ui.uid
  900. left join organization_identity oi on d.employer_id = oi.uid
  901. left join user u on u.id = d.employer_id
  902. where d.deleted_sign = 0 and d.status = 0
  903. <if test="keyword != null">
  904. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  905. </if>
  906. <if test="industryCategoryA != null">
  907. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  908. </if>
  909. <if test="industryCategoryB != null">
  910. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  911. </if>
  912. <if test="budgetCostLower != null">
  913. and d.budget_cost <![CDATA[ > ]]>= #{budgetCostLower,jdbcType=DECIMAL}
  914. </if>
  915. <if test="budgetCostUpper != null">
  916. and d.budget_cost <![CDATA[ < ]]>= #{budgetCostUpper,jdbcType=DECIMAL}}
  917. </if>
  918. <if test="demandType != null">
  919. and d.demand_type = #{demandType,jdbcType=INTEGER}
  920. </if>
  921. and d.deleted_sign = 0
  922. and d.release_status = 1
  923. and d.audit_status = 3
  924. order by d.release_date desc
  925. <if test="page_sql!=null">
  926. ${page_sql}
  927. </if>
  928. </select>
  929. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  930. select
  931. count(1)
  932. from demand d
  933. where d.deleted_sign = 0 and d.status = 0
  934. <if test="keyword != null">
  935. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  936. </if>
  937. <if test="industryCategoryA != null">
  938. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  939. </if>
  940. <if test="industryCategoryB != null">
  941. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  942. </if>
  943. <if test="budgetCostLower != null">
  944. and d.budget_cost <![CDATA[ > ]]>= #{budgetCostLower,jdbcType=DECIMAL}
  945. </if>
  946. <if test="budgetCostUpper != null">
  947. and d.budget_cost <![CDATA[ < ]]>= #{budgetCostUpper,jdbcType=DECIMAL}}
  948. </if>
  949. <if test="demandType != null">
  950. and d.demand_type = #{demandType,jdbcType=INTEGER}
  951. </if>
  952. and d.deleted_sign = 0
  953. and d.release_status = 1
  954. and d.audit_status = 3
  955. </select>
  956. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  957. select
  958. d.id, d.serial_number as serialNumber, d.keyword,
  959. d.data_category as dataCategory, d.name, d.industry_category_a as industryCategoryA,
  960. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  961. d.problem_des as problemDes, d.release_date as releaseDate, d.technical_requirements as technicalRequirements,
  962. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  963. d.fixed_cycle as fixedCycle, d.people_number as peopleNumber, d.fixed_scheme as fixedScheme,
  964. d.cost_escrow as costEscrow, d.validity_period as validityPeriod, ui.username,
  965. oi.unit_name as unitName, di.id as demandInterestId, do.id as demandOrderId,
  966. do.status as orderStatus
  967. from demand d
  968. left join user_identity ui on ui.uid = d.employer_id
  969. left join organization_identity oi on oi.uid = d.employer_id
  970. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  971. left join demand_order do on do.demand_id = d.id and do.uid = #{0}
  972. where d.id = #{1}
  973. </select>
  974. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  975. select
  976. count(1)
  977. from demand
  978. where
  979. deleted_sign = 0
  980. and release_status = 1
  981. and audit_status = 3
  982. and employer_id = #{uid,jdbcType=VARCHAR}
  983. </select>
  984. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  985. SELECT
  986. id,
  987. serial_number AS serialNumber,
  988. data_category AS dataCategory,
  989. NAME,
  990. keyword,
  991. release_date AS releaseDate,
  992. demand_type AS demandType,
  993. validity_period AS validityPeriod
  994. FROM
  995. demand
  996. WHERE
  997. audit_status = 3
  998. AND release_status = 1
  999. AND deleted_sign = 0
  1000. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1001. </select>
  1002. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1003. SELECT
  1004. count(1)
  1005. FROM
  1006. demand
  1007. WHERE
  1008. audit_status = 3
  1009. AND release_status = 1
  1010. AND deleted_sign = 0
  1011. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1012. </select>
  1013. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1014. SELECT
  1015. d.id,
  1016. d.name,
  1017. d.keyword,
  1018. d.industry_category_a AS industryCategoryA,
  1019. fg.name AS industryCategoryAS,
  1020. fgg.name AS industryCategorBS,
  1021. d.budget_cost AS budgetCost,
  1022. d.problem_des AS problemDes,
  1023. dg.name AS province,
  1024. dgg.name AS city,
  1025. interest.id as interestId
  1026. FROM
  1027. demand d
  1028. LEFT JOIN user_identity ui ON d.employer_id = ui.uid
  1029. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1030. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1031. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1032. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1033. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1034. WHERE
  1035. d.id = #{id,jdbcType=VARCHAR}
  1036. </select>
  1037. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1038. SELECT
  1039. d.id,
  1040. d.name,
  1041. d.keyword,
  1042. d.industry_category_a AS industryCategoryA,
  1043. fg.name AS industryCategoryB,
  1044. fgg.name AS industryCategoryC,
  1045. d.budget_cost AS budgetCost,
  1046. d.problem_des AS problemDes,
  1047. dg.name AS province,
  1048. dgg.name AS city,
  1049. interest.id as interestId
  1050. FROM
  1051. demand d
  1052. LEFT JOIN organization_identity oi ON d.employer_id = oi.uid
  1053. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1054. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1055. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1056. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1057. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1058. WHERE
  1059. d.id = #{id,jdbcType=VARCHAR}
  1060. </select>
  1061. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1062. select
  1063. d.id,
  1064. d.name,
  1065. fg.name as industryCategoryAS,
  1066. fgg.name as industryCategoryBS,
  1067. d.problem_des as problemDes,
  1068. d.budget_cost as budgetCost,
  1069. u.lvl as level
  1070. from
  1071. demand d
  1072. left join user u on u.id = d.employer_id
  1073. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1074. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1075. where
  1076. d.audit_status = 3
  1077. and d.release_status = 1
  1078. and d.deleted_sign = 0
  1079. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1080. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1081. order by d.serial_number desc
  1082. limit 5
  1083. </select>
  1084. </mapper>