package com.hfkj.dao;

import com.hfkj.entity.CyymallUser;
import com.hfkj.entity.CyymallUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface CyymallUserMapper extends CyymallUserMapperExt {
    @SelectProvider(type=CyymallUserSqlProvider.class, method="countByExample")
    long countByExample(CyymallUserExample example);

    @DeleteProvider(type=CyymallUserSqlProvider.class, method="deleteByExample")
    int deleteByExample(CyymallUserExample example);

    @Delete({
        "delete from cyymall_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into cyymall_user (`type`, username, ",
        "`password`, auth_key, ",
        "access_token, addtime, ",
        "is_delete, wechat_open_id, ",
        "wechat_union_id, nickname, ",
        "avatar_url, store_id, ",
        "is_distributor, parent_id, ",
        "`time`, total_price, ",
        "price, is_clerk, ",
        "we7_uid, shop_id, ",
        "`level`, integral, ",
        "total_integral, money, ",
        "contact_way, comments, ",
        "binding, wechat_platform_open_id, ",
        "platform, blacklist, ",
        "parent_user_id, appcid, ",
        "is_admin, tuan_price, ",
        "is_delivery, mch_id, real_name, ",
        "real_code, real_just_pic, ",
        "real_back_pic, is_real, ",
        "live_price, fyjine, ",
        "yifan, delivery_office, ",
        "subsidy_price, delivery_mch_id, ",
        "clerk_mch_id, is_group_centre, ",
        "sex, birth_date, ",
        "is_vgoods, share_cat_id, ",
        "user_label, gh_card_no, ",
        "gh_card_pwd, channel_phone, ",
        "channel_sign, email, ",
        "apply_time, apply_status)",
        "values (#{type,jdbcType=SMALLINT}, #{username,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{authKey,jdbcType=VARCHAR}, ",
        "#{accessToken,jdbcType=VARCHAR}, #{addtime,jdbcType=INTEGER}, ",
        "#{isDelete,jdbcType=SMALLINT}, #{wechatOpenId,jdbcType=VARCHAR}, ",
        "#{wechatUnionId,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, ",
        "#{avatarUrl,jdbcType=VARCHAR}, #{storeId,jdbcType=INTEGER}, ",
        "#{isDistributor,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, ",
        "#{time,jdbcType=INTEGER}, #{totalPrice,jdbcType=DECIMAL}, ",
        "#{price,jdbcType=DECIMAL}, #{isClerk,jdbcType=INTEGER}, ",
        "#{we7Uid,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, ",
        "#{level,jdbcType=INTEGER}, #{integral,jdbcType=INTEGER}, ",
        "#{totalIntegral,jdbcType=INTEGER}, #{money,jdbcType=DECIMAL}, ",
        "#{contactWay,jdbcType=VARCHAR}, #{comments,jdbcType=VARCHAR}, ",
        "#{binding,jdbcType=CHAR}, #{wechatPlatformOpenId,jdbcType=VARCHAR}, ",
        "#{platform,jdbcType=TINYINT}, #{blacklist,jdbcType=BIT}, ",
        "#{parentUserId,jdbcType=INTEGER}, #{appcid,jdbcType=VARCHAR}, ",
        "#{isAdmin,jdbcType=BIT}, #{tuanPrice,jdbcType=DECIMAL}, ",
        "#{isDelivery,jdbcType=BIT}, #{mchId,jdbcType=INTEGER}, #{realName,jdbcType=VARCHAR}, ",
        "#{realCode,jdbcType=VARCHAR}, #{realJustPic,jdbcType=VARCHAR}, ",
        "#{realBackPic,jdbcType=VARCHAR}, #{isReal,jdbcType=BIT}, ",
        "#{livePrice,jdbcType=DECIMAL}, #{fyjine,jdbcType=VARCHAR}, ",
        "#{yifan,jdbcType=VARCHAR}, #{deliveryOffice,jdbcType=BIT}, ",
        "#{subsidyPrice,jdbcType=DECIMAL}, #{deliveryMchId,jdbcType=INTEGER}, ",
        "#{clerkMchId,jdbcType=INTEGER}, #{isGroupCentre,jdbcType=INTEGER}, ",
        "#{sex,jdbcType=INTEGER}, #{birthDate,jdbcType=VARCHAR}, ",
        "#{isVgoods,jdbcType=INTEGER}, #{shareCatId,jdbcType=INTEGER}, ",
        "#{userLabel,jdbcType=INTEGER}, #{ghCardNo,jdbcType=VARCHAR}, ",
        "#{ghCardPwd,jdbcType=INTEGER}, #{channelPhone,jdbcType=CHAR}, ",
        "#{channelSign,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ",
        "#{applyTime,jdbcType=INTEGER}, #{applyStatus,jdbcType=SMALLINT})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(CyymallUser record);

    @InsertProvider(type=CyymallUserSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(CyymallUser record);

    @SelectProvider(type=CyymallUserSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.SMALLINT),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="auth_key", property="authKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="access_token", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR),
        @Result(column="wechat_union_id", property="wechatUnionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar_url", property="avatarUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_distributor", property="isDistributor", jdbcType=JdbcType.INTEGER),
        @Result(column="parent_id", property="parentId", jdbcType=JdbcType.INTEGER),
        @Result(column="time", property="time", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="is_clerk", property="isClerk", jdbcType=JdbcType.INTEGER),
        @Result(column="we7_uid", property="we7Uid", jdbcType=JdbcType.INTEGER),
        @Result(column="shop_id", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="level", property="level", jdbcType=JdbcType.INTEGER),
        @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER),
        @Result(column="total_integral", property="totalIntegral", jdbcType=JdbcType.INTEGER),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="contact_way", property="contactWay", jdbcType=JdbcType.VARCHAR),
        @Result(column="comments", property="comments", jdbcType=JdbcType.VARCHAR),
        @Result(column="binding", property="binding", jdbcType=JdbcType.CHAR),
        @Result(column="wechat_platform_open_id", property="wechatPlatformOpenId", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform", property="platform", jdbcType=JdbcType.TINYINT),
        @Result(column="blacklist", property="blacklist", jdbcType=JdbcType.BIT),
        @Result(column="parent_user_id", property="parentUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="appcid", property="appcid", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.BIT),
        @Result(column="tuan_price", property="tuanPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="is_delivery", property="isDelivery", jdbcType=JdbcType.BIT),
        @Result(column="mch_id", property="mchId", jdbcType=JdbcType.INTEGER),
        @Result(column="real_name", property="realName", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_code", property="realCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_just_pic", property="realJustPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_back_pic", property="realBackPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_real", property="isReal", jdbcType=JdbcType.BIT),
        @Result(column="live_price", property="livePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="fyjine", property="fyjine", jdbcType=JdbcType.VARCHAR),
        @Result(column="yifan", property="yifan", jdbcType=JdbcType.VARCHAR),
        @Result(column="delivery_office", property="deliveryOffice", jdbcType=JdbcType.BIT),
        @Result(column="subsidy_price", property="subsidyPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="delivery_mch_id", property="deliveryMchId", jdbcType=JdbcType.INTEGER),
        @Result(column="clerk_mch_id", property="clerkMchId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_group_centre", property="isGroupCentre", jdbcType=JdbcType.INTEGER),
        @Result(column="sex", property="sex", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_date", property="birthDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_vgoods", property="isVgoods", jdbcType=JdbcType.INTEGER),
        @Result(column="share_cat_id", property="shareCatId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_label", property="userLabel", jdbcType=JdbcType.INTEGER),
        @Result(column="gh_card_no", property="ghCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gh_card_pwd", property="ghCardPwd", jdbcType=JdbcType.INTEGER),
        @Result(column="channel_phone", property="channelPhone", jdbcType=JdbcType.CHAR),
        @Result(column="channel_sign", property="channelSign", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_time", property="applyTime", jdbcType=JdbcType.INTEGER),
        @Result(column="apply_status", property="applyStatus", jdbcType=JdbcType.SMALLINT)
    })
    List<CyymallUser> selectByExample(CyymallUserExample example);

    @Select({
        "select",
        "id, `type`, username, `password`, auth_key, access_token, addtime, is_delete, ",
        "wechat_open_id, wechat_union_id, nickname, avatar_url, store_id, is_distributor, ",
        "parent_id, `time`, total_price, price, is_clerk, we7_uid, shop_id, `level`, ",
        "integral, total_integral, money, contact_way, comments, binding, wechat_platform_open_id, ",
        "platform, blacklist, parent_user_id, appcid, is_admin, tuan_price, is_delivery, ",
        "mch_id, real_name, real_code, real_just_pic, real_back_pic, is_real, live_price, ",
        "fyjine, yifan, delivery_office, subsidy_price, delivery_mch_id, clerk_mch_id, ",
        "is_group_centre, sex, birth_date, is_vgoods, share_cat_id, user_label, gh_card_no, ",
        "gh_card_pwd, channel_phone, channel_sign, email, apply_time, apply_status",
        "from cyymall_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.SMALLINT),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="auth_key", property="authKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="access_token", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR),
        @Result(column="wechat_union_id", property="wechatUnionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar_url", property="avatarUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_distributor", property="isDistributor", jdbcType=JdbcType.INTEGER),
        @Result(column="parent_id", property="parentId", jdbcType=JdbcType.INTEGER),
        @Result(column="time", property="time", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="is_clerk", property="isClerk", jdbcType=JdbcType.INTEGER),
        @Result(column="we7_uid", property="we7Uid", jdbcType=JdbcType.INTEGER),
        @Result(column="shop_id", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="level", property="level", jdbcType=JdbcType.INTEGER),
        @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER),
        @Result(column="total_integral", property="totalIntegral", jdbcType=JdbcType.INTEGER),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="contact_way", property="contactWay", jdbcType=JdbcType.VARCHAR),
        @Result(column="comments", property="comments", jdbcType=JdbcType.VARCHAR),
        @Result(column="binding", property="binding", jdbcType=JdbcType.CHAR),
        @Result(column="wechat_platform_open_id", property="wechatPlatformOpenId", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform", property="platform", jdbcType=JdbcType.TINYINT),
        @Result(column="blacklist", property="blacklist", jdbcType=JdbcType.BIT),
        @Result(column="parent_user_id", property="parentUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="appcid", property="appcid", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.BIT),
        @Result(column="tuan_price", property="tuanPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="is_delivery", property="isDelivery", jdbcType=JdbcType.BIT),
        @Result(column="mch_id", property="mchId", jdbcType=JdbcType.INTEGER),
        @Result(column="real_name", property="realName", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_code", property="realCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_just_pic", property="realJustPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="real_back_pic", property="realBackPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_real", property="isReal", jdbcType=JdbcType.BIT),
        @Result(column="live_price", property="livePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="fyjine", property="fyjine", jdbcType=JdbcType.VARCHAR),
        @Result(column="yifan", property="yifan", jdbcType=JdbcType.VARCHAR),
        @Result(column="delivery_office", property="deliveryOffice", jdbcType=JdbcType.BIT),
        @Result(column="subsidy_price", property="subsidyPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="delivery_mch_id", property="deliveryMchId", jdbcType=JdbcType.INTEGER),
        @Result(column="clerk_mch_id", property="clerkMchId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_group_centre", property="isGroupCentre", jdbcType=JdbcType.INTEGER),
        @Result(column="sex", property="sex", jdbcType=JdbcType.INTEGER),
        @Result(column="birth_date", property="birthDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_vgoods", property="isVgoods", jdbcType=JdbcType.INTEGER),
        @Result(column="share_cat_id", property="shareCatId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_label", property="userLabel", jdbcType=JdbcType.INTEGER),
        @Result(column="gh_card_no", property="ghCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gh_card_pwd", property="ghCardPwd", jdbcType=JdbcType.INTEGER),
        @Result(column="channel_phone", property="channelPhone", jdbcType=JdbcType.CHAR),
        @Result(column="channel_sign", property="channelSign", jdbcType=JdbcType.VARCHAR),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_time", property="applyTime", jdbcType=JdbcType.INTEGER),
        @Result(column="apply_status", property="applyStatus", jdbcType=JdbcType.SMALLINT)
    })
    CyymallUser selectByPrimaryKey(Integer id);

    @UpdateProvider(type=CyymallUserSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CyymallUser record, @Param("example") CyymallUserExample example);

    @UpdateProvider(type=CyymallUserSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CyymallUser record, @Param("example") CyymallUserExample example);

    @UpdateProvider(type=CyymallUserSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CyymallUser record);

    @Update({
        "update cyymall_user",
        "set `type` = #{type,jdbcType=SMALLINT},",
          "username = #{username,jdbcType=VARCHAR},",
          "`password` = #{password,jdbcType=VARCHAR},",
          "auth_key = #{authKey,jdbcType=VARCHAR},",
          "access_token = #{accessToken,jdbcType=VARCHAR},",
          "addtime = #{addtime,jdbcType=INTEGER},",
          "is_delete = #{isDelete,jdbcType=SMALLINT},",
          "wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},",
          "wechat_union_id = #{wechatUnionId,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "avatar_url = #{avatarUrl,jdbcType=VARCHAR},",
          "store_id = #{storeId,jdbcType=INTEGER},",
          "is_distributor = #{isDistributor,jdbcType=INTEGER},",
          "parent_id = #{parentId,jdbcType=INTEGER},",
          "`time` = #{time,jdbcType=INTEGER},",
          "total_price = #{totalPrice,jdbcType=DECIMAL},",
          "price = #{price,jdbcType=DECIMAL},",
          "is_clerk = #{isClerk,jdbcType=INTEGER},",
          "we7_uid = #{we7Uid,jdbcType=INTEGER},",
          "shop_id = #{shopId,jdbcType=INTEGER},",
          "`level` = #{level,jdbcType=INTEGER},",
          "integral = #{integral,jdbcType=INTEGER},",
          "total_integral = #{totalIntegral,jdbcType=INTEGER},",
          "money = #{money,jdbcType=DECIMAL},",
          "contact_way = #{contactWay,jdbcType=VARCHAR},",
          "comments = #{comments,jdbcType=VARCHAR},",
          "binding = #{binding,jdbcType=CHAR},",
          "wechat_platform_open_id = #{wechatPlatformOpenId,jdbcType=VARCHAR},",
          "platform = #{platform,jdbcType=TINYINT},",
          "blacklist = #{blacklist,jdbcType=BIT},",
          "parent_user_id = #{parentUserId,jdbcType=INTEGER},",
          "appcid = #{appcid,jdbcType=VARCHAR},",
          "is_admin = #{isAdmin,jdbcType=BIT},",
          "tuan_price = #{tuanPrice,jdbcType=DECIMAL},",
          "is_delivery = #{isDelivery,jdbcType=BIT},",
          "mch_id = #{mchId,jdbcType=INTEGER},",
          "real_name = #{realName,jdbcType=VARCHAR},",
          "real_code = #{realCode,jdbcType=VARCHAR},",
          "real_just_pic = #{realJustPic,jdbcType=VARCHAR},",
          "real_back_pic = #{realBackPic,jdbcType=VARCHAR},",
          "is_real = #{isReal,jdbcType=BIT},",
          "live_price = #{livePrice,jdbcType=DECIMAL},",
          "fyjine = #{fyjine,jdbcType=VARCHAR},",
          "yifan = #{yifan,jdbcType=VARCHAR},",
          "delivery_office = #{deliveryOffice,jdbcType=BIT},",
          "subsidy_price = #{subsidyPrice,jdbcType=DECIMAL},",
          "delivery_mch_id = #{deliveryMchId,jdbcType=INTEGER},",
          "clerk_mch_id = #{clerkMchId,jdbcType=INTEGER},",
          "is_group_centre = #{isGroupCentre,jdbcType=INTEGER},",
          "sex = #{sex,jdbcType=INTEGER},",
          "birth_date = #{birthDate,jdbcType=VARCHAR},",
          "is_vgoods = #{isVgoods,jdbcType=INTEGER},",
          "share_cat_id = #{shareCatId,jdbcType=INTEGER},",
          "user_label = #{userLabel,jdbcType=INTEGER},",
          "gh_card_no = #{ghCardNo,jdbcType=VARCHAR},",
          "gh_card_pwd = #{ghCardPwd,jdbcType=INTEGER},",
          "channel_phone = #{channelPhone,jdbcType=CHAR},",
          "channel_sign = #{channelSign,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR},",
          "apply_time = #{applyTime,jdbcType=INTEGER},",
          "apply_status = #{applyStatus,jdbcType=SMALLINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CyymallUser record);
}