| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?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.ruixuan.isc.mapper.KuaishouPromoterMapper">
- <resultMap type="com.ruixuan.isc.entity.KuaishouPromoter" id="KuaishouPromoterResult">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="userName" column="user_name"/>
- <result property="promoterId" column="promoter_id"/>
- <result property="promoterNickName" column="promoter_nick_name"/>
- <result property="state" column="state"/>
- <result property="province" column="province"/>
- <result property="commissionRequirement" column="commission_requirement"/>
- <result property="categoryRequirement" column="category_requirement"/>
- <result property="createTime" column="create_time"/>
- <result property="promoterUrl" column="promoter_url"/>
- <result property="totalSale" column="total_sale"/>
- <result property="fansNumber" column="fans_number"/>
- <result property="phone" column="phone"/>
- <result property="consignee" column="consignee"/>
- <result property="promoterAddress" column="promoter_address"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
- <sql id="selectKuaishouPromoterVo">
- select id,
- user_id,
- user_name,
- promoter_id,
- promoter_nick_name,
- `state`,
- province,
- commission_requirement,
- category_requirement,
- promoter_url,
- phone,
- consignee,
- promoter_address,
- total_sale,
- fans_number,
- create_time,
- update_time
- from kuaishou_promoter
- </sql>
- <select id="selectKuaishouPromoterList" resultMap="KuaishouPromoterResult">
- <include refid="selectKuaishouPromoterVo"/>
- <where>
- <if test="userList != null and userList.size() > 0 ">
- and user_id in
- <foreach collection="userList" item="userId" open="(" separator="," close=")">
- #{userId}
- </foreach>
- </if>
- <if test="promoterId != null ">
- and promoter_id = #{promoterId}
- </if>
- <if test="promoterNickName != null and promoterNickName != ''">
- and promoter_nick_name like concat('%', #{promoterNickName}, '%')
- </if>
- </where>
- </select>
- <select id="selectKuaishouPromoterById" parameterType="Long" resultMap="KuaishouPromoterResult">
- <include refid="selectKuaishouPromoterVo"/>
- where id = #{id}
- </select>
- <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
- <include refid="selectKuaishouPromoterVo"/>
- where promoter_id = #{promoterId}
- <if test="userId != null ">
- AND user_id = #{userId}
- </if>
- </select>
- <insert id="insertKuaishouPromoter" parameterType="com.ruixuan.isc.entity.KuaishouPromoter" useGeneratedKeys="true"
- keyProperty="id">
- insert into kuaishou_promoter
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="userName != null">user_name,</if>
- <if test="promoterId != null">promoter_id,</if>
- <if test="promoterNickName != null">promoter_nick_name,</if>
- <if test="state != null">state,</if>
- <if test="province != null">province,</if>
- <if test="commissionRequirement != null">commission_requirement,</if>
- <if test="categoryRequirement != null">category_requirement,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="totalSale != null">total_sale,</if>
- <if test="fansNumber != null">fans_number,</if>
- <if test="promoterUrl != null">promoter_url,</if>
- <if test="phone != null">phone,</if>
- <if test="consignee != null">consignee,</if>
- <if test="promoterAddress != null">promoter_address,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="userName != null">#{userName},</if>
- <if test="promoterId != null">#{promoterId},</if>
- <if test="promoterNickName != null">#{promoterNickName},</if>
- <if test="state != null">#{state},</if>
- <if test="province != null">#{province},</if>
- <if test="commissionRequirement != null">#{commissionRequirement},</if>
- <if test="categoryRequirement != null">#{categoryRequirement},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="totalSale != null">#{totalSale},</if>
- <if test="fansNumber != null">#{fansNumber},</if>
- <if test="promoterUrl != null">#{promoterUrl},</if>
- <if test="phone != null">#{phone},</if>
- <if test="consignee != null">#{consignee},</if>
- <if test="promoterAddress != null">#{promoterAddress},</if>
- </trim>
- </insert>
- <update id="updateKuaishouPromoter" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
- update kuaishou_promoter
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="promoterId != null">promoter_id = #{promoterId},</if>
- <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
- <if test="totalSale != null">total_sale = #{totalSale},</if>
- <if test="fansNumber != null">fans_number = #{fansNumber},</if>
- <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="consignee != null">consignee = #{consignee},</if>
- <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
- <if test="state != null">state = #{state},</if>
- <if test="province != null">province = #{province},</if>
- <if test="commissionRequirement != null">commission_requirement = #{commissionRequirement},</if>
- <if test="categoryRequirement != null">category_requirement = #{categoryRequirement},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteKuaishouPromoterById" parameterType="Long">
- delete
- from kuaishou_promoter
- where id = #{id}
- </delete>
- <delete id="deleteKuaishouPromoterByIds" parameterType="String">
- delete from kuaishou_promoter where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="getNearlyMonthGmv" resultType="com.alibaba.fastjson.JSONObject">
- SELECT SUM(order_amount) as 'orderAmount', CONCAT(IFNULL(ROUND((SELECT COUNT(1)
- FROM kuaishou_item_collect_samples
- WHERE collect_sample_status = 7
- AND promoter_id = #{promoterId})
- / (SELECT COUNT(1)
- FROM kuaishou_item_collect_samples
- WHERE collect_sample_status!=1 AND collect_sample_status!=2 AND promoter_id = #{promoterId})*100,2), 0),
- '%') as 'operationCompletionRate'
- FROM kuaishou_supply_chain
- WHERE promoter_id = #{promoterId}
- AND FROM_UNIXTIME(order_create_time / 1000, '%Y-%m-%d') >= #{start}
- AND FROM_UNIXTIME(order_create_time / 1000, '%Y-%m-%d') <= #{end}
- </select>
- </mapper>
|