<?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.kxs.user.biz.mapper.KxsUserAddressMapper">

    <resultMap type="com.kxs.user.api.model.KxsUserAddress" id="KxsUserAddressMap">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="version" property="version" />
        <result column="user_id" property="userId" />
        <result column="address" property="address" />
        <result column="phone" property="phone" />
        <result column="consignee" property="consignee" />
        <result column="province" property="province" />
        <result column="city" property="city" />
        <result column="area" property="area" />
        <result column="is_default" property="isDefault" />

    </resultMap>

    <select id="userAddressList" resultType="com.kxs.user.api.vo.kxsapp.userAddress.UserAddressListVO">
        SELECT * from kxs_user_address
        where user_id = #{userId} and del_flag = 0
        order by is_default desc
    </select>

</mapper>
