| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576 |
- <?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.BusinessProjectMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.BusinessProject">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="create_id" jdbcType="VARCHAR" property="createId" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
- <result column="bname" jdbcType="VARCHAR" property="bname" />
- <result column="cid" jdbcType="VARCHAR" property="cid" />
- <result column="price" jdbcType="DECIMAL" property="price" />
- <result column="offset" jdbcType="DECIMAL" property="offset" />
- <result column="activity_price" jdbcType="DECIMAL" property="activityPrice" />
- <result column="activity_flag" jdbcType="VARCHAR" property="activityFlag" />
- <result column="member_price" jdbcType="DECIMAL" property="memberPrice" />
- <result column="introduce" jdbcType="VARCHAR" property="introduce" />
- <result column="status" jdbcType="VARCHAR" property="status" />
- <result column="country" jdbcType="VARCHAR" property="country" />
- <result column="province" jdbcType="VARCHAR" property="province" />
- <result column="city" jdbcType="VARCHAR" property="city" />
- <result column="district" jdbcType="VARCHAR" property="district" />
- <result column="principal_id" jdbcType="VARCHAR" property="principalId" />
- <result column="Value_effect" jdbcType="VARCHAR" property="valueEffect" />
- <result column="client_size" jdbcType="VARCHAR" property="clientSize" />
- <result column="min_logo" jdbcType="VARCHAR" property="minLogo" />
- <result column="max_logo" jdbcType="VARCHAR" property="maxLogo" />
- <result column="project_url" jdbcType="VARCHAR" property="projectUrl" />
- <result column="boutique" jdbcType="INTEGER" property="boutique" />
- <result column="first_payment" jdbcType="DECIMAL" property="firstPayment" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="patent_transfer" jdbcType="INTEGER" property="patentTransfer" />
- </resultMap>
- <sql id="Base_Column_List">
- id, create_id, create_time, update_time, delete_sign, bname, cid, price, `offset`,
- activity_price, activity_flag, member_price, introduce, `status`, country, province,
- city, district, principal_id, Value_effect, client_size, min_logo, max_logo, project_url,
- boutique, first_payment, `type`, patent_transfer
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from business_project
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from business_project
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.BusinessProject">
- insert into business_project (id, create_id, create_time,
- update_time, delete_sign, bname,
- cid, price, `offset`,
- activity_price, activity_flag, member_price,
- introduce, `status`, country,
- province, city, district,
- principal_id, Value_effect, client_size,
- min_logo, max_logo, project_url,
- boutique, first_payment, `type`,
- patent_transfer)
- values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{updateTime,jdbcType=TIMESTAMP}, #{deleteSign,jdbcType=INTEGER}, #{bname,jdbcType=VARCHAR},
- #{cid,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{offset,jdbcType=DECIMAL},
- #{activityPrice,jdbcType=DECIMAL}, #{activityFlag,jdbcType=VARCHAR}, #{memberPrice,jdbcType=DECIMAL},
- #{introduce,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR},
- #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
- #{principalId,jdbcType=VARCHAR}, #{valueEffect,jdbcType=VARCHAR}, #{clientSize,jdbcType=VARCHAR},
- #{minLogo,jdbcType=VARCHAR}, #{maxLogo,jdbcType=VARCHAR}, #{projectUrl,jdbcType=VARCHAR},
- #{boutique,jdbcType=INTEGER}, #{firstPayment,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
- #{patentTransfer,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.BusinessProject">
- insert into business_project
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="createId != null">
- create_id,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="deleteSign != null">
- delete_sign,
- </if>
- <if test="bname != null">
- bname,
- </if>
- <if test="cid != null">
- cid,
- </if>
- <if test="price != null">
- price,
- </if>
- <if test="offset != null">
- `offset`,
- </if>
- <if test="activityPrice != null">
- activity_price,
- </if>
- <if test="activityFlag != null">
- activity_flag,
- </if>
- <if test="memberPrice != null">
- member_price,
- </if>
- <if test="introduce != null">
- introduce,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="country != null">
- country,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="city != null">
- city,
- </if>
- <if test="district != null">
- district,
- </if>
- <if test="principalId != null">
- principal_id,
- </if>
- <if test="valueEffect != null">
- Value_effect,
- </if>
- <if test="clientSize != null">
- client_size,
- </if>
- <if test="minLogo != null">
- min_logo,
- </if>
- <if test="maxLogo != null">
- max_logo,
- </if>
- <if test="projectUrl != null">
- project_url,
- </if>
- <if test="boutique != null">
- boutique,
- </if>
- <if test="firstPayment != null">
- first_payment,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="patentTransfer != null">
- patent_transfer,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="createId != null">
- #{createId,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deleteSign != null">
- #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="bname != null">
- #{bname,jdbcType=VARCHAR},
- </if>
- <if test="cid != null">
- #{cid,jdbcType=VARCHAR},
- </if>
- <if test="price != null">
- #{price,jdbcType=DECIMAL},
- </if>
- <if test="offset != null">
- #{offset,jdbcType=DECIMAL},
- </if>
- <if test="activityPrice != null">
- #{activityPrice,jdbcType=DECIMAL},
- </if>
- <if test="activityFlag != null">
- #{activityFlag,jdbcType=VARCHAR},
- </if>
- <if test="memberPrice != null">
- #{memberPrice,jdbcType=DECIMAL},
- </if>
- <if test="introduce != null">
- #{introduce,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="country != null">
- #{country,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="district != null">
- #{district,jdbcType=VARCHAR},
- </if>
- <if test="principalId != null">
- #{principalId,jdbcType=VARCHAR},
- </if>
- <if test="valueEffect != null">
- #{valueEffect,jdbcType=VARCHAR},
- </if>
- <if test="clientSize != null">
- #{clientSize,jdbcType=VARCHAR},
- </if>
- <if test="minLogo != null">
- #{minLogo,jdbcType=VARCHAR},
- </if>
- <if test="maxLogo != null">
- #{maxLogo,jdbcType=VARCHAR},
- </if>
- <if test="projectUrl != null">
- #{projectUrl,jdbcType=VARCHAR},
- </if>
- <if test="boutique != null">
- #{boutique,jdbcType=INTEGER},
- </if>
- <if test="firstPayment != null">
- #{firstPayment,jdbcType=DECIMAL},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="patentTransfer != null">
- #{patentTransfer,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.BusinessProject">
- update business_project
- <set>
- <if test="createId != null">
- create_id = #{createId,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deleteSign != null">
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- </if>
- <if test="bname != null">
- bname = #{bname,jdbcType=VARCHAR},
- </if>
- <if test="cid != null">
- cid = #{cid,jdbcType=VARCHAR},
- </if>
- <if test="price != null">
- price = #{price,jdbcType=DECIMAL},
- </if>
- <if test="offset != null">
- `offset` = #{offset,jdbcType=DECIMAL},
- </if>
- <if test="activityPrice != null">
- activity_price = #{activityPrice,jdbcType=DECIMAL},
- </if>
- <if test="activityFlag != null">
- activity_flag = #{activityFlag,jdbcType=VARCHAR},
- </if>
- <if test="memberPrice != null">
- member_price = #{memberPrice,jdbcType=DECIMAL},
- </if>
- <if test="introduce != null">
- introduce = #{introduce,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=VARCHAR},
- </if>
- <if test="country != null">
- country = #{country,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null">
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="district != null">
- district = #{district,jdbcType=VARCHAR},
- </if>
- <if test="principalId != null">
- principal_id = #{principalId,jdbcType=VARCHAR},
- </if>
- <if test="valueEffect != null">
- Value_effect = #{valueEffect,jdbcType=VARCHAR},
- </if>
- <if test="clientSize != null">
- client_size = #{clientSize,jdbcType=VARCHAR},
- </if>
- <if test="minLogo != null">
- min_logo = #{minLogo,jdbcType=VARCHAR},
- </if>
- <if test="maxLogo != null">
- max_logo = #{maxLogo,jdbcType=VARCHAR},
- </if>
- <if test="projectUrl != null">
- project_url = #{projectUrl,jdbcType=VARCHAR},
- </if>
- <if test="boutique != null">
- boutique = #{boutique,jdbcType=INTEGER},
- </if>
- <if test="firstPayment != null">
- first_payment = #{firstPayment,jdbcType=DECIMAL},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="patentTransfer != null">
- patent_transfer = #{patentTransfer,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.BusinessProject">
- update business_project
- set create_id = #{createId,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- bname = #{bname,jdbcType=VARCHAR},
- cid = #{cid,jdbcType=VARCHAR},
- price = #{price,jdbcType=DECIMAL},
- `offset` = #{offset,jdbcType=DECIMAL},
- activity_price = #{activityPrice,jdbcType=DECIMAL},
- activity_flag = #{activityFlag,jdbcType=VARCHAR},
- member_price = #{memberPrice,jdbcType=DECIMAL},
- introduce = #{introduce,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=VARCHAR},
- country = #{country,jdbcType=VARCHAR},
- province = #{province,jdbcType=VARCHAR},
- city = #{city,jdbcType=VARCHAR},
- district = #{district,jdbcType=VARCHAR},
- principal_id = #{principalId,jdbcType=VARCHAR},
- Value_effect = #{valueEffect,jdbcType=VARCHAR},
- client_size = #{clientSize,jdbcType=VARCHAR},
- min_logo = #{minLogo,jdbcType=VARCHAR},
- max_logo = #{maxLogo,jdbcType=VARCHAR},
- project_url = #{projectUrl,jdbcType=VARCHAR},
- boutique = #{boutique,jdbcType=INTEGER},
- first_payment = #{firstPayment,jdbcType=DECIMAL},
- `type` = #{type,jdbcType=INTEGER},
- patent_transfer = #{patentTransfer,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="findProjectListByPage" resultType="com.goafanti.business.bo.BusinessProjectBo">
- select b.id, b.create_id as createId, b.create_time as createTime, b.update_time as updateTime, b.delete_sign deleteSign, b.bname,
- b.cid, b.price, b.offset, b.activity_price as activityPrice, b.activity_flag as activityFlag, b.member_price as memberPrice,
- b.introduce, b.status, b.country, b.province, b.city, b.district, b.type,
- b.principal_id as principalId, b.Value_effect as ValueEffect, b.client_size as clientSize,b2.cname
- from business_project b
- left join business_category b2 on b.cid = b2.id
- where b.delete_sign=0
- <if test="bname != null">
- and b.bname like concat('%',#{bname},'%')
- </if>
- <if test="cid != null">
- and b.cid = #{cid,jdbcType=VARCHAR}
- </if>
- <if test="country != null">
- and b.country = #{country,jdbcType=INTEGER}
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=VARCHAR}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=VARCHAR}
- </if>
- <if test="district != null">
- and b.district = #{district,jdbcType=VARCHAR}
- </if>
- <if test="activityFlag != null">
- and b.activity_flag = #{activityFlag,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and b.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="type != null">
- and b.type = #{type,jdbcType=VARCHAR}
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findProjectListCount" resultType="Integer">
- select
- count(0)
- from business_project b
- left join business_category b2 on b.cid = b2.id
- where b.delete_sign=0
- <if test="bname != null">
- and b.bname = #{bname,jdbcType=VARCHAR}
- </if>
- <if test="cid != null">
- and b.cid = #{cid,jdbcType=VARCHAR}
- </if>
- <if test="country != null">
- and b.country = #{country,jdbcType=INTEGER}
- </if>
- <if test="province != null">
- and b.province = #{province,jdbcType=VARCHAR}
- </if>
- <if test="city != null">
- and b.city = #{city,jdbcType=VARCHAR}
- </if>
- <if test="district != null">
- and b.district = #{district,jdbcType=VARCHAR}
- </if>
- <if test="activityFlag != null">
- and b.activity_flag = #{activityFlag,jdbcType=INTEGER}
- </if>
- <if test="status != null">
- and b.status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="type != null">
- and b.type = #{type,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="getBnamecount" resultType="Integer">
- select
- count(0)
- from business_project
- where delete_sign=0
- and bname = #{bname,jdbcType=VARCHAR}
- </select>
- <select id="getCreateName" resultType="string">
- select
- name
- from admin
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <select id="findProjectSizeListByPage" resultType="com.goafanti.business.bo.ProjectSizeBo">
- select
- p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice,
- p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
- from business_project_model p
- left join business_project b on p.pid =b.id
- where p.pid = #{pid,jdbcType=VARCHAR}
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findProjectSizeListCount" resultType="Integer">
- select
- count(0)
- from business_project_model p
- left join business_project b on p.pid =b.id
- where p.pid = #{pid,jdbcType=VARCHAR}
- </select>
- <select id="selectByPrimaryBname" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from business_project
- where delete_sign=0 and status=0
- and bname = #{bname,jdbcType=VARCHAR}
- </select>
- <select id="getBusinessProject" resultType="com.goafanti.app.bo.ProjectBo">
- select id,bname as name,min_logo as minLogoUrl,introduce,project_url as projectUrl
- from business_project
- where delete_sign=0
- and status=0
- <if test="id != null">
- and cid=#{id,jdbcType=VARCHAR}
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="getBusinessProjectCount" resultType="Integer">
- select
- count(0)
- from business_project
- where delete_sign=0
- and status=0
- <if test="id != null">
- and cid=#{id,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="findRecommendProjectListByPage" resultType="com.goafanti.app.bo.ProjectBo">
- select b.id,b.bname as name,b.min_logo as minLogoUrl,b.introduce,b.boutique,
- ifnull(t.interestCount,0) as interestCount,project_url as projectUrl
- from business_project b
- left join (select count(0) as interestCount ,project_id from project_interest
- group by project_id) t on b.id=t.project_id
- where b.delete_sign=0
- and b.status=0
- and boutique=1
- order by b.boutique desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <select id="findRecommendProjectListCount" resultType="Integer">
- select
- count(0)
- from business_project b
- left join (select count(0) as interestCount ,project_id from project_interest
- group by project_id) t on b.id=t.project_id
- where b.delete_sign=0
- and b.status=0
- </select>
- <select id="selectAppProjectDetail" resultType="com.goafanti.app.bo.ProjectDetailBo">
- select p.id,p.bname as name,p.introduce ,p.Value_effect as valueEffect ,p.client_size as clientSize,
- p.max_logo as maxLogo,ifnull(count(p.id),0) as countInterest
- from business_project p
- left join project_interest pt on pt.project_id=p.id
- where p.id=#{id,jdbcType=VARCHAR}
- </select>
- <select id="checkProject" resultType="Integer">
- select count(0) from business_project
- where cid=#{id,jdbcType=VARCHAR}
- </select>
- <select id="selectBusinessProjectByName" parameterType="java.lang.String" resultType="com.goafanti.business.bo.BusinessProjectBo">
- select a.id,a.bname,ifnull(a.price,0) as price,ifnull(a.first_payment,0) as firstPayment,
- a.type ,a.patent_transfer patentTransfer,b.cname,b.sort CSort
- from business_project a left join business_category b on a.cid=b.id
- where 1=1
- <if test="cname != null">
- and b.cname = #{cname,jdbcType=VARCHAR}
- </if>
- and a.delete_sign=0 and a.status=0
- and a.bname like concat('%',#{businessName},'%')
- </select>
- <select id="getPortalBusinessProject" resultType="com.goafanti.app.bo.ProjectBo">
- select id ,min_logo as minLogoUrl,bname as name
- from business_project
- where delete_sign=0
- and status=0
- and boutique=1
- LIMIT 0, 3
- </select>
- <select id="selectBusinessProjectCatalog" resultType="com.goafanti.common.model.BusinessCategory">
- select id,cname from business_category where delete_sign=0
- </select>
- <select id="selectProjectAndTypeAll" resultType="java.util.Map">
- select bc.id, group_concat(distinct bp.`type`)groupCount from business_category bc
- left join business_project bp on bc.id =bp.cid group by bc.id
- </select>
- </mapper>
|