DemandMapper.xml 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062
  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. <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
  714. d.employer_name as employerName, <!-- oi.licence_province as province, --> 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 techBrokerId,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
  1039. from demand d
  1040. left join user u on u.id = d.employer_id
  1041. where d.deleted_sign = 0 and d.status = 0
  1042. <if test="keyword != null">
  1043. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1044. </if>
  1045. <if test="industryCategoryA != null">
  1046. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1047. </if>
  1048. <if test="industryCategoryB != null">
  1049. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1050. </if>
  1051. <if test="budgetCostLower != null">
  1052. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1053. </if>
  1054. <if test="budgetCostUpper != null">
  1055. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1056. </if>
  1057. <if test="demandType != null">
  1058. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1059. </if>
  1060. <if test="sign == 1">
  1061. and d.budget_cost is null
  1062. </if>
  1063. and d.deleted_sign = 0
  1064. and d.release_status = 1
  1065. and d.audit_status = 3
  1066. <if test="dateSort == 0">
  1067. order by d.release_date asc
  1068. </if>
  1069. <if test="dateSort == 1">
  1070. order by d.release_date desc
  1071. </if>
  1072. <if test="page_sql!=null">
  1073. ${page_sql}
  1074. </if>
  1075. </select>
  1076. <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
  1077. select
  1078. count(1)
  1079. from demand d
  1080. where d.deleted_sign = 0 and d.status = 0
  1081. <if test="keyword != null">
  1082. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1083. </if>
  1084. <if test="industryCategoryA != null">
  1085. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1086. </if>
  1087. <if test="industryCategoryB != null">
  1088. and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
  1089. </if>
  1090. <if test="budgetCostLower != null">
  1091. and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
  1092. </if>
  1093. <if test="budgetCostUpper != null">
  1094. and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
  1095. </if>
  1096. <if test="demandType != null">
  1097. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1098. </if>
  1099. <if test="sign == 1">
  1100. and d.budget_cost is null
  1101. </if>
  1102. and d.deleted_sign = 0
  1103. and d.release_status = 1
  1104. and d.audit_status = 3
  1105. </select>
  1106. <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
  1107. select
  1108. d.id,
  1109. d.employer_name as employerName,
  1110. d.serial_number as serialNumber,
  1111. d.keyword,
  1112. d.data_category as dataCategory,
  1113. d.name,
  1114. d.industry_category_a as industryCategoryA,
  1115. d.industry_category_b as industryCategoryB,
  1116. d.demand_type as demandType,
  1117. d.budget_cost as budgetCost,
  1118. d.problem_des as problemDes,
  1119. d.release_date as releaseDate,
  1120. d.technical_requirements as technicalRequirements,
  1121. d.picture_url as pictureUrl,
  1122. d.text_file_url as textFileUrl,
  1123. d.video_url as videoUrl,
  1124. d.fixed_cycle as fixedCycle,
  1125. d.people_number as peopleNumber,
  1126. d.fixed_scheme as fixedScheme,
  1127. d.cost_escrow as costEscrow,
  1128. d.validity_period as validityPeriod,
  1129. ui.username,
  1130. oi.unit_name as unitName,
  1131. di.id as demandInterestId,
  1132. do.id as demandOrderId,
  1133. do.status as orderStatus
  1134. from demand d
  1135. left join user_identity ui on ui.uid = d.employer_id
  1136. left join organization_identity oi on oi.uid = d.employer_id
  1137. left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
  1138. left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
  1139. where d.id = #{1}
  1140. </select>
  1141. <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
  1142. select
  1143. count(1)
  1144. from demand
  1145. where
  1146. deleted_sign = 0
  1147. and release_status = 1
  1148. and audit_status = 3
  1149. and employer_id = #{uid,jdbcType=VARCHAR}
  1150. </select>
  1151. <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
  1152. SELECT
  1153. id,
  1154. serial_number AS serialNumber,
  1155. data_category AS dataCategory,
  1156. NAME,
  1157. keyword,
  1158. release_date AS releaseDate,
  1159. demand_type AS demandType,
  1160. validity_period AS validityPeriod,
  1161. problem_des as problemDes,
  1162. industry_category_a as industryCategoryA,
  1163. industry_category_b as industryCategoryB,
  1164. budget_cost as budgetCost
  1165. FROM
  1166. demand
  1167. WHERE
  1168. audit_status = 3
  1169. AND release_status = 1
  1170. AND deleted_sign = 0
  1171. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1172. </select>
  1173. <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1174. SELECT
  1175. count(1)
  1176. FROM
  1177. demand
  1178. WHERE
  1179. audit_status = 3
  1180. AND release_status = 1
  1181. AND deleted_sign = 0
  1182. AND employer_id = #{employerId,jdbcType=VARCHAR}
  1183. </select>
  1184. <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1185. SELECT
  1186. d.id,
  1187. d.name,
  1188. d.keyword,
  1189. d.validity_period as validityPeriod,
  1190. d.industry_category_a AS industryCategoryA,
  1191. d.picture_url as pictureUrl,
  1192. d.employer_contacts_mobile as employerContactsMobile,
  1193. d.data_category as dataCategory,
  1194. fg.name AS industryCategoryAS,
  1195. fgg.name AS industryCategorBS,
  1196. d.budget_cost AS budgetCost,
  1197. d.problem_des AS problemDes,
  1198. dg.name AS province,
  1199. dgg.name AS city,
  1200. interest.id as interestId,
  1201. d.employer_name as employerName,
  1202. u.lvl as level
  1203. FROM
  1204. demand d
  1205. LEFT JOIN `user` u on u.id = d.employer_id
  1206. LEFT JOIN user_identity ui on ui.uid = d.employer_id
  1207. LEFT JOIN district_glossory dg ON dg.id = ui.province
  1208. LEFT JOIN district_glossory dgg ON dgg.id = ui.city
  1209. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1210. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1211. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1212. WHERE
  1213. d.id = #{id,jdbcType=VARCHAR}
  1214. </select>
  1215. <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
  1216. SELECT
  1217. d.id,
  1218. d.name,
  1219. d.keyword,
  1220. d.picture_url as pictureUrl,
  1221. d.validity_period as validityPeriod,
  1222. d.employer_contacts_mobile as employerContactsMobile,
  1223. d.data_category as dataCategory,
  1224. d.industry_category_a AS industryCategoryA,
  1225. fg.name AS industryCategoryAS,
  1226. fgg.name AS industryCategoryBS,
  1227. d.budget_cost AS budgetCost,
  1228. d.problem_des AS problemDes,
  1229. dg.name AS province,
  1230. dgg.name AS city,
  1231. interest.id as interestId,
  1232. d.employer_name as employerName,
  1233. u.lvl as level
  1234. FROM
  1235. demand d
  1236. LEFT JOIN `user` u on u.id = d.employer_id
  1237. LEFT JOIN organization_identity oi on oi.uid = d.employer_id
  1238. LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
  1239. LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
  1240. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1241. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1242. LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
  1243. WHERE
  1244. d.id = #{id,jdbcType=VARCHAR}
  1245. </select>
  1246. <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
  1247. select
  1248. d.id,
  1249. d.name,
  1250. fg.name as industryCategoryAS,
  1251. fgg.name as industryCategoryBS,
  1252. d.problem_des as problemDes,
  1253. d.budget_cost as budgetCost,
  1254. u.lvl as level
  1255. from
  1256. demand d
  1257. left join user u on u.id = d.employer_id
  1258. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1259. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1260. where
  1261. d.audit_status = 3
  1262. and d.release_status = 1
  1263. and d.deleted_sign = 0
  1264. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1265. and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
  1266. order by d.serial_number desc
  1267. limit 5
  1268. </select>
  1269. <update id="updateEmployerId" parameterType="java.lang.String" >
  1270. update demand set employer_id = null
  1271. where id = #{id,jdbcType=VARCHAR}
  1272. </update>
  1273. <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
  1274. select
  1275. a.id,a.name,
  1276. b.name as industryCatalog,
  1277. a.picture_url as pictureUrl,
  1278. a.problem_des as sketch,
  1279. a.data_category as ownerType,
  1280. a.employer_name as personName
  1281. from
  1282. demand a
  1283. left join field_glossory b on a.industry_category_a = b.id
  1284. where
  1285. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1286. <if test="industryCategoryA != null and industryCategoryA != ''">
  1287. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1288. </if>
  1289. order by
  1290. a.create_time desc
  1291. <if test="page_sql!=null">
  1292. ${page_sql}
  1293. </if>
  1294. </select>
  1295. <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  1296. select
  1297. count(1)
  1298. from
  1299. demand a
  1300. left
  1301. join field_glossory b
  1302. on
  1303. a.industry_category_a = b.id
  1304. where
  1305. a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
  1306. <if test="industryCategoryA != null and industryCategoryA != ''">
  1307. and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1308. </if>
  1309. </select>
  1310. <!-- 查询需求列表 -->
  1311. <select id="selectDemandList"
  1312. resultType="com.goafanti.demand.bo.DemandListBo">
  1313. SELECT
  1314. d.id,
  1315. d.name,
  1316. d.keyword,
  1317. d.data_category as dataCategory,
  1318. d.fixed_budget as fixedbudget,
  1319. d.demand_type as demandType,
  1320. d.picture_url as pictureUrl,
  1321. d.industry_category_a AS industryCategoryA,
  1322. fg.name AS
  1323. industryCategoryAS,
  1324. fgg.name AS industryCategorBS,
  1325. d.budget_cost AS
  1326. budgetCost,
  1327. d.problem_des AS problemDes,
  1328. dg.name AS
  1329. province,
  1330. dgg.name AS
  1331. city,
  1332. d.employer_name as
  1333. employerName,
  1334. u.lvl as
  1335. level
  1336. FROM
  1337. demand d
  1338. LEFT JOIN `user` u on u.id = d.employer_id
  1339. LEFT JOIN
  1340. user_identity ui on ui.uid = d.employer_id
  1341. LEFT JOIN district_glossory
  1342. dg ON dg.id = ui.province
  1343. LEFT JOIN district_glossory dgg ON dgg.id =
  1344. ui.city
  1345. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1346. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1347. WHERE
  1348. <if test="_parameter!= null">
  1349. d.boutique = #{_parameter,jdbcType=INTEGER}
  1350. </if>
  1351. limit 0,30
  1352. </select>
  1353. <!-- 猜你喜欢 -->
  1354. <select id="selectCsutomerLike"
  1355. resultType="com.goafanti.demand.bo.DemandListBo">
  1356. SELECT
  1357. d.id,
  1358. d.name,
  1359. d.keyword,
  1360. d.data_category as dataCategory,
  1361. d.fixed_budget as fixedbudget,
  1362. d.demand_type as demandType,
  1363. d.picture_url as pictureUrl,
  1364. d.industry_category_a AS industryCategoryA,
  1365. fg.name AS
  1366. industryCategoryAS,
  1367. fgg.name AS industryCategorBS,
  1368. d.budget_cost AS
  1369. budgetCost,
  1370. d.problem_des AS problemDes,
  1371. dg.name AS
  1372. province,
  1373. dgg.name AS
  1374. city,
  1375. d.employer_name as
  1376. employerName,
  1377. u.lvl as
  1378. level
  1379. FROM
  1380. demand d
  1381. LEFT JOIN `user` u on u.id = d.employer_id
  1382. LEFT JOIN
  1383. user_identity ui on ui.uid = d.employer_id
  1384. LEFT JOIN district_glossory
  1385. dg ON dg.id = ui.province
  1386. LEFT JOIN district_glossory dgg ON dgg.id =
  1387. ui.city
  1388. LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
  1389. LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
  1390. LEFT JOIN demand_interest interest on interest.demand_id = d.id
  1391. where
  1392. interest.uid = #{uid,jdbcType=INTEGER}
  1393. limit 0,4
  1394. </select>
  1395. <select id="countInterest" resultType="Integer">
  1396. select count(0)
  1397. from demand_interest
  1398. where demand_id = #{demandId,jdbcType=VARCHAR}
  1399. </select>
  1400. <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  1401. select
  1402. d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
  1403. 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,
  1404. d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
  1405. d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
  1406. 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
  1407. from demand d
  1408. left join user_identity t on d.employer_id=t.uid
  1409. left join field_glossory g on d.industry_category_a=g.id
  1410. left join field_glossory g2 on d.industry_category_b=g2.id
  1411. left join (select count(0) as countInterest ,demand_id from demand_interest
  1412. group by demand_id) t on d.id=t.demand_id
  1413. where d.deleted_sign = 0
  1414. and d.audit_status=3
  1415. <if test="employerId != null">
  1416. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1417. </if>
  1418. <if test="serialNumber != null">
  1419. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1420. </if>
  1421. <if test="auditStatus != null">
  1422. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1423. </if>
  1424. <if test="name != null">
  1425. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1426. </if>
  1427. <if test="keyword != null">
  1428. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1429. </if>
  1430. <if test="demandType != null">
  1431. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1432. </if>
  1433. <if test="industryCategoryA != null">
  1434. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1435. </if>
  1436. <if test="status != null">
  1437. and d.status = #{status,jdbcType=VARCHAR}
  1438. </if>
  1439. <if test="releaseStatus != null">
  1440. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1441. </if>
  1442. <if test="vStart != null">
  1443. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1444. </if>
  1445. <if test="vEnd != null">
  1446. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1447. </if>
  1448. <if test="rStart != null">
  1449. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1450. </if>
  1451. <if test="rEnd != null">
  1452. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1453. </if>
  1454. order by d.boutique desc
  1455. <if test="page_sql!=null">
  1456. ${page_sql}
  1457. </if>
  1458. </select>
  1459. <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
  1460. select count(1)
  1461. from demand d
  1462. where d.deleted_sign = 0
  1463. <if test="employerId != null">
  1464. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1465. </if>
  1466. <if test="serialNumber != null">
  1467. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1468. </if>
  1469. <if test="auditStatus != null">
  1470. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1471. </if>
  1472. <if test="industryCategoryA != null">
  1473. and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
  1474. </if>
  1475. <if test="name != null">
  1476. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1477. </if>
  1478. <if test="keyword != null">
  1479. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1480. </if>
  1481. <if test="demandType != null">
  1482. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1483. </if>
  1484. <if test="status != null">
  1485. and d.status = #{status,jdbcType=VARCHAR}
  1486. </if>
  1487. <if test="releaseStatus != null">
  1488. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1489. </if>
  1490. <if test="vStart != null">
  1491. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1492. </if>
  1493. <if test="vEnd != null">
  1494. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1495. </if>
  1496. <if test="rStart != null">
  1497. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1498. </if>
  1499. <if test="rEnd != null">
  1500. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1501. </if>
  1502. </select>
  1503. <select id="demandInterest" resultType="com.goafanti.demand.bo.DemandInterestBo">
  1504. select
  1505. d.id,d.name,di.create_time as createTime
  1506. from demand_interest di
  1507. LEFT join demand d on di.demand_id=d.id
  1508. where uid=#{uid,jdbcType=VARCHAR}
  1509. </select>
  1510. <select id="findAppMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
  1511. select
  1512. d.id, d.boutique,d.name, d.audit_status as auditStatus,ifnull(t.x,0) as orderCount,
  1513. d.release_date as releaseDate,ifnull(i.y,0) as countInterest
  1514. from demand d
  1515. left join (select count(0) as x,commodity_id from t_order
  1516. where order_status != 4 and order_status != 0
  1517. group by commodity_id ) t on d.id=t.commodity_id
  1518. left join (select count(0) as y,demand_id from demand_interest
  1519. group by demand_id ) i on d.id=i.demand_id
  1520. where d.deleted_sign = 0
  1521. <if test="employerId != null">
  1522. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1523. </if>
  1524. order by d.serial_number desc
  1525. <if test="page_sql!=null">
  1526. ${page_sql}
  1527. </if>
  1528. </select>
  1529. <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  1530. select count(1)
  1531. from demand d
  1532. where d.deleted_sign = 0
  1533. <if test="employerId != null">
  1534. and d.employer_id = #{employerId, jdbcType=VARCHAR}
  1535. </if>
  1536. </select>
  1537. <select id="selectDemandDetail" resultMap="BaseResultMap" parameterType="java.lang.String" >
  1538. select
  1539. d.id, d.serial_number AS serialNumber, d.data_category AS serialNumber,d.name, d.keyword, d.info_sources AS infoSources, d.industry_category_a AS industryCategoryA,
  1540. d.industry_category_b AS industryCategoryB, d.industry_category_c AS industryCategoryC, d.demand_type AS demandType, d.problem_des AS problemDes, d.technical_requirements AS technicalRequirements,
  1541. d.picture_url AS pictureUrl, d.text_file_url AS textFileUrl, d.video_url AS videoUrl, d.fixed_budget AS fixedBudget, d.fixed_cycle AS fixedCycle, d.people_number AS peopleNumber,
  1542. d.fixed_scheme as fixedScheme, d.cost_escrow AS costEscrow, d.budget_cost AS budgetCost, d.validity_period AS validityPeriod, d.employer_id AS employerId, d.employer_name AS employerName,
  1543. d.employer_address as employerAddress, d.employer_contacts as employerContacts, d.employer_contacts_mobile as employerContactsMobile, d.employer_contacts_mailbox as employerContactsMailbox,
  1544. d.contacts, d.status,d.release_status as releaseStatus, d.release_date as releaseDate, d.create_time as createTime, d.principal_id as principalId, d.deleted_sign as deletedSign,j.easemob_name as easemobName,
  1545. d.audit_status as auditStatus, d.tech_broker_id as techBrokerId,d.boutique,d.urgent_money as urgentMoney,d.urgent_days as urgentDays
  1546. from demand d
  1547. left join jpush_easemob_account j on d.employer_id=j.uid
  1548. where d.id = #{id,jdbcType=VARCHAR}
  1549. </select>
  1550. <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1551. select n.id,n.title as name,n.create_time as createTime
  1552. from news_interest ni
  1553. LEFT join news n on ni.new_id=n.id
  1554. where ni.uid=#{uid,jdbcType=VARCHAR}
  1555. order by createTime desc
  1556. <if test="page_sql!=null">
  1557. ${page_sql}
  1558. </if>
  1559. </select>
  1560. <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
  1561. select count(1)
  1562. from news_interest ni
  1563. LEFT join news n on ni.new_id=n.id
  1564. where ni.uid=#{uid,jdbcType=VARCHAR}
  1565. </select>
  1566. <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1567. select y.uid as id,y.username as name ,t.create_time as createTime
  1568. from user_interest t
  1569. left join user_identity y on t.to_uid=y.uid
  1570. where expert=1
  1571. and from_uid=#{uid,jdbcType=VARCHAR}
  1572. <if test="page_sql!=null">
  1573. ${page_sql}
  1574. </if>
  1575. </select>
  1576. <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
  1577. select count(1)
  1578. from user_interest t
  1579. left join user_identity y on t.to_uid=y.uid
  1580. where from_uid=#{uid,jdbcType=VARCHAR}
  1581. </select>
  1582. <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1583. select d.id ,d.name,t.create_time as createTime
  1584. from demand_interest t
  1585. left join demand d on t.demand_id=d.id
  1586. where t.uid=#{uid,jdbcType=VARCHAR}
  1587. <if test="page_sql!=null">
  1588. ${page_sql}
  1589. </if>
  1590. </select>
  1591. <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
  1592. select count(1)
  1593. from demand_interest t
  1594. left join demand d on t.demand_id=d.id
  1595. where uid=#{uid,jdbcType=VARCHAR}
  1596. </select>
  1597. <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1598. select a.id ,a.name,t.create_time as createTime
  1599. from achievement_interest t
  1600. left join achievement a on t.achievement_id=a.id
  1601. where t.uid=#{uid,jdbcType=VARCHAR}
  1602. <if test="page_sql!=null">
  1603. ${page_sql}
  1604. </if>
  1605. </select>
  1606. <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
  1607. select count(1)
  1608. from achievement_interest t
  1609. left join achievement a on t.achievement_id=a.id
  1610. where t.uid=#{uid,jdbcType=VARCHAR}
  1611. </select>
  1612. <select id="findAppProjectInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
  1613. select b.id ,b.bname as name,t.uid,t.create_time as createTime
  1614. from project_interest t
  1615. left join business_project b on t.project_id=b.id
  1616. where t.uid=#{uid,jdbcType=VARCHAR}
  1617. <if test="page_sql!=null">
  1618. ${page_sql}
  1619. </if>
  1620. </select>
  1621. <select id="findAppProjectInterestCount" parameterType="String" resultType="java.lang.Integer">
  1622. select count(1)
  1623. from project_interest t
  1624. left join business_project b on t.project_id=b.id
  1625. where t.uid=#{uid,jdbcType=VARCHAR}
  1626. </select>
  1627. <select id="findMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  1628. select
  1629. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  1630. d.name, d.keyword, d.info_sources as infoSources,
  1631. <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
  1632. d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  1633. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  1634. d.employer_id as employerId, d.audit_status as auditStatus,
  1635. d.tech_broker_id as techBrokerId,d.boutique
  1636. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1637. ,1 as hot
  1638. </if>
  1639. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1640. ,0 as hot
  1641. </if>
  1642. <if test="hot==null"><!-- 无首页参数 -->
  1643. ,ifnull(mm.effective,0) as hot
  1644. </if>
  1645. from demand d
  1646. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1647. LEFT JOIN admin a on a.id = d.tech_broker_id
  1648. <if test="adminId != null">
  1649. LEFT JOIN user u on d.employer_id = u.id
  1650. </if>
  1651. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1652. inner join marketing_management mm on d.id = mm.product_id
  1653. </if>
  1654. <if test="hot == null"> <!-- 无首页参数 -->
  1655. left join marketing_management mm on d.id = mm.product_id
  1656. </if>
  1657. where d.deleted_sign = 0
  1658. <if test="techBrokerId != null">
  1659. and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1660. </if>
  1661. <if test="dataCategory != null">
  1662. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1663. </if>
  1664. <if test="adminId != null">
  1665. and (u.mid = #{adminId,jdbcType=VARCHAR}
  1666. </if>
  1667. <if test="adminId != null">
  1668. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  1669. </if>
  1670. <if test="adminId != null">
  1671. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  1672. )
  1673. </if>
  1674. <!-- <if test="province != null">
  1675. and oi.licence_province = #{province,jdbcType=INTEGER}
  1676. </if> -->
  1677. <if test="serialNumber != null">
  1678. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1679. </if>
  1680. <if test="auditStatus != null">
  1681. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1682. </if>
  1683. <if test="name != null">
  1684. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1685. </if>
  1686. <if test="keyword != null">
  1687. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  1688. </if>
  1689. <!-- <if test="unitName != null">
  1690. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1691. </if> -->
  1692. <if test="employerName != null">
  1693. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1694. and (d.employer_id is null or d.employer_id='')
  1695. </if>
  1696. <if test="infoSources != null">
  1697. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1698. </if>
  1699. <if test="demandType != null">
  1700. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1701. </if>
  1702. <if test="status != null">
  1703. and d.status = #{status,jdbcType=INTEGER}
  1704. </if>
  1705. <if test="releaseStatus != null">
  1706. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1707. </if>
  1708. <if test="vStart != null">
  1709. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1710. </if>
  1711. <if test="vEnd != null">
  1712. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1713. </if>
  1714. <if test="rStart != null">
  1715. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1716. </if>
  1717. <if test="rEnd != null">
  1718. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1719. </if>
  1720. <if test="cStart != null">
  1721. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1722. </if>
  1723. <if test="cEnd != null">
  1724. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1725. </if>
  1726. <if test="boutique != null">
  1727. and d.boutique = #{boutique,jdbcType=INTEGER}
  1728. </if>
  1729. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1730. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1731. </if>
  1732. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1733. and mm.effective = 1
  1734. </if>
  1735. order by d.serial_number desc
  1736. <if test="page_sql!=null">
  1737. ${page_sql}
  1738. </if>
  1739. </select>
  1740. <select id ="findMyDemandCount" parameterType="String" resultType="java.lang.Integer">
  1741. select
  1742. count(1)
  1743. from demand d
  1744. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1745. LEFT JOIN admin a on a.id = d.tech_broker_id
  1746. <if test="adminId != null">
  1747. LEFT JOIN user u on d.employer_id = u.id
  1748. </if>
  1749. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1750. inner join marketing_management mm on d.id = mm.product_id
  1751. </if>
  1752. <if test="hot == null"> <!-- 无首页参数 -->
  1753. left join marketing_management mm on d.id = mm.product_id
  1754. </if>
  1755. where d.deleted_sign = 0
  1756. <if test="techBrokerId != null">
  1757. and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
  1758. </if>
  1759. <if test="dataCategory != null">
  1760. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1761. </if>
  1762. <if test="adminId != null">
  1763. and (u.mid = #{adminId,jdbcType=VARCHAR}
  1764. </if>
  1765. <if test="adminId != null">
  1766. or d.principal_id = #{adminId,jdbcType=VARCHAR}
  1767. </if>
  1768. <if test="adminId != null">
  1769. or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
  1770. )
  1771. </if>
  1772. <if test="serialNumber != null">
  1773. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1774. </if>
  1775. <if test="auditStatus != null">
  1776. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1777. </if>
  1778. <!-- <if test="province != null">
  1779. and oi.licence_province = #{province,jdbcType=INTEGER}
  1780. </if> -->
  1781. <if test="name != null">
  1782. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1783. </if>
  1784. <if test="keyword != null">
  1785. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1786. </if>
  1787. <!-- <if test="unitName != null">
  1788. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1789. </if> -->
  1790. <if test="employerName != null">
  1791. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1792. and (d.employer_id is null or d.employer_id='')
  1793. </if>
  1794. <if test="infoSources != null">
  1795. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1796. </if>
  1797. <if test="demandType != null">
  1798. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1799. </if>
  1800. <if test="status != null">
  1801. and d.status = #{status,jdbcType=VARCHAR}
  1802. </if>
  1803. <if test="releaseStatus != null">
  1804. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1805. </if>
  1806. <if test="vStart != null">
  1807. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1808. </if>
  1809. <if test="vEnd != null">
  1810. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1811. </if>
  1812. <if test="rStart != null">
  1813. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1814. </if>
  1815. <if test="rEnd != null">
  1816. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1817. </if>
  1818. <if test="cStart != null">
  1819. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1820. </if>
  1821. <if test="cEnd != null">
  1822. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1823. </if>
  1824. <if test="boutique != null">
  1825. and d.boutique = #{boutique,jdbcType=INTEGER}
  1826. </if>
  1827. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1828. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1829. </if>
  1830. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1831. and mm.effective = 1
  1832. </if>
  1833. </select>
  1834. <select id="findManageDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
  1835. select
  1836. d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
  1837. d.name, d.keyword, d.info_sources as infoSources,
  1838. <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
  1839. d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
  1840. d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
  1841. d.employer_id as employerId, d.audit_status as auditStatus,
  1842. d.tech_broker_id as techBrokerId,d.boutique
  1843. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1844. ,1 as hot
  1845. </if>
  1846. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1847. ,0 as hot
  1848. </if>
  1849. <if test="hot==null"><!-- 无首页参数 -->
  1850. ,ifnull(mm.effective,0) as hot
  1851. </if>
  1852. from demand d
  1853. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1854. LEFT JOIN admin a on a.id = d.tech_broker_id
  1855. LEFT JOIN department_management dm on dm.id = a.department_id
  1856. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1857. inner join marketing_management mm on d.id = mm.product_id
  1858. </if>
  1859. <if test="hot == null"> <!-- 无首页参数 -->
  1860. left join marketing_management mm on d.id = mm.product_id
  1861. </if>
  1862. where d.deleted_sign = 0
  1863. <if test="techBrokerId != null">
  1864. and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1865. </if>
  1866. <if test="dataCategory != null">
  1867. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1868. </if>
  1869. <!-- <if test="province != null">
  1870. and oi.licence_province = #{province,jdbcType=INTEGER}
  1871. </if> -->
  1872. <if test="serialNumber != null">
  1873. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1874. </if>
  1875. <if test="auditStatus != null">
  1876. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1877. </if>
  1878. <if test="name != null">
  1879. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1880. </if>
  1881. <if test="keyword != null">
  1882. and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
  1883. </if>
  1884. <!-- <if test="unitName != null">
  1885. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1886. </if> -->
  1887. <if test="employerName != null">
  1888. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1889. and (d.employer_id is null or d.employer_id='')
  1890. </if>
  1891. <if test="infoSources != null">
  1892. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1893. </if>
  1894. <if test="demandType != null">
  1895. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1896. </if>
  1897. <if test="status != null">
  1898. and d.status = #{status,jdbcType=INTEGER}
  1899. </if>
  1900. <if test="releaseStatus != null">
  1901. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1902. </if>
  1903. <if test="vStart != null">
  1904. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1905. </if>
  1906. <if test="vEnd != null">
  1907. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1908. </if>
  1909. <if test="rStart != null">
  1910. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1911. </if>
  1912. <if test="rEnd != null">
  1913. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  1914. </if>
  1915. <if test="cStart != null">
  1916. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  1917. </if>
  1918. <if test="cEnd != null">
  1919. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  1920. </if>
  1921. <if test="boutique != null">
  1922. and d.boutique = #{boutique,jdbcType=INTEGER}
  1923. </if>
  1924. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  1925. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  1926. </if>
  1927. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1928. and mm.effective = 1
  1929. </if>
  1930. order by d.serial_number desc
  1931. <if test="page_sql!=null">
  1932. ${page_sql}
  1933. </if>
  1934. </select>
  1935. <select id ="findManagegDemandCount" parameterType="String" resultType="java.lang.Integer">
  1936. select
  1937. count(1)
  1938. from demand d
  1939. <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
  1940. LEFT JOIN admin a on a.id = d.tech_broker_id
  1941. LEFT JOIN department_management dm on dm.id = a.department_id
  1942. <if test="hot != null and hot == 1"><!-- 在首页 -->
  1943. inner join marketing_management mm on d.id = mm.product_id
  1944. </if>
  1945. <if test="hot == null"> <!-- 无首页参数 -->
  1946. left join marketing_management mm on d.id = mm.product_id
  1947. </if>
  1948. where d.deleted_sign = 0
  1949. <if test="techBrokerId != null">
  1950. and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
  1951. </if>
  1952. <if test="dataCategory != null">
  1953. and d.data_category = #{dataCategory,jdbcType=VARCHAR}
  1954. </if>
  1955. <if test="serialNumber != null">
  1956. and d.serial_number = #{serialNumber,jdbcType=INTEGER}
  1957. </if>
  1958. <if test="auditStatus != null">
  1959. and d.audit_status = #{auditStatus,jdbcType=INTEGER}
  1960. </if>
  1961. <!-- <if test="province != null">
  1962. and oi.licence_province = #{province,jdbcType=INTEGER}
  1963. </if> -->
  1964. <if test="name != null">
  1965. and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1966. </if>
  1967. <if test="keyword != null">
  1968. and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
  1969. </if>
  1970. <!-- <if test="unitName != null">
  1971. and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
  1972. </if> -->
  1973. <if test="employerName != null">
  1974. and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
  1975. and (d.employer_id is null or d.employer_id='')
  1976. </if>
  1977. <if test="infoSources != null">
  1978. and d.info_sources = #{infoSources,jdbcType=INTEGER}
  1979. </if>
  1980. <if test="demandType != null">
  1981. and d.demand_type = #{demandType,jdbcType=INTEGER}
  1982. </if>
  1983. <if test="status != null">
  1984. and d.status = #{status,jdbcType=VARCHAR}
  1985. </if>
  1986. <if test="releaseStatus != null">
  1987. and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
  1988. </if>
  1989. <if test="vStart != null">
  1990. and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
  1991. </if>
  1992. <if test="vEnd != null">
  1993. and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
  1994. </if>
  1995. <if test="rStart != null">
  1996. and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
  1997. </if>
  1998. <if test="rEnd != null">
  1999. and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
  2000. </if>
  2001. <if test="cStart != null">
  2002. and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  2003. </if>
  2004. <if test="cEnd != null">
  2005. and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  2006. </if>
  2007. <if test="boutique != null">
  2008. and d.boutique = #{boutique,jdbcType=INTEGER}
  2009. </if>
  2010. <if test="hot != null and hot == 0"><!-- 不在首页 -->
  2011. and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
  2012. </if>
  2013. <if test="hot != null and hot == 1"><!-- 在首页 -->
  2014. and mm.effective = 1
  2015. </if>
  2016. </select>
  2017. </mapper>