| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.goafanti.common.dao.DemandMapper" >
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.Demand" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
- <result column="data_category" property="dataCategory" jdbcType="INTEGER" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="keyword" property="keyword" jdbcType="VARCHAR" />
- <result column="info_sources" property="infoSources" jdbcType="INTEGER" />
- <result column="industry_category_a" property="industryCategoryA" jdbcType="INTEGER" />
- <result column="industry_category_b" property="industryCategoryB" jdbcType="INTEGER" />
- <result column="industry_category_c" property="industryCategoryC" jdbcType="INTEGER" />
- <result column="demand_type" property="demandType" jdbcType="INTEGER" />
- <result column="problem_des" property="problemDes" jdbcType="LONGVARCHAR" />
- <result column="technical_requirements" property="technicalRequirements" jdbcType="VARCHAR" />
- <result column="picture_url" property="pictureUrl" jdbcType="LONGVARCHAR" />
- <result column="text_file_url" property="textFileUrl" jdbcType="VARCHAR" />
- <result column="video_url" property="videoUrl" jdbcType="VARCHAR" />
- <result column="fixed_budget" property="fixedBudget" jdbcType="DECIMAL" />
- <result column="fixed_cycle" property="fixedCycle" jdbcType="VARCHAR" />
- <result column="people_number" property="peopleNumber" jdbcType="INTEGER" />
- <result column="fixed_scheme" property="fixedScheme" jdbcType="VARCHAR" />
- <result column="cost_escrow" property="costEscrow" jdbcType="DECIMAL" />
- <result column="budget_cost" property="budgetCost" jdbcType="DECIMAL" />
- <result column="validity_period" property="validityPeriod" jdbcType="TIMESTAMP" />
- <result column="employer_id" property="employerId" jdbcType="VARCHAR" />
- <result column="employer_name" property="employerName" jdbcType="VARCHAR" />
- <result column="employer_address" property="employerAddress" jdbcType="VARCHAR" />
- <result column="employer_contacts" property="employerContacts" jdbcType="VARCHAR" />
- <result column="employer_contacts_mobile" property="employerContactsMobile" jdbcType="VARCHAR" />
- <result column="employer_contacts_mailbox" property="employerContactsMailbox" jdbcType="VARCHAR" />
- <result column="contacts" property="contacts" jdbcType="INTEGER" />
- <result column="status" property="status" jdbcType="INTEGER" />
- <result column="release_status" property="releaseStatus" jdbcType="INTEGER" />
- <result column="release_date" property="releaseDate" jdbcType="TIMESTAMP" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="principal_id" property="principalId" jdbcType="VARCHAR" />
- <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
- <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
- <result column="tech_broker_id" property="techBrokerId" jdbcType="VARCHAR" />
- <result column="boutique" property="boutique" jdbcType="INTEGER" />
- <result column="uid" property="uid" jdbcType="VARCHAR" />
- <result column="urgent_days" property="urgentDays" jdbcType="INTEGER" />
- <result column="urgent_money" property="urgentMoney" jdbcType="DECIMAL" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, serial_number, data_category, name, keyword, info_sources, industry_category_a,
- industry_category_b, industry_category_c, demand_type, problem_des, technical_requirements,
- picture_url, text_file_url, video_url, fixed_budget, fixed_cycle, people_number,
- fixed_scheme, cost_escrow, budget_cost, validity_period, employer_id, employer_name,
- employer_address, employer_contacts, employer_contacts_mobile, employer_contacts_mailbox,
- contacts, status, release_status, release_date, create_time, principal_id, deleted_sign,
- audit_status, tech_broker_id,boutique,urgent_money,urgent_days
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from demand
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <select id="selectAppByPrimaryKey" resultType="com.goafanti.demand.bo.DemandListBo" parameterType="java.lang.String" >
- select
- 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,
- 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,
- 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,
- 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,
- d.employer_address AS employerAddress, d.employer_contacts AS employerContacts, d.employer_contacts_mobile AS employerContactsMobile, d.employer_contacts_mailbox AS employerContactsMailbox,
- 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,
- d.audit_status AS auditStatus, d.tech_broker_id AS techBrokerId,d.boutique,d.urgent_money AS urgentMoney,d.urgent_days as urgentDays
- ,ifnull(t.x,0) as orderIntentionCount,ifnull(t2.x,0) as orderCount,j.easemob_name as easemobName
- from demand d
- left join jpush_easemob_account j on d.employer_id=j.uid
- left join (select count(0) as x,tl.commodity_id from t_order tr
- left join t_order_detail tl on tl.order_no=tr.order_no
- where order_status != 4
- group by tl.commodity_id) t on d.id=t.commodity_id
- left join (select count(0) as x,tl.commodity_id from t_order tr
- left join t_order_detail tl on tl.order_no=tr.order_no
- where tr.order_status != 4 and tr.order_status != 0
- group by tl.commodity_id ) t2 on d.id=t2.commodity_id
- where d.id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from demand
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.Demand" >
- insert into demand (id, serial_number, data_category,
- name, keyword, info_sources,
- industry_category_a, industry_category_b, industry_category_c,
- demand_type, problem_des, technical_requirements,
- picture_url, text_file_url, video_url,
- fixed_budget, fixed_cycle, people_number,
- fixed_scheme, cost_escrow, budget_cost,
- validity_period, employer_id, employer_name,
- employer_address, employer_contacts, employer_contacts_mobile,
- employer_contacts_mailbox, contacts, status,
- release_status, release_date, create_time,
- principal_id, deleted_sign, audit_status, tech_broker_id,boutique,remark,urgent_days,urgent_money)
- values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER},
- #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{infoSources,jdbcType=INTEGER},
- #{industryCategoryA,jdbcType=INTEGER}, #{industryCategoryB,jdbcType=INTEGER}, #{industryCategoryC,jdbcType=INTEGER},
- #{demandType,jdbcType=INTEGER}, #{problemDes,jdbcType=VARCHAR}, #{technicalRequirements,jdbcType=VARCHAR},
- #{pictureUrl,jdbcType=LONGVARCHAR}, #{textFileUrl,jdbcType=VARCHAR}, #{videoUrl,jdbcType=VARCHAR},
- #{fixedBudget,jdbcType=DECIMAL}, #{fixedCycle,jdbcType=VARCHAR}, #{peopleNumber,jdbcType=INTEGER},
- #{fixedScheme,jdbcType=VARCHAR}, #{costEscrow,jdbcType=DECIMAL}, #{budgetCost,jdbcType=DECIMAL},
- #{validityPeriod,jdbcType=TIMESTAMP}, #{employerId,jdbcType=VARCHAR}, #{employerName,jdbcType=VARCHAR},
- #{employerAddress,jdbcType=VARCHAR}, #{employerContacts,jdbcType=VARCHAR}, #{employerContactsMobile,jdbcType=VARCHAR},
- #{employerContactsMailbox,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
- #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
- #{principalId,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
- #{techBrokerId,jdbcType=VARCHAR},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{urgentDays,jdbcType=VARCHAR},#{urgentMoney,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Demand" >
- insert into demand
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="serialNumber != null" >
- serial_number,
- </if>
- <if test="dataCategory != null" >
- data_category,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="keyword != null" >
- keyword,
- </if>
- <if test="infoSources != null" >
- info_sources,
- </if>
- <if test="industryCategoryA != null" >
- industry_category_a,
- </if>
- <if test="industryCategoryB != null" >
- industry_category_b,
- </if>
- <if test="industryCategoryC != null" >
- industry_category_c,
- </if>
- <if test="demandType != null" >
- demand_type,
- </if>
- <if test="problemDes != null" >
- problem_des,
- </if>
- <if test="technicalRequirements != null" >
- technical_requirements,
- </if>
- <if test="pictureUrl != null" >
- picture_url,
- </if>
- <if test="textFileUrl != null" >
- text_file_url,
- </if>
- <if test="videoUrl != null" >
- video_url,
- </if>
- <if test="fixedBudget != null" >
- fixed_budget,
- </if>
- <if test="fixedCycle != null" >
- fixed_cycle,
- </if>
- <if test="peopleNumber != null" >
- people_number,
- </if>
- <if test="fixedScheme != null" >
- fixed_scheme,
- </if>
- <if test="costEscrow != null" >
- cost_escrow,
- </if>
- <if test="budgetCost != null" >
- budget_cost,
- </if>
- <if test="validityPeriod != null" >
- validity_period,
- </if>
- <if test="employerId != null" >
- employer_id,
- </if>
- <if test="employerName != null" >
- employer_name,
- </if>
- <if test="employerAddress != null" >
- employer_address,
- </if>
- <if test="employerContacts != null" >
- employer_contacts,
- </if>
- <if test="employerContactsMobile != null" >
- employer_contacts_mobile,
- </if>
- <if test="employerContactsMailbox != null" >
- employer_contacts_mailbox,
- </if>
- <if test="contacts != null" >
- contacts,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="releaseStatus != null" >
- release_status,
- </if>
- <if test="releaseDate != null" >
- release_date,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="principalId != null" >
- principal_id,
- </if>
- <if test="deletedSign != null" >
- deleted_sign,
- </if>
- <if test="auditStatus != null" >
- audit_status,
- </if>
- <if test="techBrokerId != null" >
- tech_broker_id,
- </if>
- <if test="boutique != null" >
- boutique,
- </if>
- <if test="remark != null" >
- remark,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="serialNumber != null" >
- #{serialNumber,jdbcType=INTEGER},
- </if>
- <if test="dataCategory != null" >
- #{dataCategory,jdbcType=INTEGER},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="keyword != null" >
- #{keyword,jdbcType=VARCHAR},
- </if>
- <if test="infoSources != null" >
- #{infoSources,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryA != null" >
- #{industryCategoryA,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryB != null" >
- #{industryCategoryB,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryC != null" >
- #{industryCategoryC,jdbcType=INTEGER},
- </if>
- <if test="demandType != null" >
- #{demandType,jdbcType=INTEGER},
- </if>
- <if test="problemDes != null" >
- #{problemDes,jdbcType=VARCHAR},
- </if>
- <if test="technicalRequirements != null" >
- #{technicalRequirements,jdbcType=VARCHAR},
- </if>
- <if test="pictureUrl != null" >
- #{pictureUrl,jdbcType=LONGVARCHAR},
- </if>
- <if test="textFileUrl != null" >
- #{textFileUrl,jdbcType=VARCHAR},
- </if>
- <if test="videoUrl != null" >
- #{videoUrl,jdbcType=VARCHAR},
- </if>
- <if test="fixedBudget != null" >
- #{fixedBudget,jdbcType=DECIMAL},
- </if>
- <if test="fixedCycle != null" >
- #{fixedCycle,jdbcType=VARCHAR},
- </if>
- <if test="peopleNumber != null" >
- #{peopleNumber,jdbcType=INTEGER},
- </if>
- <if test="fixedScheme != null" >
- #{fixedScheme,jdbcType=VARCHAR},
- </if>
- <if test="costEscrow != null" >
- #{costEscrow,jdbcType=DECIMAL},
- </if>
- <if test="budgetCost != null" >
- #{budgetCost,jdbcType=DECIMAL},
- </if>
- <if test="validityPeriod != null" >
- #{validityPeriod,jdbcType=TIMESTAMP},
- </if>
- <if test="employerId != null" >
- #{employerId,jdbcType=VARCHAR},
- </if>
- <if test="employerName != null" >
- #{employerName,jdbcType=VARCHAR},
- </if>
- <if test="employerAddress != null" >
- #{employerAddress,jdbcType=VARCHAR},
- </if>
- <if test="employerContacts != null" >
- #{employerContacts,jdbcType=VARCHAR},
- </if>
- <if test="employerContactsMobile != null" >
- #{employerContactsMobile,jdbcType=VARCHAR},
- </if>
- <if test="employerContactsMailbox != null" >
- #{employerContactsMailbox,jdbcType=VARCHAR},
- </if>
- <if test="contacts != null" >
- #{contacts,jdbcType=INTEGER},
- </if>
- <if test="status != null" >
- #{status,jdbcType=INTEGER},
- </if>
- <if test="releaseStatus != null" >
- #{releaseStatus,jdbcType=INTEGER},
- </if>
- <if test="releaseDate != null" >
- #{releaseDate,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="principalId != null" >
- #{principalId,jdbcType=VARCHAR},
- </if>
- <if test="deletedSign != null" >
- #{deletedSign,jdbcType=INTEGER},
- </if>
- <if test="auditStatus != null" >
- #{auditStatus,jdbcType=INTEGER},
- </if>
- <if test="techBrokerId != null" >
- #{techBrokerId,jdbcType=VARCHAR},
- </if>
- <if test="boutique != null" >
- #{boutique,jdbcType=INTEGER},
- </if>
- <if test="remark != null" >
- #{remark,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Demand" >
- update demand
- <set >
- <if test="serialNumber != null" >
- serial_number = #{serialNumber,jdbcType=INTEGER},
- </if>
- <if test="dataCategory != null" >
- data_category = #{dataCategory,jdbcType=INTEGER},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="keyword != null" >
- keyword = #{keyword,jdbcType=VARCHAR},
- </if>
- <if test="infoSources != null" >
- info_sources = #{infoSources,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryA != null" >
- industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryB != null" >
- industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
- </if>
- <if test="industryCategoryC != null" >
- industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
- </if>
- <if test="demandType != null" >
- demand_type = #{demandType,jdbcType=INTEGER},
- </if>
- <if test="problemDes != null" >
- problem_des = #{problemDes,jdbcType=VARCHAR},
- </if>
- <if test="technicalRequirements != null" >
- technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
- </if>
- <if test="pictureUrl != null" >
- picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
- </if>
- <if test="textFileUrl != null" >
- text_file_url = #{textFileUrl,jdbcType=VARCHAR},
- </if>
- <if test="videoUrl != null" >
- video_url = #{videoUrl,jdbcType=VARCHAR},
- </if>
- <if test="fixedBudget != null" >
- fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
- </if>
- <if test="fixedCycle != null" >
- fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
- </if>
- <if test="peopleNumber != null" >
- people_number = #{peopleNumber,jdbcType=INTEGER},
- </if>
- <if test="fixedScheme != null" >
- fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
- </if>
- <if test="costEscrow != null" >
- cost_escrow = #{costEscrow,jdbcType=DECIMAL},
- </if>
- <if test="budgetCost != null" >
- budget_cost = #{budgetCost,jdbcType=DECIMAL},
- </if>
- <if test="validityPeriod != null" >
- validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
- </if>
- <if test="employerId != null" >
- employer_id = #{employerId,jdbcType=VARCHAR},
- </if>
- <if test="employerName != null" >
- employer_name = #{employerName,jdbcType=VARCHAR},
- </if>
- <if test="employerAddress != null" >
- employer_address = #{employerAddress,jdbcType=VARCHAR},
- </if>
- <if test="employerContacts != null" >
- employer_contacts = #{employerContacts,jdbcType=VARCHAR},
- </if>
- <if test="employerContactsMobile != null" >
- employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
- </if>
- <if test="employerContactsMailbox != null" >
- employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
- </if>
- <if test="contacts != null" >
- contacts = #{contacts,jdbcType=INTEGER},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="releaseStatus != null" >
- release_status = #{releaseStatus,jdbcType=INTEGER},
- </if>
- <if test="releaseDate != null" >
- release_date = #{releaseDate,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="principalId != null" >
- principal_id = #{principalId,jdbcType=VARCHAR},
- </if>
- <if test="deletedSign != null" >
- deleted_sign = #{deletedSign,jdbcType=INTEGER},
- </if>
- <if test="auditStatus != null" >
- audit_status = #{auditStatus,jdbcType=INTEGER},
- </if>
- <if test="techBrokerId != null" >
- tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
- </if>
- <if test="boutique != null">
- boutique = #{boutique,jdbcType=INTEGER},
- </if>
- <if test="remark != null" >
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="urgentDays != null" >
- urgent_days = #{urgentDays,jdbcType=VARCHAR},
- </if>
- <if test="urgentMoney != null" >
- urgent_money = #{urgentMoney,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Demand" >
- update demand
- set serial_number = #{serialNumber,jdbcType=INTEGER},
- data_category = #{dataCategory,jdbcType=INTEGER},
- name = #{name,jdbcType=VARCHAR},
- keyword = #{keyword,jdbcType=VARCHAR},
- info_sources = #{infoSources,jdbcType=INTEGER},
- industry_category_a = #{industryCategoryA,jdbcType=INTEGER},
- industry_category_b = #{industryCategoryB,jdbcType=INTEGER},
- industry_category_c = #{industryCategoryC,jdbcType=INTEGER},
- demand_type = #{demandType,jdbcType=INTEGER},
- problem_des = #{problemDes,jdbcType=VARCHAR},
- technical_requirements = #{technicalRequirements,jdbcType=VARCHAR},
- picture_url = #{pictureUrl,jdbcType=LONGVARCHAR},
- text_file_url = #{textFileUrl,jdbcType=VARCHAR},
- video_url = #{videoUrl,jdbcType=VARCHAR},
- fixed_budget = #{fixedBudget,jdbcType=DECIMAL},
- fixed_cycle = #{fixedCycle,jdbcType=VARCHAR},
- people_number = #{peopleNumber,jdbcType=INTEGER},
- fixed_scheme = #{fixedScheme,jdbcType=VARCHAR},
- cost_escrow = #{costEscrow,jdbcType=DECIMAL},
- budget_cost = #{budgetCost,jdbcType=DECIMAL},
- validity_period = #{validityPeriod,jdbcType=TIMESTAMP},
- employer_id = #{employerId,jdbcType=VARCHAR},
- employer_name = #{employerName,jdbcType=VARCHAR},
- employer_address = #{employerAddress,jdbcType=VARCHAR},
- employer_contacts = #{employerContacts,jdbcType=VARCHAR},
- employer_contacts_mobile = #{employerContactsMobile,jdbcType=VARCHAR},
- employer_contacts_mailbox = #{employerContactsMailbox,jdbcType=VARCHAR},
- contacts = #{contacts,jdbcType=INTEGER},
- status = #{status,jdbcType=INTEGER},
- release_status = #{releaseStatus,jdbcType=INTEGER},
- release_date = #{releaseDate,jdbcType=TIMESTAMP},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- principal_id = #{principalId,jdbcType=VARCHAR},
- deleted_sign = #{deletedSign,jdbcType=INTEGER},
- audit_status = #{auditStatus,jdbcType=INTEGER},
- tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
- boutique = #{boutique,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="findManageUserDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
- d.employer_name as employerName, ui.province, d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
- d.employer_id as employerId, d.audit_status as auditStatus,d.boutique
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- ,1 as hot
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- ,0 as hot
- </if>
- <if test="hot==null"><!-- 无首页参数 -->
- ,ifnull(mm.effective,0) as hot
- </if>
- from demand d
- LEFT JOIN user_identity ui on d.employer_id = ui.uid
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="adminId != null">
- LEFT JOIN user u on d.employer_id = u.id
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0 and d.data_category = 0
- <if test="adminId != null">
- and (u.mid = #{adminId,jdbcType=VARCHAR}
- or d.principal_id = #{adminId,jdbcType=VARCHAR}
- or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
- )
- </if>
- <if test="province != null">
- and ui.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=INTEGER}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from demand d
- LEFT JOIN user_identity ui on d.employer_id = ui.uid
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="adminId != null">
- LEFT JOIN user u on d.employer_id = u.id
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0 and d.data_category = 0
- <if test="adminId != null">
- and (u.mid = #{adminId,jdbcType=VARCHAR}
- or d.principal_id = #{adminId,jdbcType=VARCHAR}
- or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
- )
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="province != null">
- and ui.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=INTEGER}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ > ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- </select>
-
- <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- d.demand_type as demandType, d.validity_period as validityPeriod,
- d.employer_name as employerName,d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
- d.employer_id as employerId, d.audit_status as auditStatus,
- d.tech_broker_id as techBrokerIdd,d.boutique
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- ,1 as hot
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- ,0 as hot
- </if>
- <if test="hot==null"><!-- 无首页参数 -->
- ,ifnull(mm.effective,0) as hot
- </if>
- from demand d
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
- </if>
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from demand d
- <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- </select>
-
- <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
- ui.province, d.status, d.release_status as releaseStatus,
- d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
- d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
- d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
- d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
- d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
- u.email as mailbox, u.mobile as mobile, d.audit_status as auditStatus,
- d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
- d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
- d.tech_broker_id as techBrokerId, u.mobile as contactsName,d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg,d.remark
- from demand d
- left join user_identity ui on ui.uid = d.employer_id
- left join user u on u.id = d.employer_id
- left join marketing_management mm on d.id = mm.product_id
- where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
- </select>
-
-
- <select id="selectOrgDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod,
- oi.licence_province as province, d.status, d.release_status as releaseStatus,
- d.release_date as releaseDate, d.principal_id as principalId, d.industry_category_a as industryCategoryA,
- d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
- d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
- d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
- d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId,
- oi.postal_address as address, u.email as mailbox, d.contacts, d.audit_status as auditStatus,
- d.tech_broker_id as techBrokerId,d.remark,d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
- d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
- d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
- from demand d
- left join organization_identity oi on oi.uid = d.employer_id
- left join user u on u.id = d.employer_id
- left join marketing_management mm on d.id = mm.product_id
- where <!-- d.data_category = 1 and --> d.id = #{id,jdbcType=VARCHAR}
- </select>
-
- <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
- update demand set deleted_sign = 1
- where id in
- <foreach item="item" collection="list" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
-
- <update id="updateReleaseDate" parameterType="java.lang.String">
- update demand set release_date = null
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.demand_type as demandType, d.remark,d.create_time as createTime,
- d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, ad.name as techBrokerId,
- d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus
- from demand d
- LEFT JOIN admin ad on ad.id = d.tech_broker_id
- where d.deleted_sign = 0
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from demand d
- where d.deleted_sign = 0
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- </select>
-
- <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
- insert into demand
- (id, deleted_sign, audit_status,
- status, release_status, create_time,
- keyword, data_category, name,
- demand_type, problem_des, employer_name,
- employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id,remark,urgent_days ,urgent_money)
- values
- <foreach item="item" index="index" collection="list" separator=",">
- (
- #{item.id,jdbcType=VARCHAR}, #{item.deletedSign,jdbcType=INTEGER}, #{item.auditStatus,jdbcType=INTEGER},
- #{item.status,jdbcType=INTEGER}, #{item.releaseStatus,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
- #{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
- #{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
- #{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
- #{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR},#{item.remark,jdbcType=VARCHAR},,#{item.urgentDays,jdbcType=VARCHAR},#{item.urgentMoney,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
-
- <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
- select
- d.id, d.name, d.keyword,d.data_category as dataCategory,d.picture_url as pictureUrl,
- d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
- d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
- d.problem_des as problemDes, d.release_date as releaseDate, d.employer_name as employerName,d.boutique,
- u.lvl as level,dp.publish_page,dp.publish_platform,dp.publish_client,dp.if_top,dp.top_number,dp.show_number
- from demand d
- right join demand_publish dp on d.id=dp.demand_id
- left join user u on u.id = d.employer_id
- where d.deleted_sign = 0 and d.status = 0
- and dp.publish_client=0
- and dp.publish_page='W02'
- and dp.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="industryCategoryA != null">
- and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- <if test="industryCategoryB != null">
- and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
- </if>
- <if test="budgetCostLower != null">
- and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
- </if>
- <if test="budgetCostUpper != null">
- and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="sign == 1">
- and d.budget_cost is null
- </if>
- and d.deleted_sign = 0
- and d.audit_status = 3
- <if test="dateSort == 0">
- order by dp.if_top,dp.top_number,dp.show_number,d.release_date asc
- </if>
- <if test="dateSort == 1">
- order by dp.if_top asc,dp.top_number asc,dp.show_number asc,d.release_date desc
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from demand d
- right join demand_publish dp on d.id=dp.demand_id
- left join user u on u.id = d.employer_id
- where d.deleted_sign = 0 and d.status = 0
- and dp.publish_client=0
- and dp.publish_page='W02'
- and dp.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="industryCategoryA != null">
- and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- <if test="industryCategoryB != null">
- and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
- </if>
- <if test="budgetCostLower != null">
- and d.budget_cost <![CDATA[ >= ]]> #{budgetCostLower,jdbcType=DECIMAL}
- </if>
- <if test="budgetCostUpper != null">
- and d.budget_cost <![CDATA[ <= ]]> #{budgetCostUpper,jdbcType=DECIMAL}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="sign == 1">
- and d.budget_cost is null
- </if>
- </select>
-
- <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo">
- select
- d.id,
- d.employer_name as employerName,
- d.serial_number as serialNumber,
- d.keyword,
- d.data_category as dataCategory,
- d.name,
- d.industry_category_a as industryCategoryA,
- d.industry_category_b as industryCategoryB,
- d.demand_type as demandType,
- d.budget_cost as budgetCost,
- d.problem_des as problemDes,
- d.release_date as releaseDate,
- d.technical_requirements as technicalRequirements,
- d.picture_url as pictureUrl,
- d.text_file_url as textFileUrl,
- d.video_url as videoUrl,
- d.fixed_cycle as fixedCycle,
- d.people_number as peopleNumber,
- d.fixed_scheme as fixedScheme,
- d.cost_escrow as costEscrow,
- d.validity_period as validityPeriod,
- ui.username,
- oi.unit_name as unitName,
- di.id as demandInterestId,
- do.id as demandOrderId,
- do.status as orderStatus
- from demand d
- left join user_identity ui on ui.uid = d.employer_id
- left join organization_identity oi on oi.uid = d.employer_id
- left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
- left join demand_order do on do.demand_id = d.id and do.uid = #{0} and do.status <![CDATA[ <> ]]> 6
- where d.id = #{1}
- </select>
-
- <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
- select
- count(1)
- from demand
- where
- deleted_sign = 0
- and release_status = 1
- and audit_status = 3
- and employer_id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
- SELECT
- id,
- serial_number AS serialNumber,
- data_category AS dataCategory,
- NAME,
- keyword,
- release_date AS releaseDate,
- demand_type AS demandType,
- validity_period AS validityPeriod,
- problem_des as problemDes,
- industry_category_a as industryCategoryA,
- industry_category_b as industryCategoryB,
- budget_cost as budgetCost
- FROM
- demand
- WHERE
- audit_status = 3
- AND release_status = 1
- AND deleted_sign = 0
- AND employer_id = #{employerId,jdbcType=VARCHAR}
- </select>
-
- <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- SELECT
- count(1)
- FROM
- demand
- WHERE
- audit_status = 3
- AND release_status = 1
- AND deleted_sign = 0
- AND employer_id = #{employerId,jdbcType=VARCHAR}
- </select>
-
- <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
- SELECT
- d.id,
- d.name,
- d.keyword,
- d.validity_period as validityPeriod,
- d.industry_category_a AS industryCategoryA,
- d.picture_url as pictureUrl,
- d.employer_contacts_mobile as employerContactsMobile,
- d.data_category as dataCategory,
- fg.name AS industryCategoryAS,
- fgg.name AS industryCategorBS,
- d.budget_cost AS budgetCost,
- d.problem_des AS problemDes,
- dg.name AS province,
- dgg.name AS city,
- interest.id as interestId,
- d.employer_name as employerName,
- u.lvl as level
- FROM
- demand d
- LEFT JOIN `user` u on u.id = d.employer_id
- LEFT JOIN user_identity ui on ui.uid = d.employer_id
- LEFT JOIN district_glossory dg ON dg.id = ui.province
- LEFT JOIN district_glossory dgg ON dgg.id = ui.city
- LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
- LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
- LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
- WHERE
- d.id = #{id,jdbcType=VARCHAR}
- </select>
-
- <select id="findOrgPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
- SELECT
- d.id,
- d.name,
- d.keyword,
- d.picture_url as pictureUrl,
- d.validity_period as validityPeriod,
- d.employer_contacts_mobile as employerContactsMobile,
- d.data_category as dataCategory,
- d.industry_category_a AS industryCategoryA,
- fg.name AS industryCategoryAS,
- fgg.name AS industryCategoryBS,
- d.budget_cost AS budgetCost,
- d.problem_des AS problemDes,
- dg.name AS province,
- dgg.name AS city,
- interest.id as interestId,
- d.employer_name as employerName,
- u.lvl as level
- FROM
- demand d
- LEFT JOIN `user` u on u.id = d.employer_id
- LEFT JOIN organization_identity oi on oi.uid = d.employer_id
- LEFT JOIN district_glossory dg ON dg.id = oi.licence_province
- LEFT JOIN district_glossory dgg ON dgg.id = oi.licence_city
- LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
- LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
- LEFT JOIN demand_interest interest on interest.demand_id = d.id and interest.uid = #{uid,jdbcType=VARCHAR}
- WHERE
- d.id = #{id,jdbcType=VARCHAR}
- </select>
-
- <select id="findByIndustryCategoryA" resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
- select
- d.id,
- d.name,
- fg.name as industryCategoryAS,
- fgg.name as industryCategoryBS,
- d.problem_des as problemDes,
- d.budget_cost as budgetCost,
- u.lvl as level
- from
- demand d
- left join user u on u.id = d.employer_id
- LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
- LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
- where
- d.audit_status = 3
- and d.release_status = 1
- and d.deleted_sign = 0
- and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
- order by d.serial_number desc
- limit 5
- </select>
-
- <update id="updateEmployerId" parameterType="java.lang.String" >
- update demand set employer_id = null
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="findBoutiqueListByPage" parameterType="java.lang.Integer" resultType="com.goafanti.portal.bo.BoutiqueListBo">
- select
- a.id,a.name,
- b.name as industryCatalog,
- a.picture_url as pictureUrl,
- a.problem_des as sketch,
- a.data_category as ownerType,
- a.employer_name as personName
- from
- demand a
- left join field_glossory b on a.industry_category_a = b.id
- where
- a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
- <if test="industryCategoryA != null and industryCategoryA != ''">
- and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- order by
- a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findBoutiqueCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- select
- count(1)
- from
- demand a
- left
- join field_glossory b
- on
- a.industry_category_a = b.id
- where
- a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
- <if test="industryCategoryA != null and industryCategoryA != ''">
- and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- </select>
-
- <!-- 查询需求列表 -->
- <select id="selectDemandList"
- resultType="com.goafanti.demand.bo.DemandListBo">
- SELECT
- d.id,
- d.name,
- d.keyword,
- d.data_category as dataCategory,
- d.fixed_budget as fixedbudget,
- d.demand_type as demandType,
- d.picture_url as pictureUrl,
- d.industry_category_a AS industryCategoryA,
- fg.name AS
- industryCategoryAS,
- fgg.name AS industryCategorBS,
- d.budget_cost AS
- budgetCost,
- d.problem_des AS problemDes,
- dg.name AS
- province,
- dgg.name AS
- city,
- d.employer_name as
- employerName,
- u.lvl as
- level
- FROM
- demand d
- LEFT JOIN `user` u on u.id = d.employer_id
- LEFT JOIN
- user_identity ui on ui.uid = d.employer_id
- LEFT JOIN district_glossory
- dg ON dg.id = ui.province
- LEFT JOIN district_glossory dgg ON dgg.id =
- ui.city
- LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
- LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
- WHERE
- <if test="_parameter!= null">
- d.boutique = #{_parameter,jdbcType=INTEGER}
- </if>
- limit 0,30
- </select>
- <!-- 猜你喜欢 -->
- <select id="selectCsutomerLike"
- resultType="com.goafanti.demand.bo.DemandListBo">
- SELECT
- d.id,
- d.name,
- d.keyword,
- d.data_category as dataCategory,
- d.fixed_budget as fixedbudget,
- d.demand_type as demandType,
- d.picture_url as pictureUrl,
- d.industry_category_a AS industryCategoryA,
- fg.name AS
- industryCategoryAS,
- fgg.name AS industryCategorBS,
- d.budget_cost AS
- budgetCost,
- d.problem_des AS problemDes,
- dg.name AS
- province,
- dgg.name AS
- city,
- d.employer_name as
- employerName,
- u.lvl as
- level
- FROM
- demand d
- LEFT JOIN `user` u on u.id = d.employer_id
- LEFT JOIN
- user_identity ui on ui.uid = d.employer_id
- LEFT JOIN district_glossory
- dg ON dg.id = ui.province
- LEFT JOIN district_glossory dgg ON dgg.id =
- ui.city
- LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
- LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
- LEFT JOIN demand_interest interest on interest.demand_id = d.id
- where
- interest.uid = #{uid,jdbcType=INTEGER}
- limit 0,4
- </select>
- <select id="countInterest" resultType="Integer">
- select count(0)
- from demand_interest
- where demand_id = #{demandId,jdbcType=VARCHAR}
- </select>
- <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
- 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,
- d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,
- d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
- 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
- from demand d
- left join user_identity t on d.employer_id=t.uid
- left join field_glossory g on d.industry_category_a=g.id
- left join field_glossory g2 on d.industry_category_b=g2.id
- left join (select count(0) as countInterest ,demand_id from demand_interest
- group by demand_id) t on d.id=t.demand_id
- where d.deleted_sign = 0
- and d.audit_status=3
- <if test="employerId != null">
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="industryCategoryA != null">
- and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- order by d.boutique desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from demand d
- where d.deleted_sign = 0
- <if test="employerId != null">
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="industryCategoryA != null">
- and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- </select>
-
- <select id="demandInterest" resultType="com.goafanti.demand.bo.DemandInterestBo">
- select
- d.id,d.name,di.create_time as createTime
- from demand_interest di
- LEFT join demand d on di.demand_id=d.id
- where uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
- select
- d.id, d.boutique,d.name, d.audit_status as auditStatus,ifnull(t.x,0) as orderCount,
- d.release_date as releaseDate,d.create_time as createTime,ifnull(i.y,0) as countInterest
- from demand d
- left join (select count(0) as x,tl.commodity_id from t_order tr
- left join t_order_detail tl on tl.order_no=tr.order_no
- where tr.order_status != 4 and tr.order_status != 0
- group by tl.commodity_id ) t on d.id=t.commodity_id
- left join (select count(0) as y,demand_id from demand_interest
- group by demand_id ) i on d.id=i.demand_id
- where d.deleted_sign = 0
- <if test="employerId != null">
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from demand d
- where d.deleted_sign = 0
- <if test="employerId != null">
- and d.employer_id = #{employerId, jdbcType=VARCHAR}
- </if>
-
- </select>
- <select id="selectDemandDetail" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- 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,
- 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,
- 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,
- 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,
- d.employer_address as employerAddress, d.employer_contacts as employerContacts, d.employer_contacts_mobile as employerContactsMobile, d.employer_contacts_mailbox as employerContactsMailbox,
- 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,
- d.audit_status as auditStatus, d.tech_broker_id as techBrokerId,d.boutique,d.urgent_money as urgentMoney,d.urgent_days as urgentDays
- from demand d
- left join jpush_easemob_account j on d.employer_id=j.uid
- where d.id = #{id,jdbcType=VARCHAR}
- </select>
-
-
-
- <select id="findAppNewsInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select n.id,n.title as name,n.create_time as createTime
- from news_interest ni
- LEFT join news n on ni.new_id=n.id
- where ni.uid=#{uid,jdbcType=VARCHAR}
- order by createTime desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppNewsInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from news_interest ni
- LEFT join news n on ni.new_id=n.id
- where ni.uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select y.uid as id,y.username as name ,t.create_time as createTime
- from user_interest t
- left join user_identity y on t.to_uid=y.uid
- where expert=1
- and from_uid=#{uid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user_interest t
- left join user_identity y on t.to_uid=y.uid
- where expert=1
- and from_uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select y.uid as id,y.username as name ,t.create_time as createTime
- from user_interest t
- left join user_identity y on t.to_uid=y.uid
- where expert=2
- and from_uid=#{uid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from user_interest t
- left join user_identity y on t.to_uid=y.uid
- where expert=2
- and from_uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppDemandInterestByPage" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select d.id ,d.name,t.create_time as createTime
- from demand_interest t
- left join demand d on t.demand_id=d.id
- where t.uid=#{uid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from demand_interest t
- left join demand d on t.demand_id=d.id
- where uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppAchievementInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select a.id ,a.name,t.create_time as createTime
- from achievement_interest t
- left join achievement a on t.achievement_id=a.id
- where t.uid=#{uid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from achievement_interest t
- left join achievement a on t.achievement_id=a.id
- where t.uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findAppProjectInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
- select b.id ,b.bname as name,t.uid,t.create_time as createTime
- from project_interest t
- left join business_project b on t.project_id=b.id
- where t.uid=#{uid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findAppProjectInterestCount" parameterType="String" resultType="java.lang.Integer">
- select count(1)
- from project_interest t
- left join business_project b on t.project_id=b.id
- where t.uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
- d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
- d.employer_id as employerId, d.audit_status as auditStatus,
- d.tech_broker_id as techBrokerId,d.boutique
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- ,1 as hot
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- ,0 as hot
- </if>
- <if test="hot==null"><!-- 无首页参数 -->
- ,ifnull(mm.effective,0) as hot
- </if>
- from demand d
- <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="adminId != null">
- LEFT JOIN user u on d.employer_id = u.id
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="techBrokerId != null">
- and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
- </if>
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- and (u.mid = #{adminId,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- or d.principal_id = #{adminId,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
- )
- </if>
- <!-- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if> -->
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
- </if>
- <!-- <if test="unitName != null">
- and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if> -->
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id ="findMyDemandCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from demand d
- <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
- LEFT JOIN admin a on a.id = d.tech_broker_id
- <if test="adminId != null">
- LEFT JOIN user u on d.employer_id = u.id
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="techBrokerId != null">
- and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
- </if>
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- and (u.mid = #{adminId,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- or d.principal_id = #{adminId,jdbcType=VARCHAR}
- </if>
- <if test="adminId != null">
- or d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
- )
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <!-- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if> -->
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <!-- <if test="unitName != null">
- and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if> -->
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- </select>
-
- <select id="findManageDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
- select
- d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
- d.name, d.keyword, d.info_sources as infoSources,
- <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod,
- d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
- d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
- d.employer_id as employerId, d.audit_status as auditStatus,
- d.tech_broker_id as techBrokerId,d.boutique
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- ,1 as hot
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- ,0 as hot
- </if>
- <if test="hot==null"><!-- 无首页参数 -->
- ,ifnull(mm.effective,0) as hot
- </if>
- from demand d
- <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
- LEFT JOIN admin a on a.id = d.tech_broker_id
- LEFT JOIN department_management dm on dm.id = a.department_id
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="techBrokerId != null">
- and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
- </if>
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <!-- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if> -->
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
- </if>
- <!-- <if test="unitName != null">
- and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if> -->
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- order by d.serial_number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id ="findManagegDemandCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from demand d
- <!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
- LEFT JOIN admin a on a.id = d.tech_broker_id
- LEFT JOIN department_management dm on dm.id = a.department_id
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- inner join marketing_management mm on d.id = mm.product_id
- </if>
- <if test="hot == null"> <!-- 无首页参数 -->
- left join marketing_management mm on d.id = mm.product_id
- </if>
- where d.deleted_sign = 0
- <if test="techBrokerId != null">
- and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
- </if>
- <if test="dataCategory != null">
- and d.data_category = #{dataCategory,jdbcType=VARCHAR}
- </if>
- <if test="serialNumber != null">
- and d.serial_number = #{serialNumber,jdbcType=INTEGER}
- </if>
- <if test="auditStatus != null">
- and d.audit_status = #{auditStatus,jdbcType=INTEGER}
- </if>
- <!-- <if test="province != null">
- and oi.licence_province = #{province,jdbcType=INTEGER}
- </if> -->
- <if test="name != null">
- and d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="keyword != null">
- and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
- </if>
- <!-- <if test="unitName != null">
- and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if> -->
- <if test="employerName != null">
- and d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
- and (d.employer_id is null or d.employer_id='')
- </if>
- <if test="infoSources != null">
- and d.info_sources = #{infoSources,jdbcType=INTEGER}
- </if>
- <if test="demandType != null">
- and d.demand_type = #{demandType,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and d.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="releaseStatus != null">
- and d.release_status = #{releaseStatus,jdbcType=VARCHAR}
- </if>
- <if test="vStart != null">
- and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
- </if>
- <if test="vEnd != null">
- and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="rStart != null">
- and d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
- </if>
- <if test="rEnd != null">
- and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="cStart != null">
- and d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
- </if>
- <if test="cEnd != null">
- and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="boutique != null">
- and d.boutique = #{boutique,jdbcType=INTEGER}
- </if>
- <if test="hot != null and hot == 0"><!-- 不在首页 -->
- and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
- </if>
- <if test="hot != null and hot == 1"><!-- 在首页 -->
- and mm.effective = 1
- </if>
- </select>
- <select id="getAppHomeRecommended" resultType="com.goafanti.demand.bo.DemandRecommended">
- select dp.demand_id as id,d.name,d.problem_des as introduction,d.picture_url as pictureUrl,
- d.urgent_days as urgentDays,d.urgent_money as urgentMoney
- from demand_publish dp
- left join demand d on dp.demand_id = d.id
- where
- dp.publish_client = '1'
- and dp.publish_page = 'W01'
- order by
- dp.if_top,
- dp.top_number,
- dp.show_number asc limit 0,
- 6
- </select>
- </mapper>
|