DemandMapper.xml 51 KB

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