DemandMapper.xml 45 KB

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