DemandMapper.xml 50 KB

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