DemandMapper.xml 81 KB

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