| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <?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.MarketingManagementMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.MarketingManagement">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="product_id" jdbcType="VARCHAR" property="productId" />
- <result column="show_page" jdbcType="VARCHAR" property="showPage" />
- <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
- <result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
- <result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
- <result column="category" jdbcType="INTEGER" property="category" />
- <result column="effective" jdbcType="INTEGER" property="effective" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- id, product_id, show_page, cover_img, start_date, end_date, category, effective
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.MarketingManagementExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from marketing_management
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- select
- <include refid="Base_Column_List" />
- from marketing_management
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- delete from marketing_management
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.MarketingManagementExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- delete from marketing_management
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.MarketingManagement">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- insert into marketing_management (id, product_id, show_page,
- cover_img, start_date, end_date,
- category, effective)
- values (#{id,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{showPage,jdbcType=VARCHAR},
- #{coverImg,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP},
- #{category,jdbcType=INTEGER}, #{effective,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.MarketingManagement">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- insert into marketing_management
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="productId != null">
- product_id,
- </if>
- <if test="showPage != null">
- show_page,
- </if>
- <if test="coverImg != null">
- cover_img,
- </if>
- <if test="startDate != null">
- start_date,
- </if>
- <if test="endDate != null">
- end_date,
- </if>
- <if test="category != null">
- category,
- </if>
- <if test="effective != null">
- effective,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="productId != null">
- #{productId,jdbcType=VARCHAR},
- </if>
- <if test="showPage != null">
- #{showPage,jdbcType=VARCHAR},
- </if>
- <if test="coverImg != null">
- #{coverImg,jdbcType=VARCHAR},
- </if>
- <if test="startDate != null">
- #{startDate,jdbcType=TIMESTAMP},
- </if>
- <if test="endDate != null">
- #{endDate,jdbcType=TIMESTAMP},
- </if>
- <if test="category != null">
- #{category,jdbcType=INTEGER},
- </if>
- <if test="effective != null">
- #{effective,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.MarketingManagementExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- select count(*) from marketing_management
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- update marketing_management
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.productId != null">
- product_id = #{record.productId,jdbcType=VARCHAR},
- </if>
- <if test="record.showPage != null">
- show_page = #{record.showPage,jdbcType=VARCHAR},
- </if>
- <if test="record.coverImg != null">
- cover_img = #{record.coverImg,jdbcType=VARCHAR},
- </if>
- <if test="record.startDate != null">
- start_date = #{record.startDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.endDate != null">
- end_date = #{record.endDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.category != null">
- category = #{record.category,jdbcType=INTEGER},
- </if>
- <if test="record.effective != null">
- effective = #{record.effective,jdbcType=INTEGER},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- update marketing_management
- set id = #{record.id,jdbcType=VARCHAR},
- product_id = #{record.productId,jdbcType=VARCHAR},
- show_page = #{record.showPage,jdbcType=VARCHAR},
- cover_img = #{record.coverImg,jdbcType=VARCHAR},
- start_date = #{record.startDate,jdbcType=TIMESTAMP},
- end_date = #{record.endDate,jdbcType=TIMESTAMP},
- category = #{record.category,jdbcType=INTEGER},
- effective = #{record.effective,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.MarketingManagement">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- update marketing_management
- <set>
- <if test="productId != null">
- product_id = #{productId,jdbcType=VARCHAR},
- </if>
- <if test="showPage != null">
- show_page = #{showPage,jdbcType=VARCHAR},
- </if>
- <if test="coverImg != null">
- cover_img = #{coverImg,jdbcType=VARCHAR},
- </if>
- <if test="startDate != null">
- start_date = #{startDate,jdbcType=TIMESTAMP},
- </if>
- <if test="endDate != null">
- end_date = #{endDate,jdbcType=TIMESTAMP},
- </if>
- <if test="category != null">
- category = #{category,jdbcType=INTEGER},
- </if>
- <if test="effective != null">
- effective = #{effective,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.MarketingManagement">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Sep 26 14:34:04 CST 2017.
- -->
- update marketing_management
- set product_id = #{productId,jdbcType=VARCHAR},
- show_page = #{showPage,jdbcType=VARCHAR},
- cover_img = #{coverImg,jdbcType=VARCHAR},
- start_date = #{startDate,jdbcType=TIMESTAMP},
- end_date = #{endDate,jdbcType=TIMESTAMP},
- category = #{category,jdbcType=INTEGER},
- effective = #{effective,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="getMarketingCount" resultType="java.lang.Integer">
- select count(0) from marketing_management
- where show_page = #{showPage,jdbcType=VARCHAR}
- and category = #{category,jdbcType=INTEGER}
- and effective = #{effective,jdbcType=INTEGER}
- </select>
- <select id="selectMarket" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from marketing_management
- where show_page = #{showPage,jdbcType=VARCHAR}
- and category = #{category,jdbcType=INTEGER}
- and product_id = #{productId,jdbcType=VARCHAR}
- </select>
- <select id="deleteByProductId">
- update marketing_management set effective = 0
- where product_id in
- <foreach item="item" collection="productIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="selectMarketList" resultType="com.goafanti.marketing.bo.MarketingManagementBo">
- <if test="category == 1"> <!-- 成果 -->
- select
- x.id as productId,x.owner_type as ownerType,x.summary,x.introduction,x.name,x.field_a,fg.name as fieldA,
- x.field_b,fg1.name as fieldB,x.technical_picture_url as coverImg,bi.domain_name
- from
- achievement x
- right join achievement_publish ap on ap.achievement_id=x.id
- left join branch_information bi on bi.id=ap.publish_platform
- left join field_glossory fg on x.field_a=fg.id
- left join field_glossory fg1 on x.field_b=fg1.id
- where x.audit_status = 3
- and x.deleted_sign = 0
- and ap.publish_client='0'
- and ap.publish_page='W01'
- and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
- </if>
- <if test="category == 2"> <!-- 需求 -->
- select x.id as productId,x.data_category as ownerType,x.name,
- x.picture_url as coverImg,x.problem_des as problemDes,
- x.urgent_days as urgentDays,x.urgent_money as urgentMoney,bi.domain_name
- from demand x
- right join demand_publish dp on dp.demand_id=x.id
- left join branch_information bi on bi.id=dp.publish_platform
- where x.audit_status =3 and x.deleted_sign = 0
- and x.deleted_sign = 0
- and dp.publish_client='0'
- and dp.publish_page='W01'
- and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
- </if>
- <if test="category == 7"> <!-- 智者 -->
- select
- u.id,i.username,i.work_unit as workUnit,i.professional_title as professionalTitle,u.introduction,
- u.head_portrait_url as headPortraitUrl,u.type,i.expert,bi.domain_name,ifnull(o.x,0) as reservationCount
- from `user` u
- left join user_ability ua on u.id=ua.uid
- left join user_career c on u.id=c.uid
- left join user_identity i on u.id=i.uid
- left join (select count(0) as x,seller_id from t_order
- where order_status != 4
- group by seller_id ) o on u.id=o.seller_id
- right join expert_publish ep on ep.expert_id=u.id
- left join branch_information bi on bi.id=ep.publish_platform
- WHERE
- u.type = 0
- and i.expert = 1
- and ep.publish_client='0'
- and ep.publish_page='W01'
- and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
- </if>
- <if test="category == 1">
- order by ap.if_top,ap.top_number,ap.show_number asc
- </if>
- <if test="category == 2">
- order by dp.if_top,dp.top_number,dp.show_number asc
- </if>
- <if test="category == 7">
- order by ep.if_top,ep.top_number,ep.show_number asc
- </if>
- <if test="boothSize !=null">
- LIMIT 0, #{boothSize,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectHotProject" resultType="com.goafanti.common.model.BusinessProject">
- select
- id, create_id as createId, create_time as createTime, update_time as updateTime, delete_sign as deleteSign, bname, cid, price, offset,
- activity_price as activityPrice, activity_flag as activityFlag, member_price as memberPrice, introduce, status, country, province,
- city, district, principal_id as principalId, Value_effect as ValueEffect, client_size as clientSize, max_logo as maxLogo, min_logo as minLogo, boutique,
- project_url as projectUrl, first_payment as firstPayment
- FROM business_project
- where boutique=1
- <if test="pSize != null">
- LIMIT 0, #{pSize,jdbcType=VARCHAR}
- </if>
- </select>
- </mapper>
|