DemandMapper.xml 82 KB

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