DemandMapper.xml 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  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. 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},#{crowdCost,jdbcType=DECIMAL})
  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. <if test="crowdCost!=null">
  489. crowd_cost=#{crowdCost,jdbcType=DECIMAL}
  490. </if>
  491. <if test="isHot!=null">
  492. is_hot=#{isHot,jdbcType=INTEGER}
  493. </if>
  494. </set>
  495. where id = #{id,jdbcType=VARCHAR}
  496. </update>
  497. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
  498. update demand
  499. set serial_number = #{serialNumber,jdbcType=INTEGER},
  500. data_category = #{dataCategory,jdbcType=INTEGER},
  501. name = #{name,jdbcType=VARCHAR},
  502. keyword = #{keyword,jdbcType=VARCHAR},
  503. info_sources = #{infoSources,jdbcType=INTEGER},
  504. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  505. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  506. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  507. demand_type = #{demandType,jdbcType=INTEGER},
  508. problem_des = #{problemDes,jdbcType=VARCHAR},
  509. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  510. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  511. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  512. video_url = #{videoUrl,jdbcType=VARCHAR},
  513. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  514. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  515. people_number = #{peopleNumber,jdbcType=INTEGER},
  516. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  517. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  518. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  519. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  520. employer_id = #{employerId,jdbcType=VARCHAR},
  521. employer_name = #{employerName,jdbcType=VARCHAR},
  522. employer_address = #{employerAddress,jdbcType=VARCHAR},
  523. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  524. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  525. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  526. contacts = #{contacts,jdbcType=INTEGER},
  527. status = #{status,jdbcType=INTEGER},
  528. release_status = #{releaseStatus,jdbcType=INTEGER},
  529. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  530. create_time = #{createTime,jdbcType=TIMESTAMP},
  531. principal_id = #{principalId,jdbcType=VARCHAR},
  532. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  533. audit_status = #{auditStatus,jdbcType=INTEGER},
  534. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  535. boutique = #{boutique,jdbcType=INTEGER}
  536. where id = #{id,jdbcType=VARCHAR}
  537. </update>
  538. <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  539. select
  540. d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
  541. 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,
  542. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  543. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
  544. 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
  545. from demand d
  546. left join user_identity t on d.employer_id=t.uid
  547. left join field_glossory g on d.industry_category_a=g.id
  548. left join field_glossory g2 on d.industry_category_b=g2.id
  549. left join (select count(0) as countInterest ,demand_id from demand_interest
  550. group by demand_id) t on d.id=t.demand_id
  551. where d.deleted_sign = 0
  552. and d.audit_status=3
  553. <if test="employerId != null">
  554. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  555. </if>
  556. <if test="serialNumber != null">
  557. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  558. </if>
  559. <if test="auditStatus != null">
  560. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  561. </if>
  562. <if test="name != null">
  563. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  564. </if>
  565. <if test="keyword != null">
  566. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  567. </if>
  568. <if test="demandType != null">
  569. and d.demand_type = #{demandType,jdbcType=INTEGER}
  570. </if>
  571. <if test="industryCategoryA != null">
  572. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  573. </if>
  574. <if test="status != null">
  575. and d.status = #{status,jdbcType=VARCHAR}
  576. </if>
  577. <if test="releaseStatus != null">
  578. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  579. </if>
  580. <if test="vStart != null">
  581. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  582. </if>
  583. <if test="vEnd != null">
  584. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  585. </if>
  586. <if test="rStart != null">
  587. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  588. </if>
  589. <if test="rEnd != null">
  590. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  591. </if>
  592. order by d.boutique desc
  593. <if test="page_sql!=null">
  594. ${page_sql}
  595. </if>
  596. </select>
  597. <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
  598. select count(1)
  599. from demand d
  600. where d.deleted_sign = 0
  601. <if test="employerId != null">
  602. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  603. </if>
  604. <if test="serialNumber != null">
  605. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  606. </if>
  607. <if test="auditStatus != null">
  608. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  609. </if>
  610. <if test="industryCategoryA != null">
  611. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  612. </if>
  613. <if test="name != null">
  614. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  615. </if>
  616. <if test="keyword != null">
  617. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  618. </if>
  619. <if test="demandType != null">
  620. and d.demand_type = #{demandType,jdbcType=INTEGER}
  621. </if>
  622. <if test="status != null">
  623. and d.status = #{status,jdbcType=VARCHAR}
  624. </if>
  625. <if test="releaseStatus != null">
  626. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  627. </if>
  628. <if test="vStart != null">
  629. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  630. </if>
  631. <if test="vEnd != null">
  632. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  633. </if>
  634. <if test="rStart != null">
  635. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  636. </if>
  637. <if test="rEnd != null">
  638. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  639. </if>
  640. </select>
  641. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  642. update demand set deleted_sign = 1
  643. where id in
  644. <foreach item="item" collection="list" open="(" separator="," close=")">
  645. #{item}
  646. </foreach>
  647. </update>
  648. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  649. insert into demand
  650. (id, deleted_sign, audit_status,
  651. status, release_status, create_time,
  652. keyword, data_category, name,
  653. demand_type, problem_des, employer_name,
  654. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark,urgent_days ,urgent_money,is_hot)
  655. values
  656. <foreach item="item" index="index" collection="list" separator=",">
  657. (
  658. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  659. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  660. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  661. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  662. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  663. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR},,#{item.urgentDays,jdbcType=VARCHAR},#{item.urgentMoney,jdbcType=VARCHAR},#{isHot,jdbcType=INTEGER}
  664. )
  665. </foreach>
  666. </insert>
  667. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  668. SELECT
  669. d.id,
  670. d.name,
  671. d.keyword,
  672. d.validity_period as validityPeriod,
  673. d.industry_category_a AS industryCategoryA,
  674. d.picture_url as pictureUrl,
  675. d.employer_contacts_mobile as employerContactsMobile,
  676. d.data_category as dataCategory,
  677. fg.name AS industryCategoryAS,
  678. fgg.name AS industryCategorBS,
  679. d.budget_cost AS budgetCost,
  680. d.problem_des AS problemDes,
  681. dg.name AS province,
  682. dgg.name AS city,
  683. interest.id as interestId,
  684. d.employer_name as employerName,
  685. u.lvl as level,
  686. d.is_hot as isHot
  687. FROM
  688. demand d
  689. LEFT JOIN `user` u on u.id = d.employer_id
  690. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  691. LEFT JOIN district_glossory dg ON dg.id = ui.province
  692. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  693. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  694. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  695. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  696. WHERE
  697. d.id = #{id,jdbcType=VARCHAR}
  698. </select>
  699. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  700. SELECT
  701. d.id,
  702. d.name,
  703. d.keyword,
  704. d.picture_url as pictureUrl,
  705. d.validity_period as validityPeriod,
  706. d.employer_contacts_mobile as employerContactsMobile,
  707. d.data_category as dataCategory,
  708. d.industry_category_a AS industryCategoryA,
  709. fg.name AS industryCategoryAS,
  710. fgg.name AS industryCategoryBS,
  711. d.budget_cost AS budgetCost,
  712. d.problem_des AS problemDes,
  713. dg.name AS province,
  714. dgg.name AS city,
  715. interest.id as interestId,
  716. d.employer_name as employerName,
  717. u.lvl as level
  718. FROM
  719. demand d
  720. LEFT JOIN `user` u on u.id = d.employer_id
  721. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  722. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  723. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  724. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  725. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  726. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  727. WHERE
  728. d.id = #{id,jdbcType=VARCHAR}
  729. </select>
  730. <select id="selectDemandListByPage" resultType="com.goafanti.demand.bo.DemandListBo">
  731. select
  732. a.id,
  733. a.serial_number as serialNumber,
  734. a.name,
  735. a.status,
  736. a.demand_type as demandType,
  737. a.audit_status as auditStatus,
  738. a.create_time as createTime,
  739. a.release_date as releaseDate,
  740. a.budget_cost as budgetCost,
  741. b.identify_name as employerName
  742. from demand a left join user b on a.employer_id = b.id
  743. where a.deleted_sign = 0
  744. <if test="employerId != null">
  745. and a.employer_id = #{employerId,jdbcType=VARCHAR}
  746. </if>
  747. <if test="startDate != null">
  748. and a.create_time <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  749. </if>
  750. <if test="endDate != null">
  751. and a.create_time <![CDATA[ <= ]]> #{endDate,jdbcType=TIMESTAMP}
  752. </if>
  753. <if test="name != null">
  754. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  755. </if>
  756. <if test="demandType != null">
  757. and a.demand_type = #{demandType,jdbcType=INTEGER}
  758. </if>
  759. <if test="auditStatus != null">
  760. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  761. </if>
  762. <if test="status != null">
  763. and a.status = #{status,jdbcType=INTEGER}
  764. </if>
  765. <if test="identifyName != null">
  766. and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
  767. </if>
  768. <if test="page_sql!=null">
  769. ${page_sql}
  770. </if>
  771. </select>
  772. <select id="selectDemandListCount" resultType="java.lang.Integer">
  773. select
  774. count(0)
  775. from demand a left join user b on a.employer_id = b.id
  776. where a.deleted_sign = 0
  777. <if test="employerId != null">
  778. and a.employer_id = #{employerId,jdbcType=VARCHAR}
  779. </if>
  780. <if test="startDate != null">
  781. and a.create_time <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  782. </if>
  783. <if test="endDate != null">
  784. and a.create_time <![CDATA[ <= ]]> #{endDate,jdbcType=TIMESTAMP}
  785. </if>
  786. <if test="name != null">
  787. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  788. </if>
  789. <if test="demandType != null">
  790. and a.demand_type = #{demandType,jdbcType=INTEGER}
  791. </if>
  792. <if test="auditStatus != null">
  793. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  794. </if>
  795. <if test="status != null">
  796. and a.status = #{status,jdbcType=INTEGER}
  797. </if>
  798. <if test="identifyName != null">
  799. and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
  800. </if>
  801. </select>
  802. <select id="countInterest" resultType="Integer">
  803. select count(0)
  804. from demand_interest
  805. where demand_id = #{demandId,jdbcType=VARCHAR}
  806. </select>
  807. <select id="findAppMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  808. select
  809. d.id, d.boutique,d.name, d.audit_status as auditStatus,ifnull(t.x,0) as orderCount,
  810. d.release_date as releaseDate,d.create_time as createTime,ifnull(i.y,0) as countInterest
  811. from demand d
  812. left join (select count(0) as x,tl.commodity_id from t_order tr
  813. left join t_order_detail tl on tl.order_no=tr.order_no
  814. where tr.order_status != 4 and tr.order_status != 0
  815. group by tl.commodity_id ) t on d.id=t.commodity_id
  816. left join (select count(0) as y,demand_id from demand_interest
  817. group by demand_id ) i on d.id=i.demand_id
  818. where d.deleted_sign = 0
  819. <if test="employerId != null">
  820. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  821. </if>
  822. order by d.serial_number desc
  823. <if test="page_sql!=null">
  824. ${page_sql}
  825. </if>
  826. </select>
  827. <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  828. select count(1)
  829. from demand d
  830. where d.deleted_sign = 0
  831. <if test="employerId != null">
  832. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  833. </if>
  834. </select>
  835. <select id="selectDemandDetail" resultType="com.goafanti.demand.bo.DemandDetailBo" parameterType="java.lang.String" >
  836. select
  837. id,
  838. name,
  839. problem_des as problemDes,
  840. industry_category_a as industryCategoryA,
  841. industry_category_b as industryCategoryB,
  842. industry_category_c as industryCategoryC,
  843. demand_type as demandType,
  844. research_type as researchType,
  845. budget_cost as budgetCost,
  846. crowd_cost as crowdCost,
  847. is_hot as isHot,
  848. is_urgent as isUrgent,
  849. urgent_money as urgentMoney,
  850. urgent_days as urgentDays,
  851. status,
  852. keyword,
  853. picture_url as pictureUrl,
  854. audit_status as auditStatus,
  855. audit_info as auditInfo
  856. from
  857. demand
  858. where id = #{id,jdbcType=VARCHAR}
  859. </select>
  860. <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  861. select n.id,n.title as name,n.create_time as createTime
  862. from news_interest ni
  863. LEFT join news n on ni.new_id=n.id
  864. where ni.uid=#{uid,jdbcType=VARCHAR}
  865. order by createTime desc
  866. <if test="page_sql!=null">
  867. ${page_sql}
  868. </if>
  869. </select>
  870. <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
  871. select count(1)
  872. from news_interest ni
  873. LEFT join news n on ni.new_id=n.id
  874. where ni.uid=#{uid,jdbcType=VARCHAR}
  875. </select>
  876. <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  877. select y.uid as id,y.username as name ,t.create_time as createTime
  878. from user_interest t
  879. left join user_identity y on t.to_uid=y.uid
  880. where expert=1
  881. and from_uid=#{uid,jdbcType=VARCHAR}
  882. <if test="page_sql!=null">
  883. ${page_sql}
  884. </if>
  885. </select>
  886. <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
  887. select count(1)
  888. from user_interest t
  889. left join user_identity y on t.to_uid=y.uid
  890. where expert=1
  891. and from_uid=#{uid,jdbcType=VARCHAR}
  892. </select>
  893. <select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  894. select y.uid as id,y.username as name ,t.create_time as createTime
  895. from user_interest t
  896. left join user_identity y on t.to_uid=y.uid
  897. where expert=2
  898. and from_uid=#{uid,jdbcType=VARCHAR}
  899. <if test="page_sql!=null">
  900. ${page_sql}
  901. </if>
  902. </select>
  903. <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
  904. select count(1)
  905. from user_interest t
  906. left join user_identity y on t.to_uid=y.uid
  907. where expert=2
  908. and from_uid=#{uid,jdbcType=VARCHAR}
  909. </select>
  910. <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  911. select d.id ,d.name,t.create_time as createTime
  912. from demand_interest t
  913. left join demand d on t.demand_id=d.id
  914. where t.uid=#{uid,jdbcType=VARCHAR}
  915. <if test="page_sql!=null">
  916. ${page_sql}
  917. </if>
  918. </select>
  919. <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
  920. select count(1)
  921. from demand_interest t
  922. left join demand d on t.demand_id=d.id
  923. where uid=#{uid,jdbcType=VARCHAR}
  924. </select>
  925. <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  926. select a.id ,a.name,t.create_time as createTime
  927. from achievement_interest t
  928. left join achievement a on t.achievement_id=a.id
  929. where t.uid=#{uid,jdbcType=VARCHAR}
  930. <if test="page_sql!=null">
  931. ${page_sql}
  932. </if>
  933. </select>
  934. <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
  935. select count(1)
  936. from achievement_interest t
  937. left join achievement a on t.achievement_id=a.id
  938. where t.uid=#{uid,jdbcType=VARCHAR}
  939. </select>
  940. <select id="findAppProjectInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  941. select b.id ,b.bname as name,t.uid,t.create_time as createTime
  942. from project_interest t
  943. left join business_project b on t.project_id=b.id
  944. where t.uid=#{uid,jdbcType=VARCHAR}
  945. <if test="page_sql!=null">
  946. ${page_sql}
  947. </if>
  948. </select>
  949. <select id="findAppProjectInterestCount" parameterType="String" resultType="java.lang.Integer">
  950. select count(1)
  951. from project_interest t
  952. left join business_project b on t.project_id=b.id
  953. where t.uid=#{uid,jdbcType=VARCHAR}
  954. </select>
  955. <select id="getAppHomeRecommended" resultType="com.goafanti.demand.bo.DemandRecommended">
  956. select dp.demand_id as id,d.name,d.demand_type as demandType,d.problem_des as introduction,d.picture_url as pictureUrl,
  957. d.urgent_days as urgentDays,d.urgent_money as urgentMoney,d.industry_category_a as industryCategoryA,
  958. d.industry_category_b as industryCategoryB,f1.name as fieldA,f2.name as fieldB,d.boutique
  959. from demand_publish dp
  960. left join demand d on dp.demand_id = d.id
  961. left join field_glossory f1 on d.industry_category_a=f1.id
  962. left join field_glossory f2 on d.industry_category_b=f2.id
  963. where
  964. dp.publish_client = '1'
  965. and dp.publish_page = 'W01'
  966. order by
  967. dp.if_top,
  968. dp.top_number,
  969. dp.show_number asc limit 0,
  970. 6
  971. </select>
  972. <select id="selectRecentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  973. 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
  974. ,fg.name as industryCategory1,fgg.name as industryCategory2
  975. from demand d
  976. left join aft.industry_category fg on fg.id=d.industry_category_a
  977. left join aft.industry_category fgg on fgg.id=d.industry_category_b
  978. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  979. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  980. 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
  981. order by release_date desc limit #{0}
  982. </select>
  983. <select id="selectCompanyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  984. select d.name,picture_url as pictureUrl,d.id ,data_category as dataCategory
  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.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
  989. order by release_date desc limit #{0}
  990. </select>
  991. <select id="getUrgentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  992. 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,
  993. data_category as dataCategory,validity_period as validityPeriod
  994. from demand d
  995. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  996. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  997. 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
  998. order by release_date desc limit #{0}
  999. </select>
  1000. <select id="getHotDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1001. select d.name,release_date as releaseDate,d.id,problem_des as problemDes,
  1002. research_type as researchType,budget_cost as fundForPersonnel,crowd_cost as fundForCrowd,demand_type as demandType,
  1003. fg.name as industryCategory1,fgg.name as industryCategory2,d.picture_url as pictureUrl,
  1004. data_category as dataCategory,validity_period as validityPeriod
  1005. from demand d
  1006. left join aft.industry_category fg on fg.id=d.industry_category_a
  1007. left join aft.industry_category fgg on fgg.id=d.industry_category_b
  1008. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1009. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1010. 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
  1011. order by release_date desc limit #{0}
  1012. </select>
  1013. <select id="getAreaDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1014. select name,picture_url as pictureUrl ,problem_des as problemDes , data_category as dataCategory,d.id from demand d
  1015. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1016. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1017. 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
  1018. order by release_date desc limit #{0}
  1019. </select>
  1020. <select id="getProLearnStudyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1021. 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
  1022. left join aft.industry_category fg on fg.id=d.industry_category_a
  1023. left join aft.industry_category fgg on fgg.id=d.industry_category_b
  1024. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1025. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1026. 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
  1027. order by release_date desc limit #{0}
  1028. </select>
  1029. <select id="getFundCrowdDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1030. 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
  1031. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1032. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1033. 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
  1034. order by release_date
  1035. desc limit #{0}
  1036. </select>
  1037. <select id="getPersonnelDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1038. select d.name,picture_url as pictureUrl ,problem_des as problemDes ,d.id,data_category as dataCategory,budget_cost as fundForPersonnel from demand d
  1039. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1040. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1041. 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
  1042. order by release_date desc limit #{0}
  1043. </select>
  1044. <select id="getDemandDetail" resultType="com.goafanti.demand.bo.DemandListBo">
  1045. 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,
  1046. fg.name as industryCategory1,fgg.name as industryCategory2
  1047. from demand d
  1048. left join aft.industry_category fg on fg.id=d.industry_category_a
  1049. left join aft.industry_category fgg on fgg.id=d.industry_category_b
  1050. where d.id=#{0} and d.data_category=#{1}
  1051. </select>
  1052. <select id="getBoutiqueDemandList" resultType="com.goafanti.demand.bo.DemandListBo">
  1053. select d.id,d.name,picture_url as picture_url,data_category as dataCategory,problem_des as problemDes
  1054. from demand d
  1055. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1056. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1057. where d.boutique=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id and instr(dp.publish_page,#{2})>0
  1058. order by release_date desc limit #{0}
  1059. </select>
  1060. <select id="listMyDemand" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1061. select
  1062. id,
  1063. serial_number as serialNumber,
  1064. name,
  1065. demand_type as demandType,
  1066. audit_status as auditStatus,
  1067. create_time as createTime
  1068. from
  1069. demand
  1070. where
  1071. employer_id = #{uid,jdbcType=VARCHAR}
  1072. <if test="status != null">
  1073. and status = #{status,jdbcType=INTEGER}
  1074. </if>
  1075. <if test="name != null">
  1076. and name = #{name,jdbcType=VARCHAR}
  1077. </if>
  1078. <if test="startDate != null">
  1079. and create_time <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR}
  1080. </if>
  1081. <if test="endDate != null">
  1082. and create_time <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR}
  1083. </if>
  1084. </select>
  1085. <select id="searchDemandList" resultType="com.goafanti.demand.bo.DemandListBo">
  1086. 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,
  1087. industry_category_a as industryCategoryA,industry_category_b as industryCategoryB,ic.name as industryCategory1,icc.name as industryCategory2
  1088. from demand a
  1089. left join industry_category ic on ic.id=a.industry_category_a
  1090. left join industry_category icc on icc.id=a.industry_category_b
  1091. where info_sources=1 and audit_status=2
  1092. <if test="industryCategoryA!=null">
  1093. and a.industry_category_a =#{industryCategoryA,jdbcType=INTEGER}
  1094. </if>
  1095. <if test="industryCategoryB!=null">
  1096. and a.industry_category_b=#{industryCategoryB,jdbcType=INTEGER}
  1097. </if>
  1098. <if test="name !=null">
  1099. and a.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  1100. </if>
  1101. order by a.release_date
  1102. <if test="page_sql !=null">
  1103. ${page_sql}
  1104. </if>
  1105. </select>
  1106. <select id="searchDemandCount" resultType="java.lang.Integer">
  1107. select count(0) from demand a
  1108. where info_sources=1 and audit_status=2
  1109. <if test="industryCategoryA!=null">
  1110. and a.industry_category_a =#{industryCategoryA,jdbcType=INTEGER}
  1111. </if>
  1112. <if test="industryCategoryB!=null">
  1113. and a.industry_category_b=#{industryCategoryB,jdbcType=INTEGER}
  1114. </if>
  1115. <if test="name !=null">
  1116. and a.name like concat("%",#{name,jdbcType=VARCHAR},"%")
  1117. </if>
  1118. </select>
  1119. </mapper>