DemandMapper.xml 50 KB

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