DemandMapper.xml 66 KB

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