<?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.ms.dal.mapper.ShopTo1688DsMemberMapper">

    <resultMap id="BaseResultMap" type="com.ms.dal.entity.ShopTo1688DsMember">
            <id property="shopTo1688DsMemberId" column="shop_to_1688_ds_member_id" jdbcType="BIGINT"/>
            <result property="shopId" column="shop_id" jdbcType="BIGINT"/>
            <result property="cnaliMemberId" column="cnali_member_id" jdbcType="VARCHAR"/>
            <result property="cnaliMemberName" column="cnali_member_name" jdbcType="VARCHAR"/>
            <result property="gmtExpire" column="gmt_expire" jdbcType="TIMESTAMP"/>
            <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
            <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        shop_to_1688_ds_member_id,shop_id,cnali_member_id,
        cnali_member_name,gmt_expire,gmt_create,
        gmt_modified
    </sql>

    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shop_to_1688_ds_member
        where  shop_to_1688_ds_member_id = #{shopTo1688DsMemberId,jdbcType=BIGINT}
    </select>
    <select id="getDetailByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shop_to_1688_ds_member
        where  shop_id = #{shopId,jdbcType=BIGINT}
    </select>
    <select id="selectByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from shop_to_1688_ds_member where shop_id = #{shopId,jdbcType=BIGINT}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from shop_to_1688_ds_member
        where  shop_to_1688_ds_member_id = #{shopTo1688DsMemberId,jdbcType=BIGINT}
    </delete>
    <insert id="insert" keyColumn="shop_to_1688_ds_member_id" keyProperty="shopTo1688DsMemberId" parameterType="com.ms.dal.entity.ShopTo1688DsMember" useGeneratedKeys="true">
        insert into shop_to_1688_ds_member
        ( shop_to_1688_ds_member_id,shop_id,cnali_member_id
        ,cnali_member_name,gmt_expire,gmt_create
        ,gmt_modified)
        values (#{shopTo1688DsMemberId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{cnaliMemberId,jdbcType=VARCHAR}
        ,#{cnaliMemberName,jdbcType=VARCHAR},#{gmtExpire,jdbcType=TIMESTAMP},#{gmtCreate,jdbcType=TIMESTAMP}
        ,#{gmtModified,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" keyColumn="shop_to_1688_ds_member_id" keyProperty="shopTo1688DsMemberId" parameterType="com.ms.dal.entity.ShopTo1688DsMember" useGeneratedKeys="true">
        insert into shop_to_1688_ds_member
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="shopTo1688DsMemberId != null">shop_to_1688_ds_member_id,</if>
                <if test="shopId != null">shop_id,</if>
                <if test="cnaliMemberId != null">cnali_member_id,</if>
                <if test="cnaliMemberName != null">cnali_member_name,</if>
                <if test="gmtExpire != null">gmt_expire,</if>
                <if test="gmtCreate != null">gmt_create,</if>
                <if test="gmtModified != null">gmt_modified,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="shopTo1688DsMemberId != null">#{shopTo1688DsMemberId,jdbcType=BIGINT},</if>
                <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
                <if test="cnaliMemberId != null">#{cnaliMemberId,jdbcType=VARCHAR},</if>
                <if test="cnaliMemberName != null">#{cnaliMemberName,jdbcType=VARCHAR},</if>
                <if test="gmtExpire != null">#{gmtExpire,jdbcType=TIMESTAMP},</if>
                <if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
                <if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.ShopTo1688DsMember">
        update shop_to_1688_ds_member
        <set>
                <if test="shopId != null">
                    shop_id = #{shopId,jdbcType=BIGINT},
                </if>
                <if test="cnaliMemberId != null">
                    cnali_member_id = #{cnaliMemberId,jdbcType=VARCHAR},
                </if>
                <if test="cnaliMemberName != null">
                    cnali_member_name = #{cnaliMemberName,jdbcType=VARCHAR},
                </if>
                <if test="gmtExpire != null">
                    gmt_expire = #{gmtExpire,jdbcType=TIMESTAMP},
                </if>
                <if test="gmtCreate != null">
                    gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
                </if>
                <if test="gmtModified != null">
                    gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
                </if>
        </set>
        where   shop_to_1688_ds_member_id = #{shopTo1688DsMemberId,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.ShopTo1688DsMember">
        update shop_to_1688_ds_member
        set
            shop_id =  #{shopId,jdbcType=BIGINT},
            cnali_member_id =  #{cnaliMemberId,jdbcType=VARCHAR},
            cnali_member_name =  #{cnaliMemberName,jdbcType=VARCHAR},
            gmt_expire =  #{gmtExpire,jdbcType=TIMESTAMP},
            gmt_create =  #{gmtCreate,jdbcType=TIMESTAMP},
            gmt_modified =  #{gmtModified,jdbcType=TIMESTAMP}
        where   shop_to_1688_ds_member_id = #{shopTo1688DsMemberId,jdbcType=BIGINT}
    </update>
</mapper>
