From ed561a2796dab30a7c0a0ddbed2d898c3c8ba793 Mon Sep 17 00:00:00 2001 From: xin <1099200748@qq.com> Date: Wed, 02 Jul 2025 15:45:18 +0800 Subject: [PATCH] 用户地址信息 --- oying-system/src/main/resources/mapper/sh/UserAddressMapper.xml | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/oying-system/src/main/resources/mapper/sh/UserAddressMapper.xml b/oying-system/src/main/resources/mapper/sh/UserAddressMapper.xml index 52be65d..2719b7d 100644 --- a/oying-system/src/main/resources/mapper/sh/UserAddressMapper.xml +++ b/oying-system/src/main/resources/mapper/sh/UserAddressMapper.xml @@ -24,17 +24,23 @@ <sql id="Base_Column_List"> address_id, user_id, receiver_name, receiver_phone, province, city, district, street, detail, longitude, latitude, is_default, tag, create_by, create_time, update_by, update_time </sql> + <update id="isDefault"> + update sh_user_address set is_default = false where user_id = #{userId} + </update> <select id="findAll" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from sh_user_address <where> - <if test="criteria.userId != null"> + <if test="criteria.userId != null and criteria.userId != ''"> and user_id = #{criteria.userId} </if> - <if test="criteria.tag != null"> + <if test="criteria.tag != null and criteria.tag != ''"> and tag = #{criteria.tag} + </if> + <if test="criteria.phone != null and criteria.phone != ''"> + and receiver_phone like concat('%',#{criteria.phone},'%') </if> <if test="criteria.createTime != null and criteria.createTime.size() > 0"> AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]} @@ -42,4 +48,4 @@ </where> order by address_id desc </select> -</mapper> \ No newline at end of file +</mapper> -- Gitblit v1.9.3