package com.hfkj.dao;

import com.hfkj.entity.CyymallAddress;
import com.hfkj.entity.CyymallAddressExample;
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 CyymallAddressMapper extends CyymallAddressMapperExt {
    @SelectProvider(type=CyymallAddressSqlProvider.class, method="countByExample")
    long countByExample(CyymallAddressExample example);

    @DeleteProvider(type=CyymallAddressSqlProvider.class, method="deleteByExample")
    int deleteByExample(CyymallAddressExample example);

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

    @Insert({
        "insert into cyymall_address (store_id, user_id, ",
        "`name`, mobile, province_id, ",
        "province, city_id, ",
        "city, district_id, ",
        "district, detail, ",
        "is_default, addtime, ",
        "is_delete, latitude, ",
        "longitude)",
        "values (#{storeId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, ",
        "#{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{provinceId,jdbcType=INTEGER}, ",
        "#{province,jdbcType=VARCHAR}, #{cityId,jdbcType=INTEGER}, ",
        "#{city,jdbcType=VARCHAR}, #{districtId,jdbcType=INTEGER}, ",
        "#{district,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, ",
        "#{isDefault,jdbcType=SMALLINT}, #{addtime,jdbcType=INTEGER}, ",
        "#{isDelete,jdbcType=SMALLINT}, #{latitude,jdbcType=VARCHAR}, ",
        "#{longitude,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(CyymallAddress record);

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

    @SelectProvider(type=CyymallAddressSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobile", property="mobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.INTEGER),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.INTEGER),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="district_id", property="districtId", jdbcType=JdbcType.INTEGER),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="detail", property="detail", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_default", property="isDefault", jdbcType=JdbcType.SMALLINT),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR)
    })
    List<CyymallAddress> selectByExample(CyymallAddressExample example);

    @Select({
        "select",
        "id, store_id, user_id, `name`, mobile, province_id, province, city_id, city, ",
        "district_id, district, detail, is_default, addtime, is_delete, latitude, longitude",
        "from cyymall_address",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.INTEGER),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobile", property="mobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.INTEGER),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.INTEGER),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="district_id", property="districtId", jdbcType=JdbcType.INTEGER),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="detail", property="detail", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_default", property="isDefault", jdbcType=JdbcType.SMALLINT),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR)
    })
    CyymallAddress selectByPrimaryKey(Integer id);

    @UpdateProvider(type=CyymallAddressSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CyymallAddress record, @Param("example") CyymallAddressExample example);

    @UpdateProvider(type=CyymallAddressSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CyymallAddress record, @Param("example") CyymallAddressExample example);

    @UpdateProvider(type=CyymallAddressSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CyymallAddress record);

    @Update({
        "update cyymall_address",
        "set store_id = #{storeId,jdbcType=INTEGER},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "mobile = #{mobile,jdbcType=VARCHAR},",
          "province_id = #{provinceId,jdbcType=INTEGER},",
          "province = #{province,jdbcType=VARCHAR},",
          "city_id = #{cityId,jdbcType=INTEGER},",
          "city = #{city,jdbcType=VARCHAR},",
          "district_id = #{districtId,jdbcType=INTEGER},",
          "district = #{district,jdbcType=VARCHAR},",
          "detail = #{detail,jdbcType=VARCHAR},",
          "is_default = #{isDefault,jdbcType=SMALLINT},",
          "addtime = #{addtime,jdbcType=INTEGER},",
          "is_delete = #{isDelete,jdbcType=SMALLINT},",
          "latitude = #{latitude,jdbcType=VARCHAR},",
          "longitude = #{longitude,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CyymallAddress record);
}