DemandMapper.xml 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230
  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. <update id="updateReleaseDate" parameterType="java.lang.String">
  643. update demand set release_date = null
  644. where id = #{id,jdbcType=VARCHAR}
  645. </update>
  646. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  647. insert into demand
  648. (id, deleted_sign, audit_status,
  649. status, release_status, create_time,
  650. keyword, data_category, name,
  651. demand_type, problem_des, employer_name,
  652. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark,urgent_days ,urgent_money)
  653. values
  654. <foreach item="item" index="index" collection="list" separator=",">
  655. (
  656. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  657. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  658. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  659. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  660. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  661. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR},,#{item.urgentDays,jdbcType=VARCHAR},#{item.urgentMoney,jdbcType=VARCHAR}
  662. )
  663. </foreach>
  664. </insert>
  665. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  666. select
  667. d.id,
  668. d.employer_name as employerName,
  669. d.serial_number as serialNumber,
  670. d.keyword,
  671. d.data_category as dataCategory,
  672. d.name,
  673. d.industry_category_a as industryCategoryA,
  674. d.industry_category_b as industryCategoryB,
  675. d.demand_type as demandType,
  676. d.budget_cost as budgetCost,
  677. d.problem_des as problemDes,
  678. d.release_date as releaseDate,
  679. d.technical_requirements as technicalRequirements,
  680. d.picture_url as pictureUrl,
  681. d.text_file_url as textFileUrl,
  682. d.video_url as videoUrl,
  683. d.fixed_cycle as fixedCycle,
  684. d.people_number as peopleNumber,
  685. d.fixed_scheme as fixedScheme,
  686. d.cost_escrow as costEscrow,
  687. d.validity_period as validityPeriod,
  688. ui.username,
  689. oi.unit_name as unitName,
  690. di.id as demandInterestId,
  691. do.id as demandOrderId,
  692. do.status as orderStatus
  693. from demand d
  694. left join user_identity ui on ui.uid = d.employer_id
  695. left join organization_identity oi on oi.uid = d.employer_id
  696. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  697. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  698. where d.id = #{1}
  699. </select>
  700. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  701. select
  702. count(1)
  703. from demand
  704. where
  705. deleted_sign = 0
  706. and release_status = 1
  707. and audit_status = 3
  708. and employer_id = #{uid,jdbcType=VARCHAR}
  709. </select>
  710. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  711. SELECT
  712. id,
  713. serial_number AS serialNumber,
  714. data_category AS dataCategory,
  715. NAME,
  716. keyword,
  717. release_date AS releaseDate,
  718. demand_type AS demandType,
  719. validity_period AS validityPeriod,
  720. problem_des as problemDes,
  721. industry_category_a as industryCategoryA,
  722. industry_category_b as industryCategoryB,
  723. budget_cost as budgetCost
  724. FROM
  725. demand
  726. WHERE
  727. audit_status = 3
  728. AND release_status = 1
  729. AND deleted_sign = 0
  730. AND employer_id = #{employerId,jdbcType=VARCHAR}
  731. </select>
  732. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  733. SELECT
  734. count(1)
  735. FROM
  736. demand
  737. WHERE
  738. audit_status = 3
  739. AND release_status = 1
  740. AND deleted_sign = 0
  741. AND employer_id = #{employerId,jdbcType=VARCHAR}
  742. </select>
  743. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  744. SELECT
  745. d.id,
  746. d.name,
  747. d.keyword,
  748. d.validity_period as validityPeriod,
  749. d.industry_category_a AS industryCategoryA,
  750. d.picture_url as pictureUrl,
  751. d.employer_contacts_mobile as employerContactsMobile,
  752. d.data_category as dataCategory,
  753. fg.name AS industryCategoryAS,
  754. fgg.name AS industryCategorBS,
  755. d.budget_cost AS budgetCost,
  756. d.problem_des AS problemDes,
  757. dg.name AS province,
  758. dgg.name AS city,
  759. interest.id as interestId,
  760. d.employer_name as employerName,
  761. u.lvl as level
  762. FROM
  763. demand d
  764. LEFT JOIN `user` u on u.id = d.employer_id
  765. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  766. LEFT JOIN district_glossory dg ON dg.id = ui.province
  767. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  768. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  769. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  770. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  771. WHERE
  772. d.id = #{id,jdbcType=VARCHAR}
  773. </select>
  774. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  775. SELECT
  776. d.id,
  777. d.name,
  778. d.keyword,
  779. d.picture_url as pictureUrl,
  780. d.validity_period as validityPeriod,
  781. d.employer_contacts_mobile as employerContactsMobile,
  782. d.data_category as dataCategory,
  783. d.industry_category_a AS industryCategoryA,
  784. fg.name AS industryCategoryAS,
  785. fgg.name AS industryCategoryBS,
  786. d.budget_cost AS budgetCost,
  787. d.problem_des AS problemDes,
  788. dg.name AS province,
  789. dgg.name AS city,
  790. interest.id as interestId,
  791. d.employer_name as employerName,
  792. u.lvl as level
  793. FROM
  794. demand d
  795. LEFT JOIN `user` u on u.id = d.employer_id
  796. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  797. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  798. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  799. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  800. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  801. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  802. WHERE
  803. d.id = #{id,jdbcType=VARCHAR}
  804. </select>
  805. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  806. select
  807. d.id,
  808. d.name,
  809. fg.name as industryCategoryAS,
  810. fgg.name as industryCategoryBS,
  811. d.problem_des as problemDes,
  812. d.budget_cost as budgetCost,
  813. u.lvl as level
  814. from
  815. demand d
  816. left join user u on u.id = d.employer_id
  817. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  818. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  819. where
  820. d.audit_status = 3
  821. and d.release_status = 1
  822. and d.deleted_sign = 0
  823. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  824. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  825. order by d.serial_number desc
  826. limit 5
  827. </select>
  828. <update id="updateEmployerId" parameterType="java.lang.String" >
  829. update demand set employer_id = null
  830. where id = #{id,jdbcType=VARCHAR}
  831. </update>
  832. <!-- 查询需求列表 -->
  833. <select id="selectDemandListByPage" resultType="com.goafanti.demand.bo.DemandListBo">
  834. select
  835. a.id,
  836. a.serial_number as serialNumber,
  837. a.name,
  838. a.status,
  839. a.demand_type as demandType,
  840. a.audit_status as auditStatus,
  841. a.create_time as createTime,
  842. a.release_date as releaseDate,
  843. a.budget_cost as budgetCost,
  844. b.identify_name as employerName
  845. from demand a left join user b on a.employer_id = b.id
  846. where a.deleted_sign = 0
  847. <if test="employerId != null">
  848. and a.employer_id = #{employerId,jdbcType=VARCHAR}
  849. </if>
  850. <if test="startDate != null">
  851. and a.create_time <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  852. </if>
  853. <if test="endDate != null">
  854. and a.create_time <![CDATA[ <= ]]> #{endDate,jdbcType=TIMESTAMP}
  855. </if>
  856. <if test="name != null">
  857. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  858. </if>
  859. <if test="demandType != null">
  860. and a.demand_type = #{demandType,jdbcType=INTEGER}
  861. </if>
  862. <if test="auditStatus != null">
  863. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  864. </if>
  865. <if test="status != null">
  866. and a.status = #{status,jdbcType=INTEGER}
  867. </if>
  868. <if test="identifyName != null">
  869. and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
  870. </if>
  871. <if test="page_sql!=null">
  872. ${page_sql}
  873. </if>
  874. </select>
  875. <select id="selectDemandListCount" resultType="java.lang.Integer">
  876. select
  877. count(0)
  878. from demand a left join user b on a.employer_id = b.id
  879. where a.deleted_sign = 0
  880. <if test="employerId != null">
  881. and a.employer_id = #{employerId,jdbcType=VARCHAR}
  882. </if>
  883. <if test="startDate != null">
  884. and a.create_time <![CDATA[ >= ]]> #{startDate,jdbcType=TIMESTAMP}
  885. </if>
  886. <if test="endDate != null">
  887. and a.create_time <![CDATA[ <= ]]> #{endDate,jdbcType=TIMESTAMP}
  888. </if>
  889. <if test="name != null">
  890. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  891. </if>
  892. <if test="demandType != null">
  893. and a.demand_type = #{demandType,jdbcType=INTEGER}
  894. </if>
  895. <if test="auditStatus != null">
  896. and a.audit_status = #{auditStatus,jdbcType=INTEGER}
  897. </if>
  898. <if test="status != null">
  899. and a.status = #{status,jdbcType=INTEGER}
  900. </if>
  901. <if test="identifyName != null">
  902. and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
  903. </if>
  904. </select>
  905. <select id="countInterest" resultType="Integer">
  906. select count(0)
  907. from demand_interest
  908. where demand_id = #{demandId,jdbcType=VARCHAR}
  909. </select>
  910. <select id="findAppMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  911. select
  912. d.id, d.boutique,d.name, d.audit_status as auditStatus,ifnull(t.x,0) as orderCount,
  913. d.release_date as releaseDate,d.create_time as createTime,ifnull(i.y,0) as countInterest
  914. from demand d
  915. left join (select count(0) as x,tl.commodity_id from t_order tr
  916. left join t_order_detail tl on tl.order_no=tr.order_no
  917. where tr.order_status != 4 and tr.order_status != 0
  918. group by tl.commodity_id ) t on d.id=t.commodity_id
  919. left join (select count(0) as y,demand_id from demand_interest
  920. group by demand_id ) i on d.id=i.demand_id
  921. where d.deleted_sign = 0
  922. <if test="employerId != null">
  923. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  924. </if>
  925. order by d.serial_number desc
  926. <if test="page_sql!=null">
  927. ${page_sql}
  928. </if>
  929. </select>
  930. <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  931. select count(1)
  932. from demand d
  933. where d.deleted_sign = 0
  934. <if test="employerId != null">
  935. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  936. </if>
  937. </select>
  938. <select id="selectDemandDetail" resultType="com.goafanti.demand.bo.DemandDetailBo" parameterType="java.lang.String" >
  939. select
  940. id,
  941. name,
  942. problem_des as problemDes,
  943. industry_category_a as industryCategoryA,
  944. industry_category_b as industryCategoryB,
  945. industry_category_c as industryCategoryC,
  946. demand_type as demandType,
  947. research_type as researchType,
  948. budget_cost as budgetCost,
  949. crowd_cost as crowdCost,
  950. is_hot as isHot,
  951. is_urgent as isUrgent,
  952. urgent_money as urgentMoney,
  953. urgent_days as urgentDays,
  954. status,
  955. keyword,
  956. picture_url as pictureUrl,
  957. audit_status as auditStatus,
  958. audit_info as auditInfo
  959. from
  960. demand
  961. where id = #{id,jdbcType=VARCHAR}
  962. </select>
  963. <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  964. select n.id,n.title as name,n.create_time as createTime
  965. from news_interest ni
  966. LEFT join news n on ni.new_id=n.id
  967. where ni.uid=#{uid,jdbcType=VARCHAR}
  968. order by createTime desc
  969. <if test="page_sql!=null">
  970. ${page_sql}
  971. </if>
  972. </select>
  973. <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
  974. select count(1)
  975. from news_interest ni
  976. LEFT join news n on ni.new_id=n.id
  977. where ni.uid=#{uid,jdbcType=VARCHAR}
  978. </select>
  979. <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  980. select y.uid as id,y.username as name ,t.create_time as createTime
  981. from user_interest t
  982. left join user_identity y on t.to_uid=y.uid
  983. where expert=1
  984. and from_uid=#{uid,jdbcType=VARCHAR}
  985. <if test="page_sql!=null">
  986. ${page_sql}
  987. </if>
  988. </select>
  989. <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
  990. select count(1)
  991. from user_interest t
  992. left join user_identity y on t.to_uid=y.uid
  993. where expert=1
  994. and from_uid=#{uid,jdbcType=VARCHAR}
  995. </select>
  996. <select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  997. select y.uid as id,y.username as name ,t.create_time as createTime
  998. from user_interest t
  999. left join user_identity y on t.to_uid=y.uid
  1000. where expert=2
  1001. and from_uid=#{uid,jdbcType=VARCHAR}
  1002. <if test="page_sql!=null">
  1003. ${page_sql}
  1004. </if>
  1005. </select>
  1006. <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
  1007. select count(1)
  1008. from user_interest t
  1009. left join user_identity y on t.to_uid=y.uid
  1010. where expert=2
  1011. and from_uid=#{uid,jdbcType=VARCHAR}
  1012. </select>
  1013. <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1014. select d.id ,d.name,t.create_time as createTime
  1015. from demand_interest t
  1016. left join demand d on t.demand_id=d.id
  1017. where t.uid=#{uid,jdbcType=VARCHAR}
  1018. <if test="page_sql!=null">
  1019. ${page_sql}
  1020. </if>
  1021. </select>
  1022. <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
  1023. select count(1)
  1024. from demand_interest t
  1025. left join demand d on t.demand_id=d.id
  1026. where uid=#{uid,jdbcType=VARCHAR}
  1027. </select>
  1028. <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1029. select a.id ,a.name,t.create_time as createTime
  1030. from achievement_interest t
  1031. left join achievement a on t.achievement_id=a.id
  1032. where t.uid=#{uid,jdbcType=VARCHAR}
  1033. <if test="page_sql!=null">
  1034. ${page_sql}
  1035. </if>
  1036. </select>
  1037. <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
  1038. select count(1)
  1039. from achievement_interest t
  1040. left join achievement a on t.achievement_id=a.id
  1041. where t.uid=#{uid,jdbcType=VARCHAR}
  1042. </select>
  1043. <select id="findAppProjectInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1044. select b.id ,b.bname as name,t.uid,t.create_time as createTime
  1045. from project_interest t
  1046. left join business_project b on t.project_id=b.id
  1047. where t.uid=#{uid,jdbcType=VARCHAR}
  1048. <if test="page_sql!=null">
  1049. ${page_sql}
  1050. </if>
  1051. </select>
  1052. <select id="findAppProjectInterestCount" parameterType="String" resultType="java.lang.Integer">
  1053. select count(1)
  1054. from project_interest t
  1055. left join business_project b on t.project_id=b.id
  1056. where t.uid=#{uid,jdbcType=VARCHAR}
  1057. </select>
  1058. <select id="getAppHomeRecommended" resultType="com.goafanti.demand.bo.DemandRecommended">
  1059. select dp.demand_id as id,d.name,d.demand_type as demandType,d.problem_des as introduction,d.picture_url as pictureUrl,
  1060. d.urgent_days as urgentDays,d.urgent_money as urgentMoney,d.industry_category_a as industryCategoryA,
  1061. d.industry_category_b as industryCategoryB,f1.name as fieldA,f2.name as fieldB,d.boutique
  1062. from demand_publish dp
  1063. left join demand d on dp.demand_id = d.id
  1064. left join field_glossory f1 on d.industry_category_a=f1.id
  1065. left join field_glossory f2 on d.industry_category_b=f2.id
  1066. where
  1067. dp.publish_client = '1'
  1068. and dp.publish_page = 'W01'
  1069. order by
  1070. dp.if_top,
  1071. dp.top_number,
  1072. dp.show_number asc limit 0,
  1073. 6
  1074. </select>
  1075. <select id="selectDemandFollow" resultType="com.goafanti.common.model.Demand">
  1076. select d.id,d.employer_name as employerName,d.name,d.employer_contacts_mobile as employerContactsMobile,
  1077. d.employer_contacts_mailbox as employerContactsMailbox,d.create_time as createTime,a.name as techBrokerId
  1078. from demand d
  1079. left join admin a on a.id=d.tech_broker_id
  1080. where d.id=#{id,jdbcType=VARCHAR}
  1081. </select>
  1082. <select id="selectRecentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1083. 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
  1084. ,fg.name as industryCategory1,fgg.name as industryCategory2
  1085. from demand d
  1086. left join aft.field_glossory fg on fg.id=d.industry_category_a
  1087. left join aft.field_glossory fgg on fgg.id=d.industry_category_b
  1088. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1089. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1090. 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
  1091. order by release_date desc limit #{0}
  1092. </select>
  1093. <select id="selectCompanyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1094. select d.name,picture_url as pictureUrl,d.id from demand d
  1095. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1096. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1097. 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
  1098. order by release_date desc limit #{0}
  1099. </select>
  1100. <select id="getUrgentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1101. 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,
  1102. validity_period as validityPeriod
  1103. from demand d
  1104. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1105. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1106. 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
  1107. order by release_date desc limit #{0}
  1108. </select>
  1109. <select id="getHotDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1110. 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,
  1111. validity_period as validityPeriod
  1112. from demand d
  1113. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1114. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1115. 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
  1116. order by release_date desc limit #{0}
  1117. </select>
  1118. <select id="getAreaDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1119. select name,picture_url as pictureUrl ,problem_des as problemDes ,d.id from demand d
  1120. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1121. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1122. 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
  1123. order by release_date desc limit #{0}
  1124. </select>
  1125. <select id="getProLearnStudyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1126. select d.name as name,picture_url as pictureUrl ,problem_des as problemDes,employer_name as employerName,d.id,fg.name as industryCategory1,fgg.name as industryCategory2 from demand d
  1127. left join aft.field_glossory fg on fg.id=d.industry_category_a
  1128. left join aft.field_glossory fgg on fgg.id=d.industry_category_b
  1129. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1130. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1131. 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
  1132. order by release_date desc limit #{0}
  1133. </select>
  1134. <select id="getFundCrowdDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1135. select d.name,picture_url as pictureUrl ,problem_des as problemDes ,d.id,crowd_cost as fundForCrowd,research_type as researchType from demand d
  1136. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1137. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1138. 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
  1139. order by release_date
  1140. desc limit #{0}
  1141. </select>
  1142. <select id="getPersonnelDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  1143. select d.name,picture_url as pictureUrl ,problem_des as problemDes ,d.id,budget_cost as fundForPersonnel from demand d
  1144. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1145. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1146. 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
  1147. order by release_date desc limit #{0}
  1148. </select>
  1149. <select id="getDemandDetail" resultType="com.goafanti.demand.bo.DemandListBo">
  1150. select d.name,d.budget_cost as budgetCost,d.validity_period as validityPeriod,d.picture_url as pictureUrl,problem_des as problemDes,
  1151. fg.name as industryCategory1,fgg.name as industryCategory2
  1152. from demand d
  1153. left join aft.field_glossory fg on fg.id=d.industry_category_a
  1154. left join aft.field_glossory fgg on fgg.id=d.industry_category_b
  1155. where d.id=#{0} and d.data_category=#{1}
  1156. </select>
  1157. <select id="getBoutiqueDemandList" resultType="com.goafanti.demand.bo.DemandListBo">
  1158. select d.id,d.name,picture_url as picture_url,data_category as dataCategory
  1159. from demand d
  1160. left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
  1161. left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
  1162. where d.boutique=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id and instr(dp.publish_page,#{2})>0
  1163. order by release_date desc limit #{0}
  1164. </select> <select id="listMyDemand" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1165. select
  1166. id,
  1167. serial_number as serialNumber,
  1168. name,
  1169. demand_type as demandType,
  1170. audit_status as auditStatus,
  1171. create_time as createTime
  1172. from
  1173. demand
  1174. where
  1175. employer_id = #{uid,jdbcType=VARCHAR}
  1176. <if test="status != null">
  1177. and status = #{status,jdbcType=INTEGER}
  1178. </if>
  1179. <if test="name != null">
  1180. and name = #{name,jdbcType=VARCHAR}
  1181. </if>
  1182. <if test="startDate != null">
  1183. and create_time <![CDATA[ > ]]> #{startDate,jdbcType=VARCHAR}
  1184. </if>
  1185. <if test="endDate != null">
  1186. and create_time <![CDATA[ < ]]> #{endDate,jdbcType=VARCHAR}
  1187. </if>
  1188. </select></mapper>