2024-04-23 12:23:43 +08:00
|
|
|
<?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.sky.mapper.AddressBookMapper">
|
|
|
|
|
|
|
|
<select id="list" parameterType="AddressBook" resultType="AddressBook">
|
|
|
|
select * from address_book
|
|
|
|
<where>
|
|
|
|
<if test="userId != null">
|
|
|
|
and user_id = #{userId}
|
|
|
|
</if>
|
|
|
|
<if test="phone != null">
|
|
|
|
and phone = #{phone}
|
|
|
|
</if>
|
|
|
|
<if test="isDefault != null">
|
|
|
|
and is_default = #{isDefault}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="update" parameterType="addressBook">
|
|
|
|
update address_book
|
|
|
|
<set>
|
2025-05-08 14:38:28 +08:00
|
|
|
<if test="userId != null">
|
|
|
|
user_id = #{userId},
|
|
|
|
</if>
|
2024-04-23 12:23:43 +08:00
|
|
|
<if test="consignee != null">
|
|
|
|
consignee = #{consignee},
|
|
|
|
</if>
|
|
|
|
<if test="sex != null">
|
|
|
|
sex = #{sex},
|
|
|
|
</if>
|
|
|
|
<if test="phone != null">
|
|
|
|
phone = #{phone},
|
|
|
|
</if>
|
2025-05-08 14:38:28 +08:00
|
|
|
<if test="provinceCode != null">
|
|
|
|
province_code = #{provinceCode},
|
|
|
|
</if>
|
|
|
|
<if test="provinceName != null">
|
|
|
|
province_name = #{provinceName},
|
|
|
|
</if>
|
|
|
|
<if test="cityCode != null">
|
|
|
|
city_code = #{cityCode},
|
|
|
|
</if>
|
|
|
|
<if test="cityName != null">
|
|
|
|
city_name = #{cityName},
|
|
|
|
</if>
|
|
|
|
<if test="districtCode != null">
|
|
|
|
district_code = #{districtCode},
|
|
|
|
</if>
|
|
|
|
<if test="districtName != null">
|
|
|
|
district_name = #{districtName},
|
|
|
|
</if>
|
2024-04-23 12:23:43 +08:00
|
|
|
<if test="detail != null">
|
|
|
|
detail = #{detail},
|
|
|
|
</if>
|
|
|
|
<if test="label != null">
|
|
|
|
label = #{label},
|
|
|
|
</if>
|
|
|
|
<if test="isDefault != null">
|
|
|
|
is_default = #{isDefault},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
</mapper>
|