DemandMapper.xml 46 KB

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