|
@@ -0,0 +1,282 @@
|
|
|
+<?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.KuaishouItemCollectSamplesMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruixuan.isc.entity.KuaishouItemCollectSamples" id="KuaishouItemCollectSamplesResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="itemId" column="item_id"/>
|
|
|
+ <result property="itemTitle" column="item_title"/>
|
|
|
+ <result property="itemPrice" column="item_price"/>
|
|
|
+ <result property="itemMgUrl" column="item_mg_url"/>
|
|
|
+ <result property="itemDesc" column="item_desc"/>
|
|
|
+ <result property="commissionRate" column="commission_rate"/>
|
|
|
+ <result property="regimentalPromotion" column="regimental_promotion"/>
|
|
|
+ <result property="sampleCount" column="sample_count"/>
|
|
|
+ <result property="sampleRequirement" column="sample_requirement"/>
|
|
|
+ <result property="itemCreateId" column="item_create_id"/>
|
|
|
+ <result property="itemCreateName" column="item_create_name"/>
|
|
|
+ <result property="collectSampleId" column="collect_sample_id"/>
|
|
|
+ <result property="collectSampleName" column="collect_sample_name"/>
|
|
|
+ <result property="partnerRecommendText" column="partner_recommend_text"/>
|
|
|
+ <result property="promoterId" column="promoter_id"/>
|
|
|
+ <result property="promoterNickName" column="promoter_nick_name"/>
|
|
|
+ <result property="promoterUrl" column="promoter_url"/>
|
|
|
+ <result property="promoterPhone" column="promoter_phone"/>
|
|
|
+ <result property="promoterAddress" column="promoter_address"/>
|
|
|
+ <result property="courierNumber" column="courier_number"/>
|
|
|
+ <result property="taskFileUrl" column="task_file_url"/>
|
|
|
+ <result property="collectSampleStatus" column="collect_sample_status"/>
|
|
|
+ <result property="collectSampleDesc" column="collect_sample_desc"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectKuaishouItemCollectSamplesVo">
|
|
|
+ select id, item_id, item_title, item_price, item_mg_url, item_desc, commission_rate, regimental_promotion, sample_count, sample_requirement, item_create_id, item_create_name, collect_sample_id, collect_sample_name, partner_recommend_text, promoter_id, promoter_nick_name,promoter_url, promoter_phone, promoter_address, courier_number, task_file_url, collect_sample_status, collect_sample_desc, create_time, update_time from kuaishou_item_collect_samples
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectKuaishouItemCollectSamplesList" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples"
|
|
|
+ resultMap="KuaishouItemCollectSamplesResult">
|
|
|
+ <include refid="selectKuaishouItemCollectSamplesVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="itemId != null ">and item_id = #{itemId}</if>
|
|
|
+ <if test="promoterId != null ">and promoter_id = #{promoterId}</if>
|
|
|
+ <if test="collectSampleStatus != null ">and collect_sample_status = #{collectSampleStatus}</if>
|
|
|
+ <if test="itemCreateId != null and itemCreateId != ''">
|
|
|
+ and item_create_id = #{itemCreateId}
|
|
|
+ </if>
|
|
|
+ <if test='itemCreateIds != null and itemCreateIds.size() > 0'>
|
|
|
+ AND item_create_id in
|
|
|
+ <foreach collection="itemCreateId" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="collectSampleId != null and collectSampleId != ''">
|
|
|
+ and collect_sample_id = #{collectSampleId}
|
|
|
+ </if>
|
|
|
+ <if test='collectSampleIds != null and collectSampleIds.size() > 0'>
|
|
|
+ AND collect_sample_id in
|
|
|
+ <foreach collection="collectSampleIds" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectKuaishouItemCollectSamplesById" parameterType="java.lang.Long"
|
|
|
+ resultMap="KuaishouItemCollectSamplesResult">
|
|
|
+ <include refid="selectKuaishouItemCollectSamplesVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="getItemList" resultType="com.alibaba.fastjson.JSONObject"
|
|
|
+ parameterType="com.alibaba.fastjson.JSONArray">
|
|
|
+ select
|
|
|
+ item_id as 'itemId',
|
|
|
+ item_title as 'itemTitle',
|
|
|
+ item_price as 'itemPrice',
|
|
|
+ item_mg_url as 'itemMgUrl',
|
|
|
+ regimental_promotion as 'regimentalPromotion',
|
|
|
+ user_id as 'userId',
|
|
|
+ user_name as 'userName'
|
|
|
+ from kuaishou_item_list
|
|
|
+ where 1 =1
|
|
|
+ <if test='itemIds != null and itemIds.size() > 0'>
|
|
|
+ AND item_id in
|
|
|
+ <foreach collection="itemIds" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ group item_id
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="promoterList" resultType="com.alibaba.fastjson.JSONObject"
|
|
|
+ parameterType="com.alibaba.fastjson.JSONArray">
|
|
|
+ select
|
|
|
+ promoter_id as 'promoterId',
|
|
|
+ promoter_nick_name as 'promoterNickName',
|
|
|
+ promoter_url as 'promoterUrl',
|
|
|
+ promoter_address as 'promoterAddress',
|
|
|
+ from kuaishou_promoter
|
|
|
+ where 1 =1
|
|
|
+ <if test='itemIds != null and itemIds.size() > 0'>
|
|
|
+ AND promoter_id in
|
|
|
+ <foreach collection="promoterIds" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ group promoter_id
|
|
|
+ </select>
|
|
|
+ <select id="check" resultType="java.lang.Integer">
|
|
|
+ select count(1) from kuaishou_item_collect_samples
|
|
|
+ where item_id = #{itemId}
|
|
|
+ and promoter_id = #{promoterId}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertKuaishouItemCollectSamples" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples">
|
|
|
+ insert into kuaishou_item_collect_samples
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="itemId != null">item_id,</if>
|
|
|
+ <if test="itemTitle != null">item_title,</if>
|
|
|
+ <if test="itemPrice != null">item_price,</if>
|
|
|
+ <if test="itemMgUrl != null">item_mg_url,</if>
|
|
|
+ <if test="itemDesc != null">item_desc,</if>
|
|
|
+ <if test="commissionRate != null">commission_rate,</if>
|
|
|
+ <if test="regimentalPromotion != null">regimental_promotion,</if>
|
|
|
+ <if test="sampleCount != null">sample_count,</if>
|
|
|
+ <if test="sampleRequirement != null">sample_requirement,</if>
|
|
|
+ <if test="itemCreateId != null">item_create_id,</if>
|
|
|
+ <if test="itemCreateName != null">item_create_name,</if>
|
|
|
+ <if test="collectSampleId != null">collect_sample_id,</if>
|
|
|
+ <if test="collectSampleName != null">collect_sample_name,</if>
|
|
|
+ <if test="partnerRecommendText != null">partner_recommend_text,</if>
|
|
|
+ <if test="promoterId != null">promoter_id,</if>
|
|
|
+ <if test="promoterNickName != null">promoter_nick_name,</if>
|
|
|
+ <if test="promoterUrl != null">promoter_url,</if>
|
|
|
+ <if test="promoterPhone != null">promoter_phone,</if>
|
|
|
+ <if test="promoterAddress != null">promoter_address,</if>
|
|
|
+ <if test="courierNumber != null">courier_number,</if>
|
|
|
+ <if test="taskFileUrl != null">task_file_url,</if>
|
|
|
+ <if test="collectSampleStatus != null">collect_sample_status,</if>
|
|
|
+ <if test="collectSampleDesc != null">collect_sample_desc,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="itemId != null">#{itemId},</if>
|
|
|
+ <if test="itemTitle != null">#{itemTitle},</if>
|
|
|
+ <if test="itemPrice != null">#{itemPrice},</if>
|
|
|
+ <if test="itemMgUrl != null">#{itemMgUrl},</if>
|
|
|
+ <if test="itemDesc != null">#{itemDesc},</if>
|
|
|
+ <if test="commissionRate != null">#{commissionRate},</if>
|
|
|
+ <if test="regimentalPromotion != null">#{regimentalPromotion},</if>
|
|
|
+ <if test="sampleCount != null">#{sampleCount},</if>
|
|
|
+ <if test="sampleRequirement != null">#{sampleRequirement},</if>
|
|
|
+ <if test="itemCreateId != null">#{itemCreateId},</if>
|
|
|
+ <if test="itemCreateName != null">#{itemCreateName},</if>
|
|
|
+ <if test="collectSampleId != null">#{collectSampleId},</if>
|
|
|
+ <if test="collectSampleName != null">#{collectSampleName},</if>
|
|
|
+ <if test="partnerRecommendText != null">#{partnerRecommendText},</if>
|
|
|
+ <if test="promoterId != null">#{promoterId},</if>
|
|
|
+ <if test="promoterNickName != null">#{promoterNickName},</if>
|
|
|
+ <if test="promoterUrl != null">#{promoterUrl},</if>
|
|
|
+ <if test="promoterPhone != null">#{promoterPhone},</if>
|
|
|
+ <if test="promoterAddress != null">#{promoterAddress},</if>
|
|
|
+ <if test="courierNumber != null">#{courierNumber},</if>
|
|
|
+ <if test="taskFileUrl != null">#{taskFileUrl},</if>
|
|
|
+ <if test="collectSampleStatus != null">#{collectSampleStatus},</if>
|
|
|
+ <if test="collectSampleDesc != null">#{collectSampleDesc},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <insert id="batchAdd">
|
|
|
+ insert into kuaishou_item_collect_samples(
|
|
|
+ id,
|
|
|
+ item_id,
|
|
|
+ item_title,
|
|
|
+ item_price,
|
|
|
+ item_mg_url,
|
|
|
+ item_desc,
|
|
|
+ commission_rate,
|
|
|
+ regimental_promotion,
|
|
|
+ sample_count,
|
|
|
+ sample_requirement,
|
|
|
+ item_create_id,
|
|
|
+ item_create_name,
|
|
|
+ collect_sample_id,
|
|
|
+ collect_sample_name,
|
|
|
+ partner_recommend_text,
|
|
|
+ promoter_id,
|
|
|
+ promoter_nick_name,
|
|
|
+ promoter_phone,
|
|
|
+ promoter_address,
|
|
|
+ courier_number,
|
|
|
+ task_file_url,
|
|
|
+ collect_sample_status,
|
|
|
+ collect_sample_desc
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection="adds" item="add" separator=",">
|
|
|
+ (
|
|
|
+ #{add.itemId},
|
|
|
+ #{add.itemTitle},
|
|
|
+ #{add.itemPrice},
|
|
|
+ #{add.itemMgUrl},
|
|
|
+ #{add.itemDesc},
|
|
|
+ #{add.commissionRate},
|
|
|
+ #{add.regimentalOromotion},
|
|
|
+ #{add.sampleCount},
|
|
|
+ #{add.sampleRequirement},
|
|
|
+ #{add.itemCreateId},
|
|
|
+ #{add.itemCreateName},
|
|
|
+ #{add.collectSampleId},
|
|
|
+ #{add.collectSampleName},
|
|
|
+ #{add.partnerRecommendText},
|
|
|
+ #{add.promoterId},
|
|
|
+ #{add.promoterNickName},
|
|
|
+ #{add.promoterPhone},
|
|
|
+ #{add.promoterAddress},
|
|
|
+ #{add.courierNumber},
|
|
|
+ #{add.taskFileUrl},
|
|
|
+ #{add.collectSampleStatus},
|
|
|
+ #{add.collectSampleDesc}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateKuaishouItemCollectSamples" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples">
|
|
|
+ update kuaishou_item_collect_samples
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="itemId != null">item_id = #{itemId},</if>
|
|
|
+ <if test="itemTitle != null">item_title = #{itemTitle},</if>
|
|
|
+ <if test="itemPrice != null">item_price = #{itemPrice},</if>
|
|
|
+ <if test="itemMgUrl != null">item_mg_url = #{itemMgUrl},</if>
|
|
|
+ <if test="itemDesc != null">item_desc = #{itemDesc},</if>
|
|
|
+ <if test="commissionRate != null">commission_rate = #{commissionRate},</if>
|
|
|
+ <if test="regimentalPromotion != null">regimental_promotion = #{regimentalPromotion},</if>
|
|
|
+ <if test="sampleCount != null">sample_count = #{sampleCount},</if>
|
|
|
+ <if test="sampleRequirement != null">sample_requirement = #{sampleRequirement},</if>
|
|
|
+ <if test="itemCreateId != null">item_create_id = #{itemCreateId},</if>
|
|
|
+ <if test="itemCreateName != null">item_create_name = #{itemCreateName},</if>
|
|
|
+ <if test="collectSampleId != null">collect_sample_id = #{collectSampleId},</if>
|
|
|
+ <if test="collectSampleName != null">collect_sample_name = #{collectSampleName},</if>
|
|
|
+ <if test="partnerRecommendText != null">partner_recommend_text = #{partnerRecommendText},</if>
|
|
|
+ <if test="promoterId != null">promoter_id = #{promoterId},</if>
|
|
|
+ <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
|
|
|
+ <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
|
|
|
+ <if test="promoterPhone != null">promoter_phone = #{promoterPhone},</if>
|
|
|
+ <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
|
|
|
+ <if test="courierNumber != null">courier_number = #{courierNumber},</if>
|
|
|
+ <if test="taskFileUrl != null">task_file_url = #{taskFileUrl},</if>
|
|
|
+ <if test="collectSampleStatus != null">collect_sample_status = #{collectSampleStatus},</if>
|
|
|
+ <if test="collectSampleDesc != null">collect_sample_desc = #{collectSampleDesc},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteKuaishouItemCollectSamplesById" parameterType="java.lang.Long">
|
|
|
+ delete from kuaishou_item_collect_samples where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteKuaishouItemCollectSamplesByIds" parameterType="java.lang.String">
|
|
|
+ delete from kuaishou_item_collect_samples where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|