DemandMapper.xml 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651
  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="INTEGER" />
  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. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  63. delete from demand
  64. where id = #{id,jdbcType=VARCHAR}
  65. </delete>
  66. <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
  67. insert into demand (id, serial_number, data_category,
  68. name, keyword, info_sources,
  69. industry_category_a, industry_category_b, industry_category_c,
  70. demand_type, problem_des, technical_requirements,
  71. picture_url, text_file_url, video_url,
  72. fixed_budget, fixed_cycle, people_number,
  73. fixed_scheme, cost_escrow, budget_cost,
  74. validity_period, employer_id, employer_name,
  75. employer_address, employer_contacts, employer_contacts_mobile,
  76. employer_contacts_mailbox, contacts, status,
  77. release_status, release_date, create_time,
  78. principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark)
  79. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  80. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER},
  81. #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER},
  82. #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR},
  83. #{pictureUrl,jdbcType=LONGVARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR},
  84. #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER},
  85. #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL},
  86. #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR},
  87. #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR},
  88. #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  89. #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  90. #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
  91. #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
  92. </insert>
  93. <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
  94. insert into demand
  95. <trim prefix="(" suffix=")" suffixOverrides="," >
  96. <if test="id != null" >
  97. id,
  98. </if>
  99. <if test="serialNumber != null" >
  100. serial_number,
  101. </if>
  102. <if test="dataCategory != null" >
  103. data_category,
  104. </if>
  105. <if test="name != null" >
  106. name,
  107. </if>
  108. <if test="keyword != null" >
  109. keyword,
  110. </if>
  111. <if test="infoSources != null" >
  112. info_sources,
  113. </if>
  114. <if test="industryCategoryA != null" >
  115. industry_category_a,
  116. </if>
  117. <if test="industryCategoryB != null" >
  118. industry_category_b,
  119. </if>
  120. <if test="industryCategoryC != null" >
  121. industry_category_c,
  122. </if>
  123. <if test="demandType != null" >
  124. demand_type,
  125. </if>
  126. <if test="problemDes != null" >
  127. problem_des,
  128. </if>
  129. <if test="technicalRequirements != null" >
  130. technical_requirements,
  131. </if>
  132. <if test="pictureUrl != null" >
  133. picture_url,
  134. </if>
  135. <if test="textFileUrl != null" >
  136. text_file_url,
  137. </if>
  138. <if test="videoUrl != null" >
  139. video_url,
  140. </if>
  141. <if test="fixedBudget != null" >
  142. fixed_budget,
  143. </if>
  144. <if test="fixedCycle != null" >
  145. fixed_cycle,
  146. </if>
  147. <if test="peopleNumber != null" >
  148. people_number,
  149. </if>
  150. <if test="fixedScheme != null" >
  151. fixed_scheme,
  152. </if>
  153. <if test="costEscrow != null" >
  154. cost_escrow,
  155. </if>
  156. <if test="budgetCost != null" >
  157. budget_cost,
  158. </if>
  159. <if test="validityPeriod != null" >
  160. validity_period,
  161. </if>
  162. <if test="employerId != null" >
  163. employer_id,
  164. </if>
  165. <if test="employerName != null" >
  166. employer_name,
  167. </if>
  168. <if test="employerAddress != null" >
  169. employer_address,
  170. </if>
  171. <if test="employerContacts != null" >
  172. employer_contacts,
  173. </if>
  174. <if test="employerContactsMobile != null" >
  175. employer_contacts_mobile,
  176. </if>
  177. <if test="employerContactsMailbox != null" >
  178. employer_contacts_mailbox,
  179. </if>
  180. <if test="contacts != null" >
  181. contacts,
  182. </if>
  183. <if test="status != null" >
  184. status,
  185. </if>
  186. <if test="releaseStatus != null" >
  187. release_status,
  188. </if>
  189. <if test="releaseDate != null" >
  190. release_date,
  191. </if>
  192. <if test="createTime != null" >
  193. create_time,
  194. </if>
  195. <if test="principalId != null" >
  196. principal_id,
  197. </if>
  198. <if test="deletedSign != null" >
  199. deleted_sign,
  200. </if>
  201. <if test="auditStatus != null" >
  202. audit_status,
  203. </if>
  204. <if test="techBrokerId != null" >
  205. tech_broker_id,
  206. </if>
  207. <if test="boutique != null" >
  208. boutique,
  209. </if>
  210. <if test="remark != null" >
  211. remark,
  212. </if>
  213. </trim>
  214. <trim prefix="values (" suffix=")" suffixOverrides="," >
  215. <if test="id != null" >
  216. #{id,jdbcType=VARCHAR},
  217. </if>
  218. <if test="serialNumber != null" >
  219. #{serialNumber,jdbcType=INTEGER},
  220. </if>
  221. <if test="dataCategory != null" >
  222. #{dataCategory,jdbcType=INTEGER},
  223. </if>
  224. <if test="name != null" >
  225. #{name,jdbcType=VARCHAR},
  226. </if>
  227. <if test="keyword != null" >
  228. #{keyword,jdbcType=VARCHAR},
  229. </if>
  230. <if test="infoSources != null" >
  231. #{infoSources,jdbcType=INTEGER},
  232. </if>
  233. <if test="industryCategoryA != null" >
  234. #{industryCategoryA,jdbcType=INTEGER},
  235. </if>
  236. <if test="industryCategoryB != null" >
  237. #{industryCategoryB,jdbcType=INTEGER},
  238. </if>
  239. <if test="industryCategoryC != null" >
  240. #{industryCategoryC,jdbcType=INTEGER},
  241. </if>
  242. <if test="demandType != null" >
  243. #{demandType,jdbcType=INTEGER},
  244. </if>
  245. <if test="problemDes != null" >
  246. #{problemDes,jdbcType=VARCHAR},
  247. </if>
  248. <if test="technicalRequirements != null" >
  249. #{technicalRequirements,jdbcType=VARCHAR},
  250. </if>
  251. <if test="pictureUrl != null" >
  252. #{pictureUrl,jdbcType=LONGVARCHAR},
  253. </if>
  254. <if test="textFileUrl != null" >
  255. #{textFileUrl,jdbcType=VARCHAR},
  256. </if>
  257. <if test="videoUrl != null" >
  258. #{videoUrl,jdbcType=VARCHAR},
  259. </if>
  260. <if test="fixedBudget != null" >
  261. #{fixedBudget,jdbcType=DECIMAL},
  262. </if>
  263. <if test="fixedCycle != null" >
  264. #{fixedCycle,jdbcType=VARCHAR},
  265. </if>
  266. <if test="peopleNumber != null" >
  267. #{peopleNumber,jdbcType=INTEGER},
  268. </if>
  269. <if test="fixedScheme != null" >
  270. #{fixedScheme,jdbcType=VARCHAR},
  271. </if>
  272. <if test="costEscrow != null" >
  273. #{costEscrow,jdbcType=DECIMAL},
  274. </if>
  275. <if test="budgetCost != null" >
  276. #{budgetCost,jdbcType=DECIMAL},
  277. </if>
  278. <if test="validityPeriod != null" >
  279. #{validityPeriod,jdbcType=TIMESTAMP},
  280. </if>
  281. <if test="employerId != null" >
  282. #{employerId,jdbcType=VARCHAR},
  283. </if>
  284. <if test="employerName != null" >
  285. #{employerName,jdbcType=VARCHAR},
  286. </if>
  287. <if test="employerAddress != null" >
  288. #{employerAddress,jdbcType=VARCHAR},
  289. </if>
  290. <if test="employerContacts != null" >
  291. #{employerContacts,jdbcType=VARCHAR},
  292. </if>
  293. <if test="employerContactsMobile != null" >
  294. #{employerContactsMobile,jdbcType=VARCHAR},
  295. </if>
  296. <if test="employerContactsMailbox != null" >
  297. #{employerContactsMailbox,jdbcType=VARCHAR},
  298. </if>
  299. <if test="contacts != null" >
  300. #{contacts,jdbcType=INTEGER},
  301. </if>
  302. <if test="status != null" >
  303. #{status,jdbcType=INTEGER},
  304. </if>
  305. <if test="releaseStatus != null" >
  306. #{releaseStatus,jdbcType=INTEGER},
  307. </if>
  308. <if test="releaseDate != null" >
  309. #{releaseDate,jdbcType=TIMESTAMP},
  310. </if>
  311. <if test="createTime != null" >
  312. #{createTime,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="principalId != null" >
  315. #{principalId,jdbcType=VARCHAR},
  316. </if>
  317. <if test="deletedSign != null" >
  318. #{deletedSign,jdbcType=INTEGER},
  319. </if>
  320. <if test="auditStatus != null" >
  321. #{auditStatus,jdbcType=INTEGER},
  322. </if>
  323. <if test="techBrokerId != null" >
  324. #{techBrokerId,jdbcType=VARCHAR},
  325. </if>
  326. <if test="boutique != null" >
  327. #{boutique,jdbcType=INTEGER},
  328. </if>
  329. <if test="remark != null" >
  330. #{remark,jdbcType=VARCHAR},
  331. </if>
  332. </trim>
  333. </insert>
  334. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
  335. update demand
  336. <set >
  337. <if test="serialNumber != null" >
  338. serial_number = #{serialNumber,jdbcType=INTEGER},
  339. </if>
  340. <if test="dataCategory != null" >
  341. data_category = #{dataCategory,jdbcType=INTEGER},
  342. </if>
  343. <if test="name != null" >
  344. name = #{name,jdbcType=VARCHAR},
  345. </if>
  346. <if test="keyword != null" >
  347. keyword = #{keyword,jdbcType=VARCHAR},
  348. </if>
  349. <if test="infoSources != null" >
  350. info_sources = #{infoSources,jdbcType=INTEGER},
  351. </if>
  352. <if test="industryCategoryA != null" >
  353. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  354. </if>
  355. <if test="industryCategoryB != null" >
  356. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  357. </if>
  358. <if test="industryCategoryC != null" >
  359. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  360. </if>
  361. <if test="demandType != null" >
  362. demand_type = #{demandType,jdbcType=INTEGER},
  363. </if>
  364. <if test="problemDes != null" >
  365. problem_des = #{problemDes,jdbcType=VARCHAR},
  366. </if>
  367. <if test="technicalRequirements != null" >
  368. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  369. </if>
  370. <if test="pictureUrl != null" >
  371. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  372. </if>
  373. <if test="textFileUrl != null" >
  374. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  375. </if>
  376. <if test="videoUrl != null" >
  377. video_url = #{videoUrl,jdbcType=VARCHAR},
  378. </if>
  379. <if test="fixedBudget != null" >
  380. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  381. </if>
  382. <if test="fixedCycle != null" >
  383. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  384. </if>
  385. <if test="peopleNumber != null" >
  386. people_number = #{peopleNumber,jdbcType=INTEGER},
  387. </if>
  388. <if test="fixedScheme != null" >
  389. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  390. </if>
  391. <if test="costEscrow != null" >
  392. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  393. </if>
  394. <if test="budgetCost != null" >
  395. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  396. </if>
  397. <if test="validityPeriod != null" >
  398. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  399. </if>
  400. <if test="employerId != null" >
  401. employer_id = #{employerId,jdbcType=VARCHAR},
  402. </if>
  403. <if test="employerName != null" >
  404. employer_name = #{employerName,jdbcType=VARCHAR},
  405. </if>
  406. <if test="employerAddress != null" >
  407. employer_address = #{employerAddress,jdbcType=VARCHAR},
  408. </if>
  409. <if test="employerContacts != null" >
  410. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  411. </if>
  412. <if test="employerContactsMobile != null" >
  413. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  414. </if>
  415. <if test="employerContactsMailbox != null" >
  416. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  417. </if>
  418. <if test="contacts != null" >
  419. contacts = #{contacts,jdbcType=INTEGER},
  420. </if>
  421. <if test="status != null" >
  422. status = #{status,jdbcType=INTEGER},
  423. </if>
  424. <if test="releaseStatus != null" >
  425. release_status = #{releaseStatus,jdbcType=INTEGER},
  426. </if>
  427. <if test="releaseDate != null" >
  428. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  429. </if>
  430. <if test="createTime != null" >
  431. create_time = #{createTime,jdbcType=TIMESTAMP},
  432. </if>
  433. <if test="principalId != null" >
  434. principal_id = #{principalId,jdbcType=VARCHAR},
  435. </if>
  436. <if test="deletedSign != null" >
  437. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  438. </if>
  439. <if test="auditStatus != null" >
  440. audit_status = #{auditStatus,jdbcType=INTEGER},
  441. </if>
  442. <if test="techBrokerId != null" >
  443. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  444. </if>
  445. <if test="boutique != null">
  446. boutique = #{boutique,jdbcType=INTEGER},
  447. </if>
  448. <if test="remark != null" >
  449. remark = #{remark,jdbcType=VARCHAR},
  450. </if>
  451. </set>
  452. where id = #{id,jdbcType=VARCHAR}
  453. </update>
  454. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
  455. update demand
  456. set serial_number = #{serialNumber,jdbcType=INTEGER},
  457. data_category = #{dataCategory,jdbcType=INTEGER},
  458. name = #{name,jdbcType=VARCHAR},
  459. keyword = #{keyword,jdbcType=VARCHAR},
  460. info_sources = #{infoSources,jdbcType=INTEGER},
  461. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  462. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  463. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  464. demand_type = #{demandType,jdbcType=INTEGER},
  465. problem_des = #{problemDes,jdbcType=VARCHAR},
  466. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  467. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  468. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  469. video_url = #{videoUrl,jdbcType=VARCHAR},
  470. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  471. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  472. people_number = #{peopleNumber,jdbcType=INTEGER},
  473. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  474. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  475. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  476. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  477. employer_id = #{employerId,jdbcType=VARCHAR},
  478. employer_name = #{employerName,jdbcType=VARCHAR},
  479. employer_address = #{employerAddress,jdbcType=VARCHAR},
  480. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  481. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  482. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  483. contacts = #{contacts,jdbcType=INTEGER},
  484. status = #{status,jdbcType=INTEGER},
  485. release_status = #{releaseStatus,jdbcType=INTEGER},
  486. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  487. create_time = #{createTime,jdbcType=TIMESTAMP},
  488. principal_id = #{principalId,jdbcType=VARCHAR},
  489. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  490. audit_status = #{auditStatus,jdbcType=INTEGER},
  491. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  492. boutique = #{boutique,jdbcType=INTEGER}
  493. where id = #{id,jdbcType=VARCHAR}
  494. </update>
  495. <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  496. select
  497. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  498. d.name, d.keyword, d.info_sources as infoSources,
  499. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  500. d.employer_name as employerName, ui.province, d.status,
  501. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  502. d.employer_id as employerId, d.audit_status as auditStatus,d.boutique
  503. <if test="hot != null and hot == 1"><!-- 在首页 -->
  504. ,1 as hot
  505. </if>
  506. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  507. ,0 as hot
  508. </if>
  509. <if test="hot==null"><!-- 无首页参数 -->
  510. ,ifnull(mm.effective,0) as hot
  511. </if>
  512. from demand d
  513. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  514. LEFT JOIN admin a on a.id = d.tech_broker_id
  515. <if test="adminId != null">
  516. LEFT JOIN user u on d.employer_id = u.id
  517. </if>
  518. <if test="hot != null and hot == 1"><!-- 在首页 -->
  519. inner join marketing_management mm on d.id = mm.product_id
  520. </if>
  521. <if test="hot == null"> <!-- 无首页参数 -->
  522. left join marketing_management mm on d.id = mm.product_id
  523. </if>
  524. where d.deleted_sign = 0 and d.data_category = 0
  525. <if test="adminId != null">
  526. and (u.mid = #{adminId,jdbcType=VARCHAR}
  527. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  528. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  529. )
  530. </if>
  531. <if test="province != null">
  532. and ui.province = #{province,jdbcType=INTEGER}
  533. </if>
  534. <if test="auditStatus != null">
  535. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  536. </if>
  537. <if test="serialNumber != null">
  538. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  539. </if>
  540. <if test="name != null">
  541. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  542. </if>
  543. <if test="keyword != null">
  544. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  545. </if>
  546. <if test="username != null">
  547. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  548. </if>
  549. <if test="employerName != null">
  550. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  551. and (d.employer_id is null or d.employer_id='')
  552. </if>
  553. <if test="infoSources != null">
  554. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  555. </if>
  556. <if test="demandType != null">
  557. and d.demand_type = #{demandType,jdbcType=INTEGER}
  558. </if>
  559. <if test="status != null">
  560. and d.status = #{status,jdbcType=VARCHAR}
  561. </if>
  562. <if test="releaseStatus != null">
  563. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  564. </if>
  565. <if test="vStart != null">
  566. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  567. </if>
  568. <if test="vEnd != null">
  569. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  570. </if>
  571. <if test="rStart != null">
  572. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  573. </if>
  574. <if test="rEnd != null">
  575. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  576. </if>
  577. <if test="cStart != null">
  578. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  579. </if>
  580. <if test="cEnd != null">
  581. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  582. </if>
  583. <if test="boutique != null">
  584. and d.boutique = #{boutique,jdbcType=INTEGER}
  585. </if>
  586. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  587. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  588. </if>
  589. <if test="hot != null and hot == 1"><!-- 在首页 -->
  590. and mm.effective = 1
  591. </if>
  592. order by d.serial_number desc
  593. <if test="page_sql!=null">
  594. ${page_sql}
  595. </if>
  596. </select>
  597. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  598. select
  599. count(1)
  600. from demand d
  601. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  602. LEFT JOIN admin a on a.id = d.tech_broker_id
  603. <if test="adminId != null">
  604. LEFT JOIN user u on d.employer_id = u.id
  605. </if>
  606. <if test="hot != null and hot == 1"><!-- 在首页 -->
  607. inner join marketing_management mm on d.id = mm.product_id
  608. </if>
  609. <if test="hot == null"> <!-- 无首页参数 -->
  610. left join marketing_management mm on d.id = mm.product_id
  611. </if>
  612. where d.deleted_sign = 0 and d.data_category = 0
  613. <if test="adminId != null">
  614. and (u.mid = #{adminId,jdbcType=VARCHAR}
  615. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  616. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  617. )
  618. </if>
  619. <if test="serialNumber != null">
  620. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  621. </if>
  622. <if test="province != null">
  623. and ui.province = #{province,jdbcType=INTEGER}
  624. </if>
  625. <if test="auditStatus != null">
  626. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  627. </if>
  628. <if test="name != null">
  629. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  630. </if>
  631. <if test="keyword != null">
  632. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  633. </if>
  634. <if test="username != null">
  635. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  636. </if>
  637. <if test="employerName != null">
  638. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  639. and (d.employer_id is null or d.employer_id='')
  640. </if>
  641. <if test="infoSources != null">
  642. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  643. </if>
  644. <if test="demandType != null">
  645. and d.demand_type = #{demandType,jdbcType=INTEGER}
  646. </if>
  647. <if test="status != null">
  648. and d.status = #{status,jdbcType=INTEGER}
  649. </if>
  650. <if test="releaseStatus != null">
  651. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  652. </if>
  653. <if test="vStart != null">
  654. and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  655. </if>
  656. <if test="vEnd != null">
  657. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  658. </if>
  659. <if test="rStart != null">
  660. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  661. </if>
  662. <if test="rEnd != null">
  663. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  664. </if>
  665. <if test="cStart != null">
  666. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  667. </if>
  668. <if test="cEnd != null">
  669. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  670. </if>
  671. <if test="boutique != null">
  672. and d.boutique = #{boutique,jdbcType=INTEGER}
  673. </if>
  674. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  675. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  676. </if>
  677. <if test="hot != null and hot == 1"><!-- 在首页 -->
  678. and mm.effective = 1
  679. </if>
  680. </select>
  681. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  682. select
  683. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  684. d.name, d.keyword, d.info_sources as infoSources,
  685. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  686. d.employer_name as employerName, oi.licence_province as province, d.status,
  687. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  688. d.employer_id as employerId, d.audit_status as auditStatus,
  689. d.tech_broker_id as techBrokerId,d.boutique
  690. <if test="hot != null and hot == 1"><!-- 在首页 -->
  691. ,1 as hot
  692. </if>
  693. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  694. ,0 as hot
  695. </if>
  696. <if test="hot==null"><!-- 无首页参数 -->
  697. ,ifnull(mm.effective,0) as hot
  698. </if>
  699. from demand d
  700. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  701. LEFT JOIN admin a on a.id = d.tech_broker_id
  702. <if test="adminId != null">
  703. LEFT JOIN user u on d.employer_id = u.id
  704. </if>
  705. <if test="hot != null and hot == 1"><!-- 在首页 -->
  706. inner join marketing_management mm on d.id = mm.product_id
  707. </if>
  708. <if test="hot == null"> <!-- 无首页参数 -->
  709. left join marketing_management mm on d.id = mm.product_id
  710. </if>
  711. where d.deleted_sign = 0 and d.data_category = 1
  712. <if test="adminId != null">
  713. and (u.mid = #{adminId,jdbcType=VARCHAR}
  714. </if>
  715. <if test="adminId != null">
  716. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  717. </if>
  718. <if test="adminId != null">
  719. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  720. )
  721. </if>
  722. <if test="province != null">
  723. and oi.licence_province = #{province,jdbcType=INTEGER}
  724. </if>
  725. <if test="serialNumber != null">
  726. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  727. </if>
  728. <if test="auditStatus != null">
  729. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  730. </if>
  731. <if test="name != null">
  732. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  733. </if>
  734. <if test="keyword != null">
  735. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  736. </if>
  737. <if test="unitName != null">
  738. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  739. </if>
  740. <if test="employerName != null">
  741. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  742. and (d.employer_id is null or d.employer_id='')
  743. </if>
  744. <if test="infoSources != null">
  745. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  746. </if>
  747. <if test="demandType != null">
  748. and d.demand_type = #{demandType,jdbcType=INTEGER}
  749. </if>
  750. <if test="status != null">
  751. and d.status = #{status,jdbcType=INTEGER}
  752. </if>
  753. <if test="releaseStatus != null">
  754. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  755. </if>
  756. <if test="vStart != null">
  757. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  758. </if>
  759. <if test="vEnd != null">
  760. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  761. </if>
  762. <if test="rStart != null">
  763. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  764. </if>
  765. <if test="rEnd != null">
  766. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  767. </if>
  768. <if test="cStart != null">
  769. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  770. </if>
  771. <if test="cEnd != null">
  772. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  773. </if>
  774. <if test="boutique != null">
  775. and d.boutique = #{boutique,jdbcType=INTEGER}
  776. </if>
  777. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  778. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  779. </if>
  780. <if test="hot != null and hot == 1"><!-- 在首页 -->
  781. and mm.effective = 1
  782. </if>
  783. order by d.serial_number desc
  784. <if test="page_sql!=null">
  785. ${page_sql}
  786. </if>
  787. </select>
  788. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  789. select
  790. count(1)
  791. from demand d
  792. LEFT JOIN organization_identity oi on d.employer_id = oi.uid
  793. LEFT JOIN admin a on a.id = d.tech_broker_id
  794. <if test="adminId != null">
  795. LEFT JOIN user u on d.employer_id = u.id
  796. </if>
  797. <if test="hot != null and hot == 1"><!-- 在首页 -->
  798. inner join marketing_management mm on d.id = mm.product_id
  799. </if>
  800. <if test="hot == null"> <!-- 无首页参数 -->
  801. left join marketing_management mm on d.id = mm.product_id
  802. </if>
  803. where d.deleted_sign = 0 and d.data_category = 1
  804. <if test="adminId != null">
  805. and (u.mid = #{adminId,jdbcType=VARCHAR}
  806. </if>
  807. <if test="adminId != null">
  808. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  809. </if>
  810. <if test="adminId != null">
  811. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  812. )
  813. </if>
  814. <if test="serialNumber != null">
  815. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  816. </if>
  817. <if test="auditStatus != null">
  818. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  819. </if>
  820. <if test="province != null">
  821. and oi.licence_province = #{province,jdbcType=INTEGER}
  822. </if>
  823. <if test="name != null">
  824. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  825. </if>
  826. <if test="keyword != null">
  827. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  828. </if>
  829. <if test="unitName != null">
  830. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  831. </if>
  832. <if test="employerName != null">
  833. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  834. and (d.employer_id is null or d.employer_id='')
  835. </if>
  836. <if test="infoSources != null">
  837. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  838. </if>
  839. <if test="demandType != null">
  840. and d.demand_type = #{demandType,jdbcType=INTEGER}
  841. </if>
  842. <if test="status != null">
  843. and d.status = #{status,jdbcType=VARCHAR}
  844. </if>
  845. <if test="releaseStatus != null">
  846. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  847. </if>
  848. <if test="vStart != null">
  849. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  850. </if>
  851. <if test="vEnd != null">
  852. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  853. </if>
  854. <if test="rStart != null">
  855. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  856. </if>
  857. <if test="rEnd != null">
  858. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  859. </if>
  860. <if test="cStart != null">
  861. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  862. </if>
  863. <if test="cEnd != null">
  864. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  865. </if>
  866. <if test="boutique != null">
  867. and d.boutique = #{boutique,jdbcType=INTEGER}
  868. </if>
  869. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  870. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  871. </if>
  872. <if test="hot != null and hot == 1"><!-- 在首页 -->
  873. and mm.effective = 1
  874. </if>
  875. </select>
  876. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  877. select
  878. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  879. d.name, d.keyword, d.info_sources as infoSources,
  880. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  881. ui.province, d.status, d.release_status as releaseStatus,
  882. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  883. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  884. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  885. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  886. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  887. u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
  888. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  889. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  890. d.tech_broker_id as techBrokerId, u.mobile as contactsName,
  891. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
  892. from demand d
  893. left join user_identity ui on ui.uid = d.employer_id
  894. <!-- left join user_info info on info.uid = d.employer_id -->
  895. left join user u on u.id = d.employer_id
  896. left join marketing_management mm on d.id = mm.product_id
  897. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  898. </select>
  899. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  900. select
  901. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  902. d.name, d.keyword, d.info_sources as infoSources,
  903. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  904. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  905. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  906. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  907. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  908. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  909. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  910. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  911. d.tech_broker_id as techBrokerId,d.remark,
  912. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  913. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  914. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
  915. from demand d
  916. left join organization_identity oi on oi.uid = d.employer_id
  917. left join user u on u.id = d.employer_id
  918. left join marketing_management mm on d.id = mm.product_id
  919. where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
  920. </select>
  921. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  922. update demand set deleted_sign = 1
  923. where id in
  924. <foreach item="item" collection="list" open="(" separator="," close=")">
  925. #{item}
  926. </foreach>
  927. </update>
  928. <update id="updateReleaseDate" parameterType="java.lang.String">
  929. update demand set release_date = null
  930. where id = #{id,jdbcType=VARCHAR}
  931. </update>
  932. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  933. select
  934. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  935. d.name, d.keyword, d.demand_type as demandType, d.remark,d.create_time as createTime,
  936. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, ad.name as techBrokerId,
  937. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  938. from demand d
  939. LEFT JOIN admin ad on ad.id = d.tech_broker_id
  940. where d.deleted_sign = 0
  941. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  942. <if test="serialNumber != null">
  943. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  944. </if>
  945. <if test="auditStatus != null">
  946. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  947. </if>
  948. <if test="name != null">
  949. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  950. </if>
  951. <if test="keyword != null">
  952. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  953. </if>
  954. <if test="demandType != null">
  955. and d.demand_type = #{demandType,jdbcType=INTEGER}
  956. </if>
  957. <if test="status != null">
  958. and d.status = #{status,jdbcType=VARCHAR}
  959. </if>
  960. <if test="releaseStatus != null">
  961. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  962. </if>
  963. <if test="vStart != null">
  964. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  965. </if>
  966. <if test="vEnd != null">
  967. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  968. </if>
  969. <if test="rStart != null">
  970. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  971. </if>
  972. <if test="rEnd != null">
  973. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  974. </if>
  975. order by d.serial_number desc
  976. <if test="page_sql!=null">
  977. ${page_sql}
  978. </if>
  979. </select>
  980. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  981. select count(1)
  982. from demand d
  983. where d.deleted_sign = 0
  984. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  985. <if test="serialNumber != null">
  986. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  987. </if>
  988. <if test="auditStatus != null">
  989. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  990. </if>
  991. <if test="name != null">
  992. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  993. </if>
  994. <if test="keyword != null">
  995. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  996. </if>
  997. <if test="demandType != null">
  998. and d.demand_type = #{demandType,jdbcType=INTEGER}
  999. </if>
  1000. <if test="status != null">
  1001. and d.status = #{status,jdbcType=VARCHAR}
  1002. </if>
  1003. <if test="releaseStatus != null">
  1004. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1005. </if>
  1006. <if test="vStart != null">
  1007. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1008. </if>
  1009. <if test="vEnd != null">
  1010. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1011. </if>
  1012. <if test="rStart != null">
  1013. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1014. </if>
  1015. <if test="rEnd != null">
  1016. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1017. </if>
  1018. </select>
  1019. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  1020. insert into demand
  1021. (id, deleted_sign, audit_status,
  1022. status, release_status, create_time,
  1023. keyword, data_category, name,
  1024. demand_type, problem_des, employer_name,
  1025. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark)
  1026. values
  1027. <foreach item="item" index="index" collection="list" separator=",">
  1028. (
  1029. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1030. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  1031. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  1032. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  1033. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  1034. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR}
  1035. )
  1036. </foreach>
  1037. </insert>
  1038. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1039. select
  1040. d.id, d.name, d.keyword,d.data_category as dataCategory,d.picture_url as pictureUrl,
  1041. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  1042. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  1043. d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,d.boutique,
  1044. u.lvl as level
  1045. from demand d
  1046. left join user u on u.id = d.employer_id
  1047. where d.deleted_sign = 0 and d.status = 0
  1048. <if test="keyword != null">
  1049. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1050. </if>
  1051. <if test="industryCategoryA != null">
  1052. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1053. </if>
  1054. <if test="industryCategoryB != null">
  1055. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1056. </if>
  1057. <if test="budgetCostLower != null">
  1058. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1059. </if>
  1060. <if test="budgetCostUpper != null">
  1061. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1062. </if>
  1063. <if test="demandType != null">
  1064. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1065. </if>
  1066. <if test="sign == 1">
  1067. and d.budget_cost is null
  1068. </if>
  1069. and d.deleted_sign = 0
  1070. and d.release_status = 1
  1071. and d.audit_status = 3
  1072. <if test="dateSort == 0">
  1073. order by d.release_date asc
  1074. </if>
  1075. <if test="dateSort == 1">
  1076. order by d.release_date desc
  1077. </if>
  1078. <if test="page_sql!=null">
  1079. ${page_sql}
  1080. </if>
  1081. </select>
  1082. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  1083. select
  1084. count(1)
  1085. from demand d
  1086. where d.deleted_sign = 0 and d.status = 0
  1087. <if test="keyword != null">
  1088. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1089. </if>
  1090. <if test="industryCategoryA != null">
  1091. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1092. </if>
  1093. <if test="industryCategoryB != null">
  1094. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1095. </if>
  1096. <if test="budgetCostLower != null">
  1097. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1098. </if>
  1099. <if test="budgetCostUpper != null">
  1100. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1101. </if>
  1102. <if test="demandType != null">
  1103. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1104. </if>
  1105. <if test="sign == 1">
  1106. and d.budget_cost is null
  1107. </if>
  1108. and d.deleted_sign = 0
  1109. and d.release_status = 1
  1110. and d.audit_status = 3
  1111. </select>
  1112. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  1113. select
  1114. d.id,
  1115. d.employer_name as employerName,
  1116. d.serial_number as serialNumber,
  1117. d.keyword,
  1118. d.data_category as dataCategory,
  1119. d.name,
  1120. d.industry_category_a as industryCategoryA,
  1121. d.industry_category_b as industryCategoryB,
  1122. d.demand_type as demandType,
  1123. d.budget_cost as budgetCost,
  1124. d.problem_des as problemDes,
  1125. d.release_date as releaseDate,
  1126. d.technical_requirements as technicalRequirements,
  1127. d.picture_url as pictureUrl,
  1128. d.text_file_url as textFileUrl,
  1129. d.video_url as videoUrl,
  1130. d.fixed_cycle as fixedCycle,
  1131. d.people_number as peopleNumber,
  1132. d.fixed_scheme as fixedScheme,
  1133. d.cost_escrow as costEscrow,
  1134. d.validity_period as validityPeriod,
  1135. ui.username,
  1136. oi.unit_name as unitName,
  1137. di.id as demandInterestId,
  1138. do.id as demandOrderId,
  1139. do.status as orderStatus
  1140. from demand d
  1141. left join user_identity ui on ui.uid = d.employer_id
  1142. left join organization_identity oi on oi.uid = d.employer_id
  1143. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1144. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1145. where d.id = #{1}
  1146. </select>
  1147. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1148. select
  1149. count(1)
  1150. from demand
  1151. where
  1152. deleted_sign = 0
  1153. and release_status = 1
  1154. and audit_status = 3
  1155. and employer_id = #{uid,jdbcType=VARCHAR}
  1156. </select>
  1157. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1158. SELECT
  1159. id,
  1160. serial_number AS serialNumber,
  1161. data_category AS dataCategory,
  1162. NAME,
  1163. keyword,
  1164. release_date AS releaseDate,
  1165. demand_type AS demandType,
  1166. validity_period AS validityPeriod,
  1167. problem_des as problemDes,
  1168. industry_category_a as industryCategoryA,
  1169. industry_category_b as industryCategoryB,
  1170. budget_cost as budgetCost
  1171. FROM
  1172. demand
  1173. WHERE
  1174. audit_status = 3
  1175. AND release_status = 1
  1176. AND deleted_sign = 0
  1177. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1178. </select>
  1179. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1180. SELECT
  1181. count(1)
  1182. FROM
  1183. demand
  1184. WHERE
  1185. audit_status = 3
  1186. AND release_status = 1
  1187. AND deleted_sign = 0
  1188. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1189. </select>
  1190. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1191. SELECT
  1192. d.id,
  1193. d.name,
  1194. d.keyword,
  1195. d.validity_period as validityPeriod,
  1196. d.industry_category_a AS industryCategoryA,
  1197. d.picture_url as pictureUrl,
  1198. d.employer_contacts_mobile as employerContactsMobile,
  1199. d.data_category as dataCategory,
  1200. fg.name AS industryCategoryAS,
  1201. fgg.name AS industryCategorBS,
  1202. d.budget_cost AS budgetCost,
  1203. d.problem_des AS problemDes,
  1204. dg.name AS province,
  1205. dgg.name AS city,
  1206. interest.id as interestId,
  1207. d.employer_name as employerName,
  1208. u.lvl as level
  1209. FROM
  1210. demand d
  1211. LEFT JOIN `user` u on u.id = d.employer_id
  1212. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1213. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1214. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1215. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1216. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1217. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1218. WHERE
  1219. d.id = #{id,jdbcType=VARCHAR}
  1220. </select>
  1221. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1222. SELECT
  1223. d.id,
  1224. d.name,
  1225. d.keyword,
  1226. d.picture_url as pictureUrl,
  1227. d.validity_period as validityPeriod,
  1228. d.employer_contacts_mobile as employerContactsMobile,
  1229. d.data_category as dataCategory,
  1230. d.industry_category_a AS industryCategoryA,
  1231. fg.name AS industryCategoryAS,
  1232. fgg.name AS industryCategoryBS,
  1233. d.budget_cost AS budgetCost,
  1234. d.problem_des AS problemDes,
  1235. dg.name AS province,
  1236. dgg.name AS city,
  1237. interest.id as interestId,
  1238. d.employer_name as employerName,
  1239. u.lvl as level
  1240. FROM
  1241. demand d
  1242. LEFT JOIN `user` u on u.id = d.employer_id
  1243. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1244. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1245. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1246. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1247. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1248. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1249. WHERE
  1250. d.id = #{id,jdbcType=VARCHAR}
  1251. </select>
  1252. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1253. select
  1254. d.id,
  1255. d.name,
  1256. fg.name as industryCategoryAS,
  1257. fgg.name as industryCategoryBS,
  1258. d.problem_des as problemDes,
  1259. d.budget_cost as budgetCost,
  1260. u.lvl as level
  1261. from
  1262. demand d
  1263. left join user u on u.id = d.employer_id
  1264. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1265. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1266. where
  1267. d.audit_status = 3
  1268. and d.release_status = 1
  1269. and d.deleted_sign = 0
  1270. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1271. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1272. order by d.serial_number desc
  1273. limit 5
  1274. </select>
  1275. <update id="updateEmployerId" parameterType="java.lang.String" >
  1276. update demand set employer_id = null
  1277. where id = #{id,jdbcType=VARCHAR}
  1278. </update>
  1279. <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1280. select
  1281. a.id,a.name,
  1282. b.name as industryCatalog,
  1283. a.picture_url as pictureUrl,
  1284. a.problem_des as sketch,
  1285. a.data_category as ownerType,
  1286. a.employer_name as personName
  1287. from
  1288. demand a
  1289. left join field_glossory b on a.industry_category_a = b.id
  1290. where
  1291. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1292. <if test="industryCategoryA != null and industryCategoryA != ''">
  1293. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1294. </if>
  1295. order by
  1296. a.create_time desc
  1297. <if test="page_sql!=null">
  1298. ${page_sql}
  1299. </if>
  1300. </select>
  1301. <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  1302. select
  1303. count(1)
  1304. from
  1305. demand a
  1306. left
  1307. join field_glossory b
  1308. on
  1309. a.industry_category_a = b.id
  1310. where
  1311. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1312. <if test="industryCategoryA != null and industryCategoryA != ''">
  1313. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1314. </if>
  1315. </select>
  1316. <!-- 查询需求列表 -->
  1317. <select id="selectDemandList"
  1318. resultType="com.goafanti.demand.bo.DemandListBo">
  1319. SELECT
  1320. d.id,
  1321. d.name,
  1322. d.keyword,
  1323. d.data_category as dataCategory,
  1324. d.fixed_budget as fixedbudget,
  1325. d.demand_type as demandType,
  1326. d.picture_url as pictureUrl,
  1327. d.industry_category_a AS industryCategoryA,
  1328. fg.name AS
  1329. industryCategoryAS,
  1330. fgg.name AS industryCategorBS,
  1331. d.budget_cost AS
  1332. budgetCost,
  1333. d.problem_des AS problemDes,
  1334. dg.name AS
  1335. province,
  1336. dgg.name AS
  1337. city,
  1338. d.employer_name as
  1339. employerName,
  1340. u.lvl as
  1341. level
  1342. FROM
  1343. demand d
  1344. LEFT JOIN `user` u on u.id = d.employer_id
  1345. LEFT JOIN
  1346. user_identity ui on ui.uid = d.employer_id
  1347. LEFT JOIN district_glossory
  1348. dg ON dg.id = ui.province
  1349. LEFT JOIN district_glossory dgg ON dgg.id =
  1350. ui.city
  1351. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1352. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1353. WHERE
  1354. <if test="_parameter!= null">
  1355. d.boutique = #{_parameter,jdbcType=INTEGER}
  1356. </if>
  1357. limit 0,30
  1358. </select>
  1359. <!-- 猜你喜欢 -->
  1360. <select id="selectCsutomerLike"
  1361. resultType="com.goafanti.demand.bo.DemandListBo">
  1362. SELECT
  1363. d.id,
  1364. d.name,
  1365. d.keyword,
  1366. d.data_category as dataCategory,
  1367. d.fixed_budget as fixedbudget,
  1368. d.demand_type as demandType,
  1369. d.picture_url as pictureUrl,
  1370. d.industry_category_a AS industryCategoryA,
  1371. fg.name AS
  1372. industryCategoryAS,
  1373. fgg.name AS industryCategorBS,
  1374. d.budget_cost AS
  1375. budgetCost,
  1376. d.problem_des AS problemDes,
  1377. dg.name AS
  1378. province,
  1379. dgg.name AS
  1380. city,
  1381. d.employer_name as
  1382. employerName,
  1383. u.lvl as
  1384. level
  1385. FROM
  1386. demand d
  1387. LEFT JOIN `user` u on u.id = d.employer_id
  1388. LEFT JOIN
  1389. user_identity ui on ui.uid = d.employer_id
  1390. LEFT JOIN district_glossory
  1391. dg ON dg.id = ui.province
  1392. LEFT JOIN district_glossory dgg ON dgg.id =
  1393. ui.city
  1394. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1395. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1396. LEFT JOIN demand_interest interest on interest.demand_id = d.id
  1397. where
  1398. interest.uid = #{uid,jdbcType=INTEGER}
  1399. limit 0,4
  1400. </select>
  1401. <select id="countInterest" resultType="Integer">
  1402. select count(0)
  1403. from demand_interest
  1404. where demand_id = #{demandId,jdbcType=VARCHAR}
  1405. </select>
  1406. <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  1407. select
  1408. d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
  1409. 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,
  1410. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  1411. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
  1412. 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
  1413. from demand d
  1414. left join user_identity t on d.employer_id=t.uid
  1415. left join field_glossory g on d.industry_category_a=g.id
  1416. left join field_glossory g2 on d.industry_category_b=g2.id
  1417. left join (select count(0) as countInterest ,demand_id from demand_interest
  1418. group by demand_id) t on d.id=t.demand_id
  1419. where d.deleted_sign = 0
  1420. <if test="employerId != null">
  1421. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1422. </if>
  1423. <if test="serialNumber != null">
  1424. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1425. </if>
  1426. <if test="auditStatus != null">
  1427. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1428. </if>
  1429. <if test="name != null">
  1430. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1431. </if>
  1432. <if test="keyword != null">
  1433. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1434. </if>
  1435. <if test="demandType != null">
  1436. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1437. </if>
  1438. <if test="industryCategoryA != null">
  1439. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1440. </if>
  1441. <if test="status != null">
  1442. and d.status = #{status,jdbcType=VARCHAR}
  1443. </if>
  1444. <if test="releaseStatus != null">
  1445. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1446. </if>
  1447. <if test="vStart != null">
  1448. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1449. </if>
  1450. <if test="vEnd != null">
  1451. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1452. </if>
  1453. <if test="rStart != null">
  1454. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1455. </if>
  1456. <if test="rEnd != null">
  1457. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1458. </if>
  1459. order by d.serial_number desc
  1460. <if test="page_sql!=null">
  1461. ${page_sql}
  1462. </if>
  1463. </select>
  1464. <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
  1465. select count(1)
  1466. from demand d
  1467. where d.deleted_sign = 0
  1468. <if test="employerId != null">
  1469. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1470. </if>
  1471. <if test="serialNumber != null">
  1472. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1473. </if>
  1474. <if test="auditStatus != null">
  1475. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1476. </if>
  1477. <if test="industryCategoryA != null">
  1478. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1479. </if>
  1480. <if test="name != null">
  1481. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1482. </if>
  1483. <if test="keyword != null">
  1484. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1485. </if>
  1486. <if test="demandType != null">
  1487. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1488. </if>
  1489. <if test="status != null">
  1490. and d.status = #{status,jdbcType=VARCHAR}
  1491. </if>
  1492. <if test="releaseStatus != null">
  1493. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1494. </if>
  1495. <if test="vStart != null">
  1496. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1497. </if>
  1498. <if test="vEnd != null">
  1499. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1500. </if>
  1501. <if test="rStart != null">
  1502. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1503. </if>
  1504. <if test="rEnd != null">
  1505. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1506. </if>
  1507. </select>
  1508. <select id="demandInterest" resultType="com.goafanti.demand.bo.DemandInterestBo">
  1509. select
  1510. d.id,d.name,di.create_time as createTime
  1511. from demand_interest di
  1512. LEFT join demand d on di.demand_id=d.id
  1513. where uid=#{uid,jdbcType=VARCHAR}
  1514. </select>
  1515. <select id="findAppMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  1516. select
  1517. d.id, d.boutique,d.name, d.audit_status as auditStatus,
  1518. d.release_date as releaseDate
  1519. from demand d
  1520. where d.deleted_sign = 0
  1521. <if test="employerId != null">
  1522. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1523. </if>
  1524. order by d.serial_number desc
  1525. <if test="page_sql!=null">
  1526. ${page_sql}
  1527. </if>
  1528. </select>
  1529. <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  1530. select count(1)
  1531. from demand d
  1532. where d.deleted_sign = 0
  1533. <if test="employerId != null">
  1534. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1535. </if>
  1536. </select>
  1537. <select id="selectDemandDetail" resultMap="BaseResultMap" parameterType="java.lang.String" >
  1538. select
  1539. d.id, d.serial_number AS serialNumber, d.data_category AS serialNumber,d.name, d.keyword, d.info_sources AS infoSources, d.industry_category_a AS industryCategoryA,
  1540. 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,
  1541. 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,
  1542. 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,
  1543. d.employer_address as employerAddress, d.employer_contacts as employerContacts, d.employer_contacts_mobile as employerContactsMobile, d.employer_contacts_mailbox as employerContactsMailbox,
  1544. 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,j.easemob_name as easemobName,
  1545. d.audit_status as auditStatus, d.tech_broker_id as techBrokerId,d.boutique,d.urgent_money as urgentMoney,d.urgent_days as urgentDays
  1546. from demand d
  1547. left join jpush_easemob_account j on d.employer_id=j.uid
  1548. where d.id = #{id,jdbcType=VARCHAR}
  1549. </select>
  1550. <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1551. select n.id,n.title as name,n.create_time as createTime
  1552. from news_interest ni
  1553. LEFT join news n on ni.new_id=n.id
  1554. where ni.uid=#{uid,jdbcType=VARCHAR}
  1555. order by createTime desc
  1556. <if test="page_sql!=null">
  1557. ${page_sql}
  1558. </if>
  1559. </select>
  1560. <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
  1561. select count(1)
  1562. from news_interest ni
  1563. LEFT join news n on ni.new_id=n.id
  1564. where ni.uid=#{uid,jdbcType=VARCHAR}
  1565. </select>
  1566. <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1567. select y.uid as id,y.username as name ,t.create_time as createTime
  1568. from user_interest t
  1569. left join user_identity y on t.to_uid=y.uid
  1570. where from_uid=#{uid,jdbcType=VARCHAR}
  1571. <if test="page_sql!=null">
  1572. ${page_sql}
  1573. </if>
  1574. </select>
  1575. <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
  1576. select count(1)
  1577. from user_interest t
  1578. left join user_identity y on t.to_uid=y.uid
  1579. where from_uid=#{uid,jdbcType=VARCHAR}
  1580. </select>
  1581. <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1582. select d.id ,d.name,t.create_time as createTime
  1583. from demand_interest t
  1584. left join demand d on t.demand_id=d.id
  1585. where t.uid=#{uid,jdbcType=VARCHAR}
  1586. <if test="page_sql!=null">
  1587. ${page_sql}
  1588. </if>
  1589. </select>
  1590. <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
  1591. select count(1)
  1592. from demand_interest t
  1593. left join demand d on t.demand_id=d.id
  1594. where uid=#{uid,jdbcType=VARCHAR}
  1595. </select>
  1596. <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1597. select a.id ,a.name,t.create_time as createTime
  1598. from achievement_interest t
  1599. left join achievement A on t.achievement_id=a.id
  1600. where uid=#{uid,jdbcType=VARCHAR}
  1601. <if test="page_sql!=null">
  1602. ${page_sql}
  1603. </if>
  1604. </select>
  1605. <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
  1606. select count(1)
  1607. from achievement_interest t
  1608. left join achievement A on t.achievement_id=a.id
  1609. where uid=#{uid,jdbcType=VARCHAR}
  1610. </select>
  1611. </mapper>