DemandMapper.xml 48 KB

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