diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java index b29566d..a52b2d6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java @@ -74,7 +74,8 @@ public class OrderController extends BaseController /** * 新增订单信息 */ - @PreAuthorize("@ss.hasPermi('system:order:add')") +// @PreAuthorize("@ss.hasPermi('system:order:add')") + @Anonymous @Log(title = "订单信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Order order) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java index a46a2e6..bf25a66 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java @@ -60,4 +60,10 @@ public interface FavoriteMapper public int deleteFavoriteByIds(Long[] ids); public List selectFavoriteList2(Favorite favorite); + + public List selectFavoriteListByPersonIdAndCommodityId(Favorite favorite); + + public int insertByFavoriteByPersonIdAndCommodityId(Favorite favorite); + + public int deleteFavoriteByPersonIdAndCommodityId(Favorite favorite); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java index d6d8127..c66d172 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java @@ -60,4 +60,10 @@ public interface IFavoriteService public int deleteFavoriteById(Long id); public List selectFavoriteList2(Favorite favorite); + + public List selectFavoriteListByPersonIdAndCommodityId(Favorite favorite); + + public int insertByFavoriteByPersonIdAndCommodityId(Favorite favorite); + + public int deleteFavoriteByPersonIdAndCommodityId(Favorite favorite); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java index 6914d9e..fb18322 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java @@ -95,4 +95,19 @@ public class FavoriteServiceImpl implements IFavoriteService public List selectFavoriteList2(Favorite favorite){ return favoriteMapper.selectFavoriteList2(favorite); } + + @Override + public List selectFavoriteListByPersonIdAndCommodityId(Favorite favorite){ + return favoriteMapper.selectFavoriteListByPersonIdAndCommodityId(favorite); + } + + @Override + public int insertByFavoriteByPersonIdAndCommodityId(Favorite favorite){ + return favoriteMapper.insertByFavoriteByPersonIdAndCommodityId(favorite); + } + + @Override + public int deleteFavoriteByPersonIdAndCommodityId(Favorite favorite){ + return favoriteMapper.deleteFavoriteByPersonIdAndCommodityId(favorite); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml b/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml index f97f24d..8057b30 100644 --- a/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml @@ -87,4 +87,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND favorite.personid = p1.id AND sellerid = p2.id + + + + + INSERT INTO favorite(personid, commodityid) VALUES(#{personid}, #{commodityid}) + + + + DELETE + FROM + favorite + WHERE + personid = #{personid} + AND commodityid = #{commodityid} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml index ac93712..ef3afb9 100644 --- a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml @@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into order + insert into `order` commodityid, buyerid, @@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update order + update `order` commodityid = #{commodityid}, buyerid = #{buyerid}, @@ -59,11 +59,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from order where id = #{id} + delete from `order` where id = #{id} - delete from order where id in + delete from `order` where id in #{id}