DemandMapper.xml 52 KB

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