DemandMapper.xml 50 KB

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