|
@@ -0,0 +1,155 @@
|
|
|
|
+<?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 user_id = #{userId}
|
|
|
|
+ AND promoter_id = #{promoterId}
|
|
|
|
+ </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>
|
|
|
|
+
|
|
|
|
+</mapper>
|