diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserAddrMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserAddrMapper.java index 494a1c7..d81eb42 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserAddrMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/mapper/UserAddrMapper.java @@ -6,14 +6,14 @@ import org.apache.ibatis.annotations.Param; /** * 地址信息Mapper接口 - * + * * @author xsheng * @date 2025-04-14 */ public interface UserAddrMapper { /** * 查询地址信息 - * + * * @param id 地址信息主键 * @return 地址信息 */ @@ -21,7 +21,7 @@ public interface UserAddrMapper { /** * 查询地址信息列表 - * + * * @param userAddr 地址信息 * @return 地址信息集合 */ @@ -29,7 +29,7 @@ public interface UserAddrMapper { /** * 新增地址信息 - * + * * @param userAddr 地址信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface UserAddrMapper { /** * 修改地址信息 - * + * * @param userAddr 地址信息 * @return 结果 */ @@ -47,11 +47,11 @@ public interface UserAddrMapper { int updateUserAddrAsNotDefault(@Param("userId") Long userId, @Param("ifDefault") Integer ifDefault); - int updateUserAddrAsDefault(@Param("userId") Long userId, @Param("id") Long id, @Param("ifDefault") Integer ifDefault); + int updateUserAddrAsDefault(@Param("userId") Long userId, @Param("addrId") Long id, @Param("ifDefault") Integer ifDefault); /** * 删除地址信息 - * + * * @param id 地址信息主键 * @return 结果 */ @@ -59,7 +59,7 @@ public interface UserAddrMapper { /** * 批量删除地址信息 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java index 0f31496..d0ed16c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java @@ -14,7 +14,7 @@ import com.bonus.canteen.core.user.service.IUserAddrService; /** * 地址信息Service业务层处理 - * + * * @author xsheng * @date 2025-04-14 */ @@ -25,7 +25,7 @@ public class UserAddrServiceImpl implements IUserAddrService { /** * 查询地址信息 - * + * * @param id 地址信息主键 * @return 地址信息 */ @@ -36,7 +36,7 @@ public class UserAddrServiceImpl implements IUserAddrService { /** * 查询地址信息列表 - * + * * @param userAddr 地址信息 * @return 地址信息 */ @@ -48,7 +48,7 @@ public class UserAddrServiceImpl implements IUserAddrService { /** * 新增地址信息 - * + * * @param userAddr 地址信息 * @return 结果 */ @@ -65,7 +65,7 @@ public class UserAddrServiceImpl implements IUserAddrService { /** * 修改地址信息 - * + * * @param userAddr 地址信息 * @return 结果 */ @@ -88,13 +88,14 @@ public class UserAddrServiceImpl implements IUserAddrService { userAddrMapper.updateUserAddrAsDefault(userAddr.getUserId(), userAddr.getAddrId(), YesOrNoEnum.YES.key()); return 1; } catch (Exception e) { + e.printStackTrace(); throw new ServiceException("设置默认地址失败"); } } /** * 批量删除地址信息 - * + * * @param ids 需要删除的地址信息主键 * @return 结果 */ @@ -105,7 +106,7 @@ public class UserAddrServiceImpl implements IUserAddrService { /** * 删除地址信息信息 - * + * * @param id 地址信息主键 * @return 结果 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserAddrMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserAddrMapper.xml index e6d8583..98448ad 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserAddrMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/user/UserAddrMapper.xml @@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into user_addr @@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from user_addr where addr_id = #{addrId} + delete from user_addr where addr_id = #{id} @@ -109,4 +109,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{addrId} - \ No newline at end of file +