DemandMapper.xml 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102
  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,tl.commodity_id from t_order tr
  75. left join t_order_detail tl on tl.order_no=tr.order_no
  76. where order_status != 4
  77. group by tl.commodity_id) t on d.id=t.commodity_id
  78. left join (select count(0) as x,tl.commodity_id from t_order tr
  79. left join t_order_detail tl on tl.order_no=tr.order_no
  80. where tr.order_status != 4 and tr.order_status != 0
  81. group by tl.commodity_id ) t2 on d.id=t2.commodity_id
  82. where d.id = #{id,jdbcType=VARCHAR}
  83. </select>
  84. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  85. delete from demand
  86. where id = #{id,jdbcType=VARCHAR}
  87. </delete>
  88. <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
  89. insert into demand (id, serial_number, data_category,
  90. name, keyword, info_sources,
  91. industry_category_a, industry_category_b, industry_category_c,
  92. demand_type, problem_des, technical_requirements,
  93. picture_url, text_file_url, video_url,
  94. fixed_budget, fixed_cycle, people_number,
  95. fixed_scheme, cost_escrow, budget_cost,
  96. validity_period, employer_id, employer_name,
  97. employer_address, employer_contacts, employer_contacts_mobile,
  98. employer_contacts_mailbox, contacts, status,
  99. release_status, release_date, create_time,
  100. principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark,urgent_days,urgent_money)
  101. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
  102. #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER},
  103. #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER},
  104. #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR},
  105. #{pictureUrl,jdbcType=LONGVARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR},
  106. #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER},
  107. #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL},
  108. #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR},
  109. #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR},
  110. #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  111. #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  112. #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
  113. #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{urgentDays,jdbcType=VARCHAR},#{urgentMoney,jdbcType=VARCHAR})
  114. </insert>
  115. <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
  116. insert into demand
  117. <trim prefix="(" suffix=")" suffixOverrides="," >
  118. <if test="id != null" >
  119. id,
  120. </if>
  121. <if test="serialNumber != null" >
  122. serial_number,
  123. </if>
  124. <if test="dataCategory != null" >
  125. data_category,
  126. </if>
  127. <if test="name != null" >
  128. name,
  129. </if>
  130. <if test="keyword != null" >
  131. keyword,
  132. </if>
  133. <if test="infoSources != null" >
  134. info_sources,
  135. </if>
  136. <if test="industryCategoryA != null" >
  137. industry_category_a,
  138. </if>
  139. <if test="industryCategoryB != null" >
  140. industry_category_b,
  141. </if>
  142. <if test="industryCategoryC != null" >
  143. industry_category_c,
  144. </if>
  145. <if test="demandType != null" >
  146. demand_type,
  147. </if>
  148. <if test="problemDes != null" >
  149. problem_des,
  150. </if>
  151. <if test="technicalRequirements != null" >
  152. technical_requirements,
  153. </if>
  154. <if test="pictureUrl != null" >
  155. picture_url,
  156. </if>
  157. <if test="textFileUrl != null" >
  158. text_file_url,
  159. </if>
  160. <if test="videoUrl != null" >
  161. video_url,
  162. </if>
  163. <if test="fixedBudget != null" >
  164. fixed_budget,
  165. </if>
  166. <if test="fixedCycle != null" >
  167. fixed_cycle,
  168. </if>
  169. <if test="peopleNumber != null" >
  170. people_number,
  171. </if>
  172. <if test="fixedScheme != null" >
  173. fixed_scheme,
  174. </if>
  175. <if test="costEscrow != null" >
  176. cost_escrow,
  177. </if>
  178. <if test="budgetCost != null" >
  179. budget_cost,
  180. </if>
  181. <if test="validityPeriod != null" >
  182. validity_period,
  183. </if>
  184. <if test="employerId != null" >
  185. employer_id,
  186. </if>
  187. <if test="employerName != null" >
  188. employer_name,
  189. </if>
  190. <if test="employerAddress != null" >
  191. employer_address,
  192. </if>
  193. <if test="employerContacts != null" >
  194. employer_contacts,
  195. </if>
  196. <if test="employerContactsMobile != null" >
  197. employer_contacts_mobile,
  198. </if>
  199. <if test="employerContactsMailbox != null" >
  200. employer_contacts_mailbox,
  201. </if>
  202. <if test="contacts != null" >
  203. contacts,
  204. </if>
  205. <if test="status != null" >
  206. status,
  207. </if>
  208. <if test="releaseStatus != null" >
  209. release_status,
  210. </if>
  211. <if test="releaseDate != null" >
  212. release_date,
  213. </if>
  214. <if test="createTime != null" >
  215. create_time,
  216. </if>
  217. <if test="principalId != null" >
  218. principal_id,
  219. </if>
  220. <if test="deletedSign != null" >
  221. deleted_sign,
  222. </if>
  223. <if test="auditStatus != null" >
  224. audit_status,
  225. </if>
  226. <if test="techBrokerId != null" >
  227. tech_broker_id,
  228. </if>
  229. <if test="boutique != null" >
  230. boutique,
  231. </if>
  232. <if test="remark != null" >
  233. remark,
  234. </if>
  235. </trim>
  236. <trim prefix="values (" suffix=")" suffixOverrides="," >
  237. <if test="id != null" >
  238. #{id,jdbcType=VARCHAR},
  239. </if>
  240. <if test="serialNumber != null" >
  241. #{serialNumber,jdbcType=INTEGER},
  242. </if>
  243. <if test="dataCategory != null" >
  244. #{dataCategory,jdbcType=INTEGER},
  245. </if>
  246. <if test="name != null" >
  247. #{name,jdbcType=VARCHAR},
  248. </if>
  249. <if test="keyword != null" >
  250. #{keyword,jdbcType=VARCHAR},
  251. </if>
  252. <if test="infoSources != null" >
  253. #{infoSources,jdbcType=INTEGER},
  254. </if>
  255. <if test="industryCategoryA != null" >
  256. #{industryCategoryA,jdbcType=INTEGER},
  257. </if>
  258. <if test="industryCategoryB != null" >
  259. #{industryCategoryB,jdbcType=INTEGER},
  260. </if>
  261. <if test="industryCategoryC != null" >
  262. #{industryCategoryC,jdbcType=INTEGER},
  263. </if>
  264. <if test="demandType != null" >
  265. #{demandType,jdbcType=INTEGER},
  266. </if>
  267. <if test="problemDes != null" >
  268. #{problemDes,jdbcType=VARCHAR},
  269. </if>
  270. <if test="technicalRequirements != null" >
  271. #{technicalRequirements,jdbcType=VARCHAR},
  272. </if>
  273. <if test="pictureUrl != null" >
  274. #{pictureUrl,jdbcType=LONGVARCHAR},
  275. </if>
  276. <if test="textFileUrl != null" >
  277. #{textFileUrl,jdbcType=VARCHAR},
  278. </if>
  279. <if test="videoUrl != null" >
  280. #{videoUrl,jdbcType=VARCHAR},
  281. </if>
  282. <if test="fixedBudget != null" >
  283. #{fixedBudget,jdbcType=DECIMAL},
  284. </if>
  285. <if test="fixedCycle != null" >
  286. #{fixedCycle,jdbcType=VARCHAR},
  287. </if>
  288. <if test="peopleNumber != null" >
  289. #{peopleNumber,jdbcType=INTEGER},
  290. </if>
  291. <if test="fixedScheme != null" >
  292. #{fixedScheme,jdbcType=VARCHAR},
  293. </if>
  294. <if test="costEscrow != null" >
  295. #{costEscrow,jdbcType=DECIMAL},
  296. </if>
  297. <if test="budgetCost != null" >
  298. #{budgetCost,jdbcType=DECIMAL},
  299. </if>
  300. <if test="validityPeriod != null" >
  301. #{validityPeriod,jdbcType=TIMESTAMP},
  302. </if>
  303. <if test="employerId != null" >
  304. #{employerId,jdbcType=VARCHAR},
  305. </if>
  306. <if test="employerName != null" >
  307. #{employerName,jdbcType=VARCHAR},
  308. </if>
  309. <if test="employerAddress != null" >
  310. #{employerAddress,jdbcType=VARCHAR},
  311. </if>
  312. <if test="employerContacts != null" >
  313. #{employerContacts,jdbcType=VARCHAR},
  314. </if>
  315. <if test="employerContactsMobile != null" >
  316. #{employerContactsMobile,jdbcType=VARCHAR},
  317. </if>
  318. <if test="employerContactsMailbox != null" >
  319. #{employerContactsMailbox,jdbcType=VARCHAR},
  320. </if>
  321. <if test="contacts != null" >
  322. #{contacts,jdbcType=INTEGER},
  323. </if>
  324. <if test="status != null" >
  325. #{status,jdbcType=INTEGER},
  326. </if>
  327. <if test="releaseStatus != null" >
  328. #{releaseStatus,jdbcType=INTEGER},
  329. </if>
  330. <if test="releaseDate != null" >
  331. #{releaseDate,jdbcType=TIMESTAMP},
  332. </if>
  333. <if test="createTime != null" >
  334. #{createTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="principalId != null" >
  337. #{principalId,jdbcType=VARCHAR},
  338. </if>
  339. <if test="deletedSign != null" >
  340. #{deletedSign,jdbcType=INTEGER},
  341. </if>
  342. <if test="auditStatus != null" >
  343. #{auditStatus,jdbcType=INTEGER},
  344. </if>
  345. <if test="techBrokerId != null" >
  346. #{techBrokerId,jdbcType=VARCHAR},
  347. </if>
  348. <if test="boutique != null" >
  349. #{boutique,jdbcType=INTEGER},
  350. </if>
  351. <if test="remark != null" >
  352. #{remark,jdbcType=VARCHAR},
  353. </if>
  354. </trim>
  355. </insert>
  356. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
  357. update demand
  358. <set >
  359. <if test="serialNumber != null" >
  360. serial_number = #{serialNumber,jdbcType=INTEGER},
  361. </if>
  362. <if test="dataCategory != null" >
  363. data_category = #{dataCategory,jdbcType=INTEGER},
  364. </if>
  365. <if test="name != null" >
  366. name = #{name,jdbcType=VARCHAR},
  367. </if>
  368. <if test="keyword != null" >
  369. keyword = #{keyword,jdbcType=VARCHAR},
  370. </if>
  371. <if test="infoSources != null" >
  372. info_sources = #{infoSources,jdbcType=INTEGER},
  373. </if>
  374. <if test="industryCategoryA != null" >
  375. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  376. </if>
  377. <if test="industryCategoryB != null" >
  378. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  379. </if>
  380. <if test="industryCategoryC != null" >
  381. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  382. </if>
  383. <if test="demandType != null" >
  384. demand_type = #{demandType,jdbcType=INTEGER},
  385. </if>
  386. <if test="problemDes != null" >
  387. problem_des = #{problemDes,jdbcType=VARCHAR},
  388. </if>
  389. <if test="technicalRequirements != null" >
  390. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  391. </if>
  392. <if test="pictureUrl != null" >
  393. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  394. </if>
  395. <if test="textFileUrl != null" >
  396. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  397. </if>
  398. <if test="videoUrl != null" >
  399. video_url = #{videoUrl,jdbcType=VARCHAR},
  400. </if>
  401. <if test="fixedBudget != null" >
  402. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  403. </if>
  404. <if test="fixedCycle != null" >
  405. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  406. </if>
  407. <if test="peopleNumber != null" >
  408. people_number = #{peopleNumber,jdbcType=INTEGER},
  409. </if>
  410. <if test="fixedScheme != null" >
  411. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  412. </if>
  413. <if test="costEscrow != null" >
  414. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  415. </if>
  416. <if test="budgetCost != null" >
  417. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  418. </if>
  419. <if test="validityPeriod != null" >
  420. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  421. </if>
  422. <if test="employerId != null" >
  423. employer_id = #{employerId,jdbcType=VARCHAR},
  424. </if>
  425. <if test="employerName != null" >
  426. employer_name = #{employerName,jdbcType=VARCHAR},
  427. </if>
  428. <if test="employerAddress != null" >
  429. employer_address = #{employerAddress,jdbcType=VARCHAR},
  430. </if>
  431. <if test="employerContacts != null" >
  432. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  433. </if>
  434. <if test="employerContactsMobile != null" >
  435. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  436. </if>
  437. <if test="employerContactsMailbox != null" >
  438. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  439. </if>
  440. <if test="contacts != null" >
  441. contacts = #{contacts,jdbcType=INTEGER},
  442. </if>
  443. <if test="status != null" >
  444. status = #{status,jdbcType=INTEGER},
  445. </if>
  446. <if test="releaseStatus != null" >
  447. release_status = #{releaseStatus,jdbcType=INTEGER},
  448. </if>
  449. <if test="releaseDate != null" >
  450. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  451. </if>
  452. <if test="createTime != null" >
  453. create_time = #{createTime,jdbcType=TIMESTAMP},
  454. </if>
  455. <if test="principalId != null" >
  456. principal_id = #{principalId,jdbcType=VARCHAR},
  457. </if>
  458. <if test="deletedSign != null" >
  459. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  460. </if>
  461. <if test="auditStatus != null" >
  462. audit_status = #{auditStatus,jdbcType=INTEGER},
  463. </if>
  464. <if test="techBrokerId != null" >
  465. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  466. </if>
  467. <if test="boutique != null">
  468. boutique = #{boutique,jdbcType=INTEGER},
  469. </if>
  470. <if test="remark != null" >
  471. remark = #{remark,jdbcType=VARCHAR},
  472. </if>
  473. <if test="urgentDays != null" >
  474. urgent_days = #{urgentDays,jdbcType=VARCHAR},
  475. </if>
  476. <if test="urgentMoney != null" >
  477. urgent_money = #{urgentMoney,jdbcType=VARCHAR},
  478. </if>
  479. </set>
  480. where id = #{id,jdbcType=VARCHAR}
  481. </update>
  482. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
  483. update demand
  484. set serial_number = #{serialNumber,jdbcType=INTEGER},
  485. data_category = #{dataCategory,jdbcType=INTEGER},
  486. name = #{name,jdbcType=VARCHAR},
  487. keyword = #{keyword,jdbcType=VARCHAR},
  488. info_sources = #{infoSources,jdbcType=INTEGER},
  489. industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
  490. industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
  491. industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
  492. demand_type = #{demandType,jdbcType=INTEGER},
  493. problem_des = #{problemDes,jdbcType=VARCHAR},
  494. technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
  495. picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
  496. text_file_url = #{textFileUrl,jdbcType=VARCHAR},
  497. video_url = #{videoUrl,jdbcType=VARCHAR},
  498. fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
  499. fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
  500. people_number = #{peopleNumber,jdbcType=INTEGER},
  501. fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
  502. cost_escrow = #{costEscrow,jdbcType=DECIMAL},
  503. budget_cost = #{budgetCost,jdbcType=DECIMAL},
  504. validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
  505. employer_id = #{employerId,jdbcType=VARCHAR},
  506. employer_name = #{employerName,jdbcType=VARCHAR},
  507. employer_address = #{employerAddress,jdbcType=VARCHAR},
  508. employer_contacts = #{employerContacts,jdbcType=VARCHAR},
  509. employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
  510. employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
  511. contacts = #{contacts,jdbcType=INTEGER},
  512. status = #{status,jdbcType=INTEGER},
  513. release_status = #{releaseStatus,jdbcType=INTEGER},
  514. release_date = #{releaseDate,jdbcType=TIMESTAMP},
  515. create_time = #{createTime,jdbcType=TIMESTAMP},
  516. principal_id = #{principalId,jdbcType=VARCHAR},
  517. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  518. audit_status = #{auditStatus,jdbcType=INTEGER},
  519. tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
  520. boutique = #{boutique,jdbcType=INTEGER}
  521. where id = #{id,jdbcType=VARCHAR}
  522. </update>
  523. <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  524. select
  525. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  526. d.name, d.keyword, d.info_sources as infoSources,
  527. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  528. d.employer_name as employerName, ui.province, d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  529. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  530. d.employer_id as employerId, d.audit_status as auditStatus,d.boutique
  531. <if test="hot != null and hot == 1"><!-- 在首页 -->
  532. ,1 as hot
  533. </if>
  534. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  535. ,0 as hot
  536. </if>
  537. <if test="hot==null"><!-- 无首页参数 -->
  538. ,ifnull(mm.effective,0) as hot
  539. </if>
  540. from demand d
  541. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  542. LEFT JOIN admin a on a.id = d.tech_broker_id
  543. <if test="adminId != null">
  544. LEFT JOIN user u on d.employer_id = u.id
  545. </if>
  546. <if test="hot != null and hot == 1"><!-- 在首页 -->
  547. inner join marketing_management mm on d.id = mm.product_id
  548. </if>
  549. <if test="hot == null"> <!-- 无首页参数 -->
  550. left join marketing_management mm on d.id = mm.product_id
  551. </if>
  552. where d.deleted_sign = 0 and d.data_category = 0
  553. <if test="adminId != null">
  554. and (u.mid = #{adminId,jdbcType=VARCHAR}
  555. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  556. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  557. )
  558. </if>
  559. <if test="province != null">
  560. and ui.province = #{province,jdbcType=INTEGER}
  561. </if>
  562. <if test="auditStatus != null">
  563. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  564. </if>
  565. <if test="serialNumber != null">
  566. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  567. </if>
  568. <if test="name != null">
  569. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  570. </if>
  571. <if test="keyword != null">
  572. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  573. </if>
  574. <if test="username != null">
  575. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  576. </if>
  577. <if test="employerName != null">
  578. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  579. and (d.employer_id is null or d.employer_id='')
  580. </if>
  581. <if test="infoSources != null">
  582. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  583. </if>
  584. <if test="demandType != null">
  585. and d.demand_type = #{demandType,jdbcType=INTEGER}
  586. </if>
  587. <if test="status != null">
  588. and d.status = #{status,jdbcType=VARCHAR}
  589. </if>
  590. <if test="releaseStatus != null">
  591. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  592. </if>
  593. <if test="vStart != null">
  594. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  595. </if>
  596. <if test="vEnd != null">
  597. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  598. </if>
  599. <if test="rStart != null">
  600. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  601. </if>
  602. <if test="rEnd != null">
  603. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  604. </if>
  605. <if test="cStart != null">
  606. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  607. </if>
  608. <if test="cEnd != null">
  609. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  610. </if>
  611. <if test="boutique != null">
  612. and d.boutique = #{boutique,jdbcType=INTEGER}
  613. </if>
  614. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  615. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  616. </if>
  617. <if test="hot != null and hot == 1"><!-- 在首页 -->
  618. and mm.effective = 1
  619. </if>
  620. order by d.serial_number desc
  621. <if test="page_sql!=null">
  622. ${page_sql}
  623. </if>
  624. </select>
  625. <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
  626. select
  627. count(1)
  628. from demand d
  629. LEFT JOIN user_identity ui on d.employer_id = ui.uid
  630. LEFT JOIN admin a on a.id = d.tech_broker_id
  631. <if test="adminId != null">
  632. LEFT JOIN user u on d.employer_id = u.id
  633. </if>
  634. <if test="hot != null and hot == 1"><!-- 在首页 -->
  635. inner join marketing_management mm on d.id = mm.product_id
  636. </if>
  637. <if test="hot == null"> <!-- 无首页参数 -->
  638. left join marketing_management mm on d.id = mm.product_id
  639. </if>
  640. where d.deleted_sign = 0 and d.data_category = 0
  641. <if test="adminId != null">
  642. and (u.mid = #{adminId,jdbcType=VARCHAR}
  643. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  644. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  645. )
  646. </if>
  647. <if test="serialNumber != null">
  648. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  649. </if>
  650. <if test="province != null">
  651. and ui.province = #{province,jdbcType=INTEGER}
  652. </if>
  653. <if test="auditStatus != null">
  654. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  655. </if>
  656. <if test="name != null">
  657. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  658. </if>
  659. <if test="keyword != null">
  660. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  661. </if>
  662. <if test="username != null">
  663. and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
  664. </if>
  665. <if test="employerName != null">
  666. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  667. and (d.employer_id is null or d.employer_id='')
  668. </if>
  669. <if test="infoSources != null">
  670. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  671. </if>
  672. <if test="demandType != null">
  673. and d.demand_type = #{demandType,jdbcType=INTEGER}
  674. </if>
  675. <if test="status != null">
  676. and d.status = #{status,jdbcType=INTEGER}
  677. </if>
  678. <if test="releaseStatus != null">
  679. and d.release_status = #{releaseStatus,jdbcType=INTEGER}
  680. </if>
  681. <if test="vStart != null">
  682. and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
  683. </if>
  684. <if test="vEnd != null">
  685. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  686. </if>
  687. <if test="rStart != null">
  688. and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
  689. </if>
  690. <if test="rEnd != null">
  691. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  692. </if>
  693. <if test="cStart != null">
  694. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  695. </if>
  696. <if test="cEnd != null">
  697. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  698. </if>
  699. <if test="boutique != null">
  700. and d.boutique = #{boutique,jdbcType=INTEGER}
  701. </if>
  702. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  703. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  704. </if>
  705. <if test="hot != null and hot == 1"><!-- 在首页 -->
  706. and mm.effective = 1
  707. </if>
  708. </select>
  709. <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  710. select
  711. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  712. d.name, d.keyword, d.info_sources as infoSources,
  713. d.demand_type as demandType, d.validity_period as validityPeriod,
  714. d.employer_name as employerName,d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  715. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  716. d.employer_id as employerId, d.audit_status as auditStatus,
  717. d.tech_broker_id as techBrokerIdd,d.boutique
  718. <if test="hot != null and hot == 1"><!-- 在首页 -->
  719. ,1 as hot
  720. </if>
  721. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  722. ,0 as hot
  723. </if>
  724. <if test="hot==null"><!-- 无首页参数 -->
  725. ,ifnull(mm.effective,0) as hot
  726. </if>
  727. from demand d
  728. LEFT JOIN admin a on a.id = d.tech_broker_id
  729. <if test="hot != null and hot == 1"><!-- 在首页 -->
  730. inner join marketing_management mm on d.id = mm.product_id
  731. </if>
  732. <if test="hot == null"> <!-- 无首页参数 -->
  733. left join marketing_management mm on d.id = mm.product_id
  734. </if>
  735. where d.deleted_sign = 0
  736. <if test="dataCategory != null">
  737. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  738. </if>
  739. <if test="serialNumber != null">
  740. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  741. </if>
  742. <if test="auditStatus != null">
  743. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  744. </if>
  745. <if test="name != null">
  746. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  747. </if>
  748. <if test="keyword != null">
  749. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  750. </if>
  751. <if test="employerName != null">
  752. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  753. and (d.employer_id is null or d.employer_id='')
  754. </if>
  755. <if test="infoSources != null">
  756. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  757. </if>
  758. <if test="demandType != null">
  759. and d.demand_type = #{demandType,jdbcType=INTEGER}
  760. </if>
  761. <if test="status != null">
  762. and d.status = #{status,jdbcType=INTEGER}
  763. </if>
  764. <if test="releaseStatus != null">
  765. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  766. </if>
  767. <if test="vStart != null">
  768. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  769. </if>
  770. <if test="vEnd != null">
  771. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  772. </if>
  773. <if test="rStart != null">
  774. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  775. </if>
  776. <if test="rEnd != null">
  777. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  778. </if>
  779. <if test="cStart != null">
  780. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  781. </if>
  782. <if test="cEnd != null">
  783. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  784. </if>
  785. <if test="boutique != null">
  786. and d.boutique = #{boutique,jdbcType=INTEGER}
  787. </if>
  788. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  789. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  790. </if>
  791. <if test="hot != null and hot == 1"><!-- 在首页 -->
  792. and mm.effective = 1
  793. </if>
  794. order by d.serial_number desc
  795. <if test="page_sql!=null">
  796. ${page_sql}
  797. </if>
  798. </select>
  799. <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
  800. select
  801. count(1)
  802. from demand d
  803. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  804. LEFT JOIN admin a on a.id = d.tech_broker_id
  805. <if test="hot != null and hot == 1"><!-- 在首页 -->
  806. inner join marketing_management mm on d.id = mm.product_id
  807. </if>
  808. <if test="hot == null"> <!-- 无首页参数 -->
  809. left join marketing_management mm on d.id = mm.product_id
  810. </if>
  811. where d.deleted_sign = 0
  812. <if test="dataCategory != null">
  813. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  814. </if>
  815. <if test="serialNumber != null">
  816. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  817. </if>
  818. <if test="auditStatus != null">
  819. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  820. </if>
  821. <if test="name != null">
  822. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  823. </if>
  824. <if test="keyword != null">
  825. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  826. </if>
  827. <if test="employerName != null">
  828. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  829. and (d.employer_id is null or d.employer_id='')
  830. </if>
  831. <if test="infoSources != null">
  832. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  833. </if>
  834. <if test="demandType != null">
  835. and d.demand_type = #{demandType,jdbcType=INTEGER}
  836. </if>
  837. <if test="status != null">
  838. and d.status = #{status,jdbcType=VARCHAR}
  839. </if>
  840. <if test="releaseStatus != null">
  841. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  842. </if>
  843. <if test="vStart != null">
  844. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  845. </if>
  846. <if test="vEnd != null">
  847. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  848. </if>
  849. <if test="rStart != null">
  850. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  851. </if>
  852. <if test="rEnd != null">
  853. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  854. </if>
  855. <if test="cStart != null">
  856. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  857. </if>
  858. <if test="cEnd != null">
  859. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  860. </if>
  861. <if test="boutique != null">
  862. and d.boutique = #{boutique,jdbcType=INTEGER}
  863. </if>
  864. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  865. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  866. </if>
  867. <if test="hot != null and hot == 1"><!-- 在首页 -->
  868. and mm.effective = 1
  869. </if>
  870. </select>
  871. <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  872. select
  873. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  874. d.name, d.keyword, d.info_sources as infoSources,
  875. ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
  876. ui.province, d.status, d.release_status as releaseStatus,
  877. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  878. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  879. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  880. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  881. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  882. u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
  883. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  884. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  885. d.tech_broker_id as techBrokerId, u.mobile as contactsName,d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  886. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
  887. from demand d
  888. left join user_identity ui on ui.uid = d.employer_id
  889. left join user u on u.id = d.employer_id
  890. left join marketing_management mm on d.id = mm.product_id
  891. where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
  892. </select>
  893. <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
  894. select
  895. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  896. d.name, d.keyword, d.info_sources as infoSources,
  897. oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
  898. oi.licence_province as province, d.status, d.release_status as releaseStatus,
  899. d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
  900. d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
  901. d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
  902. d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
  903. d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
  904. oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
  905. d.tech_broker_id as techBrokerId,d.remark,d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  906. d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
  907. d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
  908. d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
  909. from demand d
  910. left join organization_identity oi on oi.uid = d.employer_id
  911. left join user u on u.id = d.employer_id
  912. left join marketing_management mm on d.id = mm.product_id
  913. where <!-- d.data_category = 1 and --> d.id = #{id,jdbcType=VARCHAR}
  914. </select>
  915. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  916. update demand set deleted_sign = 1
  917. where id in
  918. <foreach item="item" collection="list" open="(" separator="," close=")">
  919. #{item}
  920. </foreach>
  921. </update>
  922. <update id="updateReleaseDate" parameterType="java.lang.String">
  923. update demand set release_date = null
  924. where id = #{id,jdbcType=VARCHAR}
  925. </update>
  926. <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  927. select
  928. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  929. d.name, d.keyword, d.demand_type as demandType, d.remark,d.create_time as createTime,
  930. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, ad.name as techBrokerId,
  931. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
  932. from demand d
  933. LEFT JOIN admin ad on ad.id = d.tech_broker_id
  934. where d.deleted_sign = 0
  935. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  936. <if test="serialNumber != null">
  937. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  938. </if>
  939. <if test="auditStatus != null">
  940. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  941. </if>
  942. <if test="name != null">
  943. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  944. </if>
  945. <if test="keyword != null">
  946. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  947. </if>
  948. <if test="demandType != null">
  949. and d.demand_type = #{demandType,jdbcType=INTEGER}
  950. </if>
  951. <if test="status != null">
  952. and d.status = #{status,jdbcType=VARCHAR}
  953. </if>
  954. <if test="releaseStatus != null">
  955. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  956. </if>
  957. <if test="vStart != null">
  958. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  959. </if>
  960. <if test="vEnd != null">
  961. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  962. </if>
  963. <if test="rStart != null">
  964. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  965. </if>
  966. <if test="rEnd != null">
  967. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  968. </if>
  969. order by d.serial_number desc
  970. <if test="page_sql!=null">
  971. ${page_sql}
  972. </if>
  973. </select>
  974. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  975. select count(1)
  976. from demand d
  977. where d.deleted_sign = 0
  978. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  979. <if test="serialNumber != null">
  980. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  981. </if>
  982. <if test="auditStatus != null">
  983. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  984. </if>
  985. <if test="name != null">
  986. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  987. </if>
  988. <if test="keyword != null">
  989. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  990. </if>
  991. <if test="demandType != null">
  992. and d.demand_type = #{demandType,jdbcType=INTEGER}
  993. </if>
  994. <if test="status != null">
  995. and d.status = #{status,jdbcType=VARCHAR}
  996. </if>
  997. <if test="releaseStatus != null">
  998. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  999. </if>
  1000. <if test="vStart != null">
  1001. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1002. </if>
  1003. <if test="vEnd != null">
  1004. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1005. </if>
  1006. <if test="rStart != null">
  1007. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1008. </if>
  1009. <if test="rEnd != null">
  1010. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1011. </if>
  1012. </select>
  1013. <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
  1014. insert into demand
  1015. (id, deleted_sign, audit_status,
  1016. status, release_status, create_time,
  1017. keyword, data_category, name,
  1018. demand_type, problem_des, employer_name,
  1019. employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark,urgent_days ,urgent_money)
  1020. values
  1021. <foreach item="item" index="index" collection="list" separator=",">
  1022. (
  1023. #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
  1024. #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
  1025. #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
  1026. #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
  1027. #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
  1028. #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR},,#{item.urgentDays,jdbcType=VARCHAR},#{item.urgentMoney,jdbcType=VARCHAR}
  1029. )
  1030. </foreach>
  1031. </insert>
  1032. <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
  1033. select
  1034. d.id, d.name, d.keyword,d.data_category as dataCategory,d.picture_url as pictureUrl,
  1035. d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
  1036. d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
  1037. d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,d.boutique,
  1038. u.lvl as level,dp.publish_page,dp.publish_platform,dp.publish_client,dp.if_top,dp.top_number,dp.show_number
  1039. from demand d
  1040. right join demand_publish dp on d.id=dp.demand_id
  1041. left join user u on u.id = d.employer_id
  1042. where d.deleted_sign = 0 and d.status = 0
  1043. and dp.publish_client=0
  1044. and dp.publish_page='W02'
  1045. and dp.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
  1046. <if test="keyword != null">
  1047. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1048. </if>
  1049. <if test="industryCategoryA != null">
  1050. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1051. </if>
  1052. <if test="industryCategoryB != null">
  1053. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1054. </if>
  1055. <if test="budgetCostLower != null">
  1056. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1057. </if>
  1058. <if test="budgetCostUpper != null">
  1059. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1060. </if>
  1061. <if test="demandType != null">
  1062. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1063. </if>
  1064. <if test="sign == 1">
  1065. and d.budget_cost is null
  1066. </if>
  1067. and d.deleted_sign = 0
  1068. and d.audit_status = 3
  1069. <if test="dateSort == 0">
  1070. order by dp.if_top,dp.top_number,dp.show_number,d.release_date asc
  1071. </if>
  1072. <if test="dateSort == 1">
  1073. order by dp.if_top asc,dp.top_number asc,dp.show_number asc,d.release_date desc
  1074. </if>
  1075. <if test="page_sql!=null">
  1076. ${page_sql}
  1077. </if>
  1078. </select>
  1079. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  1080. select
  1081. count(1)
  1082. from demand d
  1083. right join demand_publish dp on d.id=dp.demand_id
  1084. left join user u on u.id = d.employer_id
  1085. where d.deleted_sign = 0 and d.status = 0
  1086. and dp.publish_client=0
  1087. and dp.publish_page='W02'
  1088. and dp.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
  1089. <if test="keyword != null">
  1090. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1091. </if>
  1092. <if test="industryCategoryA != null">
  1093. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1094. </if>
  1095. <if test="industryCategoryB != null">
  1096. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1097. </if>
  1098. <if test="budgetCostLower != null">
  1099. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1100. </if>
  1101. <if test="budgetCostUpper != null">
  1102. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1103. </if>
  1104. <if test="demandType != null">
  1105. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1106. </if>
  1107. <if test="sign == 1">
  1108. and d.budget_cost is null
  1109. </if>
  1110. </select>
  1111. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  1112. select
  1113. d.id,
  1114. d.employer_name as employerName,
  1115. d.serial_number as serialNumber,
  1116. d.keyword,
  1117. d.data_category as dataCategory,
  1118. d.name,
  1119. d.industry_category_a as industryCategoryA,
  1120. d.industry_category_b as industryCategoryB,
  1121. d.demand_type as demandType,
  1122. d.budget_cost as budgetCost,
  1123. d.problem_des as problemDes,
  1124. d.release_date as releaseDate,
  1125. d.technical_requirements as technicalRequirements,
  1126. d.picture_url as pictureUrl,
  1127. d.text_file_url as textFileUrl,
  1128. d.video_url as videoUrl,
  1129. d.fixed_cycle as fixedCycle,
  1130. d.people_number as peopleNumber,
  1131. d.fixed_scheme as fixedScheme,
  1132. d.cost_escrow as costEscrow,
  1133. d.validity_period as validityPeriod,
  1134. ui.username,
  1135. oi.unit_name as unitName,
  1136. di.id as demandInterestId,
  1137. do.id as demandOrderId,
  1138. do.status as orderStatus
  1139. from demand d
  1140. left join user_identity ui on ui.uid = d.employer_id
  1141. left join organization_identity oi on oi.uid = d.employer_id
  1142. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1143. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1144. where d.id = #{1}
  1145. </select>
  1146. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1147. select
  1148. count(1)
  1149. from demand
  1150. where
  1151. deleted_sign = 0
  1152. and release_status = 1
  1153. and audit_status = 3
  1154. and employer_id = #{uid,jdbcType=VARCHAR}
  1155. </select>
  1156. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1157. SELECT
  1158. id,
  1159. serial_number AS serialNumber,
  1160. data_category AS dataCategory,
  1161. NAME,
  1162. keyword,
  1163. release_date AS releaseDate,
  1164. demand_type AS demandType,
  1165. validity_period AS validityPeriod,
  1166. problem_des as problemDes,
  1167. industry_category_a as industryCategoryA,
  1168. industry_category_b as industryCategoryB,
  1169. budget_cost as budgetCost
  1170. FROM
  1171. demand
  1172. WHERE
  1173. audit_status = 3
  1174. AND release_status = 1
  1175. AND deleted_sign = 0
  1176. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1177. </select>
  1178. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1179. SELECT
  1180. count(1)
  1181. FROM
  1182. demand
  1183. WHERE
  1184. audit_status = 3
  1185. AND release_status = 1
  1186. AND deleted_sign = 0
  1187. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1188. </select>
  1189. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1190. SELECT
  1191. d.id,
  1192. d.name,
  1193. d.keyword,
  1194. d.validity_period as validityPeriod,
  1195. d.industry_category_a AS industryCategoryA,
  1196. d.picture_url as pictureUrl,
  1197. d.employer_contacts_mobile as employerContactsMobile,
  1198. d.data_category as dataCategory,
  1199. fg.name AS industryCategoryAS,
  1200. fgg.name AS industryCategorBS,
  1201. d.budget_cost AS budgetCost,
  1202. d.problem_des AS problemDes,
  1203. dg.name AS province,
  1204. dgg.name AS city,
  1205. interest.id as interestId,
  1206. d.employer_name as employerName,
  1207. u.lvl as level
  1208. FROM
  1209. demand d
  1210. LEFT JOIN `user` u on u.id = d.employer_id
  1211. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1212. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1213. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1214. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1215. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1216. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1217. WHERE
  1218. d.id = #{id,jdbcType=VARCHAR}
  1219. </select>
  1220. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1221. SELECT
  1222. d.id,
  1223. d.name,
  1224. d.keyword,
  1225. d.picture_url as pictureUrl,
  1226. d.validity_period as validityPeriod,
  1227. d.employer_contacts_mobile as employerContactsMobile,
  1228. d.data_category as dataCategory,
  1229. d.industry_category_a AS industryCategoryA,
  1230. fg.name AS industryCategoryAS,
  1231. fgg.name AS industryCategoryBS,
  1232. d.budget_cost AS budgetCost,
  1233. d.problem_des AS problemDes,
  1234. dg.name AS province,
  1235. dgg.name AS city,
  1236. interest.id as interestId,
  1237. d.employer_name as employerName,
  1238. u.lvl as level
  1239. FROM
  1240. demand d
  1241. LEFT JOIN `user` u on u.id = d.employer_id
  1242. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1243. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1244. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1245. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1246. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1247. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1248. WHERE
  1249. d.id = #{id,jdbcType=VARCHAR}
  1250. </select>
  1251. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1252. select
  1253. d.id,
  1254. d.name,
  1255. fg.name as industryCategoryAS,
  1256. fgg.name as industryCategoryBS,
  1257. d.problem_des as problemDes,
  1258. d.budget_cost as budgetCost,
  1259. u.lvl as level
  1260. from
  1261. demand d
  1262. left join user u on u.id = d.employer_id
  1263. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1264. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1265. where
  1266. d.audit_status = 3
  1267. and d.release_status = 1
  1268. and d.deleted_sign = 0
  1269. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1270. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1271. order by d.serial_number desc
  1272. limit 5
  1273. </select>
  1274. <update id="updateEmployerId" parameterType="java.lang.String" >
  1275. update demand set employer_id = null
  1276. where id = #{id,jdbcType=VARCHAR}
  1277. </update>
  1278. <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1279. select
  1280. a.id,a.name,
  1281. b.name as industryCatalog,
  1282. a.picture_url as pictureUrl,
  1283. a.problem_des as sketch,
  1284. a.data_category as ownerType,
  1285. a.employer_name as personName
  1286. from
  1287. demand a
  1288. left join field_glossory b on a.industry_category_a = b.id
  1289. where
  1290. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1291. <if test="industryCategoryA != null and industryCategoryA != ''">
  1292. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1293. </if>
  1294. order by
  1295. a.create_time desc
  1296. <if test="page_sql!=null">
  1297. ${page_sql}
  1298. </if>
  1299. </select>
  1300. <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  1301. select
  1302. count(1)
  1303. from
  1304. demand a
  1305. left
  1306. join field_glossory b
  1307. on
  1308. a.industry_category_a = b.id
  1309. where
  1310. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1311. <if test="industryCategoryA != null and industryCategoryA != ''">
  1312. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1313. </if>
  1314. </select>
  1315. <!-- 查询需求列表 -->
  1316. <select id="selectDemandList"
  1317. resultType="com.goafanti.demand.bo.DemandListBo">
  1318. SELECT
  1319. d.id,
  1320. d.name,
  1321. d.keyword,
  1322. d.data_category as dataCategory,
  1323. d.fixed_budget as fixedbudget,
  1324. d.demand_type as demandType,
  1325. d.picture_url as pictureUrl,
  1326. d.industry_category_a AS industryCategoryA,
  1327. fg.name AS
  1328. industryCategoryAS,
  1329. fgg.name AS industryCategorBS,
  1330. d.budget_cost AS
  1331. budgetCost,
  1332. d.problem_des AS problemDes,
  1333. dg.name AS
  1334. province,
  1335. dgg.name AS
  1336. city,
  1337. d.employer_name as
  1338. employerName,
  1339. u.lvl as
  1340. level
  1341. FROM
  1342. demand d
  1343. LEFT JOIN `user` u on u.id = d.employer_id
  1344. LEFT JOIN
  1345. user_identity ui on ui.uid = d.employer_id
  1346. LEFT JOIN district_glossory
  1347. dg ON dg.id = ui.province
  1348. LEFT JOIN district_glossory dgg ON dgg.id =
  1349. ui.city
  1350. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1351. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1352. WHERE
  1353. <if test="_parameter!= null">
  1354. d.boutique = #{_parameter,jdbcType=INTEGER}
  1355. </if>
  1356. limit 0,30
  1357. </select>
  1358. <!-- 猜你喜欢 -->
  1359. <select id="selectCsutomerLike"
  1360. resultType="com.goafanti.demand.bo.DemandListBo">
  1361. SELECT
  1362. d.id,
  1363. d.name,
  1364. d.keyword,
  1365. d.data_category as dataCategory,
  1366. d.fixed_budget as fixedbudget,
  1367. d.demand_type as demandType,
  1368. d.picture_url as pictureUrl,
  1369. d.industry_category_a AS industryCategoryA,
  1370. fg.name AS
  1371. industryCategoryAS,
  1372. fgg.name AS industryCategorBS,
  1373. d.budget_cost AS
  1374. budgetCost,
  1375. d.problem_des AS problemDes,
  1376. dg.name AS
  1377. province,
  1378. dgg.name AS
  1379. city,
  1380. d.employer_name as
  1381. employerName,
  1382. u.lvl as
  1383. level
  1384. FROM
  1385. demand d
  1386. LEFT JOIN `user` u on u.id = d.employer_id
  1387. LEFT JOIN
  1388. user_identity ui on ui.uid = d.employer_id
  1389. LEFT JOIN district_glossory
  1390. dg ON dg.id = ui.province
  1391. LEFT JOIN district_glossory dgg ON dgg.id =
  1392. ui.city
  1393. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1394. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1395. LEFT JOIN demand_interest interest on interest.demand_id = d.id
  1396. where
  1397. interest.uid = #{uid,jdbcType=INTEGER}
  1398. limit 0,4
  1399. </select>
  1400. <select id="countInterest" resultType="Integer">
  1401. select count(0)
  1402. from demand_interest
  1403. where demand_id = #{demandId,jdbcType=VARCHAR}
  1404. </select>
  1405. <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  1406. select
  1407. d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
  1408. 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,
  1409. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  1410. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
  1411. 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
  1412. from demand d
  1413. left join user_identity t on d.employer_id=t.uid
  1414. left join field_glossory g on d.industry_category_a=g.id
  1415. left join field_glossory g2 on d.industry_category_b=g2.id
  1416. left join (select count(0) as countInterest ,demand_id from demand_interest
  1417. group by demand_id) t on d.id=t.demand_id
  1418. where d.deleted_sign = 0
  1419. and d.audit_status=3
  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.boutique 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,ifnull(t.x,0) as orderCount,
  1518. d.release_date as releaseDate,d.create_time as createTime,ifnull(i.y,0) as countInterest
  1519. from demand d
  1520. left join (select count(0) as x,tl.commodity_id from t_order tr
  1521. left join t_order_detail tl on tl.order_no=tr.order_no
  1522. where tr.order_status != 4 and tr.order_status != 0
  1523. group by tl.commodity_id ) t on d.id=t.commodity_id
  1524. left join (select count(0) as y,demand_id from demand_interest
  1525. group by demand_id ) i on d.id=i.demand_id
  1526. where d.deleted_sign = 0
  1527. <if test="employerId != null">
  1528. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1529. </if>
  1530. order by d.serial_number desc
  1531. <if test="page_sql!=null">
  1532. ${page_sql}
  1533. </if>
  1534. </select>
  1535. <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  1536. select count(1)
  1537. from demand d
  1538. where d.deleted_sign = 0
  1539. <if test="employerId != null">
  1540. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1541. </if>
  1542. </select>
  1543. <select id="selectDemandDetail" resultMap="BaseResultMap" parameterType="java.lang.String" >
  1544. select
  1545. 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,
  1546. 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,
  1547. 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,
  1548. 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,
  1549. d.employer_address as employerAddress, d.employer_contacts as employerContacts, d.employer_contacts_mobile as employerContactsMobile, d.employer_contacts_mailbox as employerContactsMailbox,
  1550. 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,
  1551. d.audit_status as auditStatus, d.tech_broker_id as techBrokerId,d.boutique,d.urgent_money as urgentMoney,d.urgent_days as urgentDays
  1552. from demand d
  1553. left join jpush_easemob_account j on d.employer_id=j.uid
  1554. where d.id = #{id,jdbcType=VARCHAR}
  1555. </select>
  1556. <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1557. select n.id,n.title as name,n.create_time as createTime
  1558. from news_interest ni
  1559. LEFT join news n on ni.new_id=n.id
  1560. where ni.uid=#{uid,jdbcType=VARCHAR}
  1561. order by createTime desc
  1562. <if test="page_sql!=null">
  1563. ${page_sql}
  1564. </if>
  1565. </select>
  1566. <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
  1567. select count(1)
  1568. from news_interest ni
  1569. LEFT join news n on ni.new_id=n.id
  1570. where ni.uid=#{uid,jdbcType=VARCHAR}
  1571. </select>
  1572. <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1573. select y.uid as id,y.username as name ,t.create_time as createTime
  1574. from user_interest t
  1575. left join user_identity y on t.to_uid=y.uid
  1576. where expert=1
  1577. and from_uid=#{uid,jdbcType=VARCHAR}
  1578. <if test="page_sql!=null">
  1579. ${page_sql}
  1580. </if>
  1581. </select>
  1582. <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
  1583. select count(1)
  1584. from user_interest t
  1585. left join user_identity y on t.to_uid=y.uid
  1586. where expert=1
  1587. and from_uid=#{uid,jdbcType=VARCHAR}
  1588. </select>
  1589. <select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1590. select y.uid as id,y.username as name ,t.create_time as createTime
  1591. from user_interest t
  1592. left join user_identity y on t.to_uid=y.uid
  1593. where expert=2
  1594. and from_uid=#{uid,jdbcType=VARCHAR}
  1595. <if test="page_sql!=null">
  1596. ${page_sql}
  1597. </if>
  1598. </select>
  1599. <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
  1600. select count(1)
  1601. from user_interest t
  1602. left join user_identity y on t.to_uid=y.uid
  1603. where expert=2
  1604. and from_uid=#{uid,jdbcType=VARCHAR}
  1605. </select>
  1606. <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1607. select d.id ,d.name,t.create_time as createTime
  1608. from demand_interest t
  1609. left join demand d on t.demand_id=d.id
  1610. where t.uid=#{uid,jdbcType=VARCHAR}
  1611. <if test="page_sql!=null">
  1612. ${page_sql}
  1613. </if>
  1614. </select>
  1615. <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
  1616. select count(1)
  1617. from demand_interest t
  1618. left join demand d on t.demand_id=d.id
  1619. where uid=#{uid,jdbcType=VARCHAR}
  1620. </select>
  1621. <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1622. select a.id ,a.name,t.create_time as createTime
  1623. from achievement_interest t
  1624. left join achievement a on t.achievement_id=a.id
  1625. where t.uid=#{uid,jdbcType=VARCHAR}
  1626. <if test="page_sql!=null">
  1627. ${page_sql}
  1628. </if>
  1629. </select>
  1630. <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
  1631. select count(1)
  1632. from achievement_interest t
  1633. left join achievement a on t.achievement_id=a.id
  1634. where t.uid=#{uid,jdbcType=VARCHAR}
  1635. </select>
  1636. <select id="findAppProjectInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1637. select b.id ,b.bname as name,t.uid,t.create_time as createTime
  1638. from project_interest t
  1639. left join business_project b on t.project_id=b.id
  1640. where t.uid=#{uid,jdbcType=VARCHAR}
  1641. <if test="page_sql!=null">
  1642. ${page_sql}
  1643. </if>
  1644. </select>
  1645. <select id="findAppProjectInterestCount" parameterType="String" resultType="java.lang.Integer">
  1646. select count(1)
  1647. from project_interest t
  1648. left join business_project b on t.project_id=b.id
  1649. where t.uid=#{uid,jdbcType=VARCHAR}
  1650. </select>
  1651. <select id="findMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  1652. select
  1653. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  1654. d.name, d.keyword, d.info_sources as infoSources,
  1655. <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
  1656. d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  1657. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  1658. d.employer_id as employerId, d.audit_status as auditStatus,
  1659. d.tech_broker_id as techBrokerId,d.boutique
  1660. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1661. ,1 as hot
  1662. </if>
  1663. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1664. ,0 as hot
  1665. </if>
  1666. <if test="hot==null"><!-- 无首页参数 -->
  1667. ,ifnull(mm.effective,0) as hot
  1668. </if>
  1669. from demand d
  1670. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1671. LEFT JOIN admin a on a.id = d.tech_broker_id
  1672. <if test="adminId != null">
  1673. LEFT JOIN user u on d.employer_id = u.id
  1674. </if>
  1675. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1676. inner join marketing_management mm on d.id = mm.product_id
  1677. </if>
  1678. <if test="hot == null"> <!-- 无首页参数 -->
  1679. left join marketing_management mm on d.id = mm.product_id
  1680. </if>
  1681. where d.deleted_sign = 0
  1682. <if test="techBrokerId != null">
  1683. and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1684. </if>
  1685. <if test="dataCategory != null">
  1686. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1687. </if>
  1688. <if test="adminId != null">
  1689. and (u.mid = #{adminId,jdbcType=VARCHAR}
  1690. </if>
  1691. <if test="adminId != null">
  1692. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  1693. </if>
  1694. <if test="adminId != null">
  1695. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  1696. )
  1697. </if>
  1698. <!-- <if test="province != null">
  1699. and oi.licence_province = #{province,jdbcType=INTEGER}
  1700. </if> -->
  1701. <if test="serialNumber != null">
  1702. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1703. </if>
  1704. <if test="auditStatus != null">
  1705. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1706. </if>
  1707. <if test="name != null">
  1708. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1709. </if>
  1710. <if test="keyword != null">
  1711. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  1712. </if>
  1713. <!-- <if test="unitName != null">
  1714. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1715. </if> -->
  1716. <if test="employerName != null">
  1717. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1718. and (d.employer_id is null or d.employer_id='')
  1719. </if>
  1720. <if test="infoSources != null">
  1721. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1722. </if>
  1723. <if test="demandType != null">
  1724. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1725. </if>
  1726. <if test="status != null">
  1727. and d.status = #{status,jdbcType=INTEGER}
  1728. </if>
  1729. <if test="releaseStatus != null">
  1730. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1731. </if>
  1732. <if test="vStart != null">
  1733. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1734. </if>
  1735. <if test="vEnd != null">
  1736. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1737. </if>
  1738. <if test="rStart != null">
  1739. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1740. </if>
  1741. <if test="rEnd != null">
  1742. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1743. </if>
  1744. <if test="cStart != null">
  1745. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1746. </if>
  1747. <if test="cEnd != null">
  1748. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1749. </if>
  1750. <if test="boutique != null">
  1751. and d.boutique = #{boutique,jdbcType=INTEGER}
  1752. </if>
  1753. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1754. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1755. </if>
  1756. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1757. and mm.effective = 1
  1758. </if>
  1759. order by d.serial_number desc
  1760. <if test="page_sql!=null">
  1761. ${page_sql}
  1762. </if>
  1763. </select>
  1764. <select id ="findMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  1765. select
  1766. count(1)
  1767. from demand d
  1768. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1769. LEFT JOIN admin a on a.id = d.tech_broker_id
  1770. <if test="adminId != null">
  1771. LEFT JOIN user u on d.employer_id = u.id
  1772. </if>
  1773. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1774. inner join marketing_management mm on d.id = mm.product_id
  1775. </if>
  1776. <if test="hot == null"> <!-- 无首页参数 -->
  1777. left join marketing_management mm on d.id = mm.product_id
  1778. </if>
  1779. where d.deleted_sign = 0
  1780. <if test="techBrokerId != null">
  1781. and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1782. </if>
  1783. <if test="dataCategory != null">
  1784. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1785. </if>
  1786. <if test="adminId != null">
  1787. and (u.mid = #{adminId,jdbcType=VARCHAR}
  1788. </if>
  1789. <if test="adminId != null">
  1790. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  1791. </if>
  1792. <if test="adminId != null">
  1793. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  1794. )
  1795. </if>
  1796. <if test="serialNumber != null">
  1797. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1798. </if>
  1799. <if test="auditStatus != null">
  1800. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1801. </if>
  1802. <!-- <if test="province != null">
  1803. and oi.licence_province = #{province,jdbcType=INTEGER}
  1804. </if> -->
  1805. <if test="name != null">
  1806. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1807. </if>
  1808. <if test="keyword != null">
  1809. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1810. </if>
  1811. <!-- <if test="unitName != null">
  1812. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1813. </if> -->
  1814. <if test="employerName != null">
  1815. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1816. and (d.employer_id is null or d.employer_id='')
  1817. </if>
  1818. <if test="infoSources != null">
  1819. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1820. </if>
  1821. <if test="demandType != null">
  1822. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1823. </if>
  1824. <if test="status != null">
  1825. and d.status = #{status,jdbcType=VARCHAR}
  1826. </if>
  1827. <if test="releaseStatus != null">
  1828. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1829. </if>
  1830. <if test="vStart != null">
  1831. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1832. </if>
  1833. <if test="vEnd != null">
  1834. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1835. </if>
  1836. <if test="rStart != null">
  1837. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1838. </if>
  1839. <if test="rEnd != null">
  1840. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1841. </if>
  1842. <if test="cStart != null">
  1843. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1844. </if>
  1845. <if test="cEnd != null">
  1846. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1847. </if>
  1848. <if test="boutique != null">
  1849. and d.boutique = #{boutique,jdbcType=INTEGER}
  1850. </if>
  1851. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1852. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1853. </if>
  1854. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1855. and mm.effective = 1
  1856. </if>
  1857. </select>
  1858. <select id="findManageDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  1859. select
  1860. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  1861. d.name, d.keyword, d.info_sources as infoSources,
  1862. <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
  1863. d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  1864. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  1865. d.employer_id as employerId, d.audit_status as auditStatus,
  1866. d.tech_broker_id as techBrokerId,d.boutique
  1867. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1868. ,1 as hot
  1869. </if>
  1870. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1871. ,0 as hot
  1872. </if>
  1873. <if test="hot==null"><!-- 无首页参数 -->
  1874. ,ifnull(mm.effective,0) as hot
  1875. </if>
  1876. from demand d
  1877. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1878. LEFT JOIN admin a on a.id = d.tech_broker_id
  1879. LEFT JOIN department_management dm on dm.id = a.department_id
  1880. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1881. inner join marketing_management mm on d.id = mm.product_id
  1882. </if>
  1883. <if test="hot == null"> <!-- 无首页参数 -->
  1884. left join marketing_management mm on d.id = mm.product_id
  1885. </if>
  1886. where d.deleted_sign = 0
  1887. <if test="techBrokerId != null">
  1888. and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1889. </if>
  1890. <if test="dataCategory != null">
  1891. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1892. </if>
  1893. <!-- <if test="province != null">
  1894. and oi.licence_province = #{province,jdbcType=INTEGER}
  1895. </if> -->
  1896. <if test="serialNumber != null">
  1897. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1898. </if>
  1899. <if test="auditStatus != null">
  1900. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1901. </if>
  1902. <if test="name != null">
  1903. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1904. </if>
  1905. <if test="keyword != null">
  1906. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  1907. </if>
  1908. <!-- <if test="unitName != null">
  1909. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1910. </if> -->
  1911. <if test="employerName != null">
  1912. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1913. and (d.employer_id is null or d.employer_id='')
  1914. </if>
  1915. <if test="infoSources != null">
  1916. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1917. </if>
  1918. <if test="demandType != null">
  1919. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1920. </if>
  1921. <if test="status != null">
  1922. and d.status = #{status,jdbcType=INTEGER}
  1923. </if>
  1924. <if test="releaseStatus != null">
  1925. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1926. </if>
  1927. <if test="vStart != null">
  1928. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1929. </if>
  1930. <if test="vEnd != null">
  1931. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1932. </if>
  1933. <if test="rStart != null">
  1934. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1935. </if>
  1936. <if test="rEnd != null">
  1937. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1938. </if>
  1939. <if test="cStart != null">
  1940. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1941. </if>
  1942. <if test="cEnd != null">
  1943. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1944. </if>
  1945. <if test="boutique != null">
  1946. and d.boutique = #{boutique,jdbcType=INTEGER}
  1947. </if>
  1948. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1949. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1950. </if>
  1951. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1952. and mm.effective = 1
  1953. </if>
  1954. order by d.serial_number desc
  1955. <if test="page_sql!=null">
  1956. ${page_sql}
  1957. </if>
  1958. </select>
  1959. <select id ="findManagegDemandCount" parameterType="String" resultType="java.lang.Integer">
  1960. select
  1961. count(1)
  1962. from demand d
  1963. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1964. LEFT JOIN admin a on a.id = d.tech_broker_id
  1965. LEFT JOIN department_management dm on dm.id = a.department_id
  1966. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1967. inner join marketing_management mm on d.id = mm.product_id
  1968. </if>
  1969. <if test="hot == null"> <!-- 无首页参数 -->
  1970. left join marketing_management mm on d.id = mm.product_id
  1971. </if>
  1972. where d.deleted_sign = 0
  1973. <if test="techBrokerId != null">
  1974. and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1975. </if>
  1976. <if test="dataCategory != null">
  1977. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1978. </if>
  1979. <if test="serialNumber != null">
  1980. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1981. </if>
  1982. <if test="auditStatus != null">
  1983. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1984. </if>
  1985. <!-- <if test="province != null">
  1986. and oi.licence_province = #{province,jdbcType=INTEGER}
  1987. </if> -->
  1988. <if test="name != null">
  1989. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1990. </if>
  1991. <if test="keyword != null">
  1992. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1993. </if>
  1994. <!-- <if test="unitName != null">
  1995. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1996. </if> -->
  1997. <if test="employerName != null">
  1998. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1999. and (d.employer_id is null or d.employer_id='')
  2000. </if>
  2001. <if test="infoSources != null">
  2002. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  2003. </if>
  2004. <if test="demandType != null">
  2005. and d.demand_type = #{demandType,jdbcType=INTEGER}
  2006. </if>
  2007. <if test="status != null">
  2008. and d.status = #{status,jdbcType=VARCHAR}
  2009. </if>
  2010. <if test="releaseStatus != null">
  2011. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  2012. </if>
  2013. <if test="vStart != null">
  2014. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  2015. </if>
  2016. <if test="vEnd != null">
  2017. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  2018. </if>
  2019. <if test="rStart != null">
  2020. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  2021. </if>
  2022. <if test="rEnd != null">
  2023. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  2024. </if>
  2025. <if test="cStart != null">
  2026. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  2027. </if>
  2028. <if test="cEnd != null">
  2029. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  2030. </if>
  2031. <if test="boutique != null">
  2032. and d.boutique = #{boutique,jdbcType=INTEGER}
  2033. </if>
  2034. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  2035. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  2036. </if>
  2037. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2038. and mm.effective = 1
  2039. </if>
  2040. </select>
  2041. <select id="getAppHomeRecommended" resultType="com.goafanti.demand.bo.DemandRecommended">
  2042. select dp.demand_id as id,d.name,d.problem_des as introduction,d.picture_url as pictureUrl,
  2043. d.urgent_days as urgentDays,d.urgent_money as urgentMoney
  2044. from demand_publish dp
  2045. left join demand d on dp.demand_id = d.id
  2046. where
  2047. dp.publish_client = '1'
  2048. and dp.publish_page = 'W01'
  2049. order by
  2050. dp.if_top,
  2051. dp.top_number,
  2052. dp.show_number asc limit 0,
  2053. 6
  2054. </select>
  2055. </mapper>