diff --git a/back-end_code/src/main/java/com/shop/controller/CategoryController.java b/back-end_code/src/main/java/com/shop/controller/CategoryController.java index bad8c580bcd6ba018b06a9cb2d34738f033e3d7a..dd834fb5ad1a6b673d26c5f84b74f2bee7a66cc1 100644 --- a/back-end_code/src/main/java/com/shop/controller/CategoryController.java +++ b/back-end_code/src/main/java/com/shop/controller/CategoryController.java @@ -23,13 +23,18 @@ public class CategoryController { public Object addCategory(@RequestBody Category category){ String message = "error"; String category_name = category.getCategory_name(); - int parentCategory_id = category.getParentCategory_id(); JSONObject jsonObject = new JSONObject(); - int result = CategoryService.addCategory(category_name,parentCategory_id); - if(result>=1){ - message = "success"; - } else{ - message = "error"; + Category categoryExist = CategoryService.searchCategoryByName(category_name); + if(categoryExist!=null){ + message="类别已存在"; + }else { + int parentCategory_id = category.getParentCategory_id(); + int result = CategoryService.addCategory(category_name,parentCategory_id); + if(result>=1){ + message = "success"; + } else{ + message = "error"; + } } jsonObject.put("message",message); return jsonObject; @@ -51,6 +56,21 @@ public class CategoryController { return jsonObject; } + //查询所有类别 + @GetMapping("/searchAllCategory") + public Object searchAllCategory(){ + String message = "error"; + JSONObject jsonObject = new JSONObject(); + List categoryList = CategoryService.searchAllCategory(); + if(categoryList != null){ + message = "success"; + jsonObject.put("categories", categoryList); + } else{ + message = "error"; + } + jsonObject.put("message",message); + return jsonObject; + } //根据parentCategory_id查询子类别 @GetMapping(value = "/searchChildCategory") public Object searchChildCategory(@RequestParam (defaultValue = "1") Integer parentCategory_id){ diff --git a/back-end_code/src/main/java/com/shop/controller/FileController.java b/back-end_code/src/main/java/com/shop/controller/FileController.java new file mode 100644 index 0000000000000000000000000000000000000000..6380a1f81b031e0c68defe03c4d9de223341f067 --- /dev/null +++ b/back-end_code/src/main/java/com/shop/controller/FileController.java @@ -0,0 +1,39 @@ +package com.shop.controller; + +import com.shop.utils.Result; +import com.shop.utils.StringUtil; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.PropertySource; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; + +@RestController +@RequestMapping("/file") +@PropertySource("classpath:application.yml")//读取application.yml文件 +public class FileController { + + @Value("${filepath.bin}") + private String fileBinPath; + + @RequestMapping("/uploadBin") + public Result uploadBin(@RequestParam MultipartFile file){ + + String filename=file.getOriginalFilename(); + String newFilename = StringUtil.getRandomName(filename); + String fullPath = fileBinPath+newFilename; + File dest = new File(fullPath); + try { + file.transferTo(dest); + return Result.ok("path",fullPath); + } catch (IOException e) { + e.printStackTrace(); + return Result.fail(); + } + + } +} diff --git a/back-end_code/src/main/java/com/shop/controller/GoodsController.java b/back-end_code/src/main/java/com/shop/controller/GoodsController.java index 68737baf6d1f01fcdd86b6935e5ea116f60f2a65..f419bca73cc6de49522b332026b0bd7f01006fd6 100644 --- a/back-end_code/src/main/java/com/shop/controller/GoodsController.java +++ b/back-end_code/src/main/java/com/shop/controller/GoodsController.java @@ -38,17 +38,17 @@ public class GoodsController { UploadImageService uploadImageService; //向Goods表中添加商品 - @RequestMapping(value = "/addGoods") - public Object addGoods(HttpServletRequest request, HttpServletResponse response) { + @PostMapping(value = "/addGoods") + public Object addGoods(@RequestBody Goods goods) { String message = "error"; - String goods_name = request.getParameter("goods_name"); + String goods_name = goods.getGoods_name(); String seller_username = "admin"; - int goods_stock = Integer.parseInt(request.getParameter("goods_stock")); + int goods_stock =goods.getGoods_stock(); // String goods_img = uploadImageService.uploadQNImg((FileInputStream) file.getInputStream(), StringUtil.getRandomImgName(file.getOriginalFilename())); - String goods_img = request.getParameter("goods_img"); - String goods_discribe = request.getParameter("goods_discribe"); - float goods_price = Float.parseFloat(request.getParameter("goods_price")); - int goods_category = Integer.parseInt(request.getParameter("goods_category")); + String goods_img = goods.getGoods_img(); + String goods_discribe = goods.getGoods_discribe(); + float goods_price = goods.getGoods_price(); + int goods_category = goods.getGoods_category(); JSONObject jsonObject = new JSONObject(); if (goods_name.length() >= 2 && goods_name.length() <= 20 && goods_stock >= 0 && @@ -57,8 +57,8 @@ public class GoodsController { goods_price >= 0 && goods_category >= 0 ){ - Goods goods = new Goods(goods_name,seller_username,goods_stock,goods_img,goods_discribe,goods_category,goods_price); - int result = goodsService.addGoods( goods); + Goods newGoods = new Goods(goods_name,seller_username,goods_stock,goods_img,goods_discribe,goods_category,goods_price); + int result = goodsService.addGoods( newGoods); if (result >= 1) { message = "success"; }else { @@ -70,10 +70,9 @@ public class GoodsController { } //买家在goods表中查询goods详细信息 - @RequestMapping(value = "/searchGoods") - public Object searchGoods(HttpServletRequest request, HttpServletResponse response){ + @GetMapping(value = "/searchGoods") + public Object searchGoods(@RequestParam int item_id){ String message = "error"; - int item_id = Integer.parseInt(request.getParameter("item_id")); JSONObject jsonObject = new JSONObject(); Goods good = goodsService.searchGoods(item_id); if (good != null){ @@ -92,6 +91,7 @@ public class GoodsController { String message = "error"; JSONObject jsonObject = new JSONObject(); int result = goodsService.updateGoodsState(json.get("seller_username"),Integer.parseInt(json.get("item_id")), Integer.parseInt(json.get("new_state"))); + if (result >= 1) { message = "success"; }else { @@ -128,10 +128,9 @@ public class GoodsController { } //在goods表中查询历史商品 - @RequestMapping(value = "/searchHistoryGoods") - public Object searchHistoryGoods(HttpServletRequest request, HttpServletResponse response){ + @GetMapping(value = "/searchHistoryGoods") + public Object searchHistoryGoods(@RequestParam String seller_username){ String message = "error"; - String seller_username = request.getParameter("seller_username"); JSONObject jsonObject = new JSONObject(); List goodsList = goodsService.searchHistoryGoods(seller_username); // List list = new ArrayList(); @@ -163,18 +162,29 @@ public class GoodsController { public boolean isHaveSellingGoods(String username){return goodsService.isHaveSellingGoods(username);} //修改商品信息 - @RequestMapping(value = "/updateGoods") - public Object updateGoods(HttpServletRequest request, HttpServletResponse response){ + @PostMapping(value = "/updateGoods") + public Object updateGoods(@RequestBody Goods goods){ String message = "error"; - int item_id = Integer.parseInt(request.getParameter("item_id")); - String goods_name = request.getParameter("goods_name"); +// int item_id = Integer.parseInt(request.getParameter("item_id")); +// String goods_name = request.getParameter("goods_name"); +// String seller_username = "admin"; +// int goods_stock = Integer.parseInt(request.getParameter("goods_stock")); +// String goods_img = uploadImageService.uploadQNImg((FileInputStream) file.getInputStream(), StringUtil.getRandomImgName(file.getOriginalFilename())); +// String goods_img = request.getParameter("goods_img"); +// String goods_discribe = request.getParameter("goods_discribe"); +// int goods_category = Integer.parseInt(request.getParameter("goods_category")); +// float goods_price = Float.parseFloat(request.getParameter("goods_price")); +// // + int item_id = goods.getItem_id(); + String goods_name = goods.getGoods_name(); String seller_username = "admin"; - int goods_stock = Integer.parseInt(request.getParameter("goods_stock")); + int goods_stock =goods.getGoods_stock(); // String goods_img = uploadImageService.uploadQNImg((FileInputStream) file.getInputStream(), StringUtil.getRandomImgName(file.getOriginalFilename())); - String goods_img = request.getParameter("goods_img"); - String goods_discribe = request.getParameter("goods_discribe"); - int goods_category = Integer.parseInt(request.getParameter("goods_category")); - float goods_price = Float.parseFloat(request.getParameter("goods_price")); + String goods_img = goods.getGoods_img(); + String goods_discribe = goods.getGoods_discribe(); + float goods_price = goods.getGoods_price(); + int goods_category = goods.getGoods_category(); + // JSONObject jsonObject = new JSONObject(); if (goods_name.length() >= 2 && goods_name.length() <= 20 && goods_stock >= 0 && @@ -237,11 +247,10 @@ public class GoodsController { return jsonObject; } - //通过关键词查询商品 - @RequestMapping(value = "/searchGoodsByKeyName") - public Object searchGoodsByKeyName(HttpServletRequest request, HttpServletResponse response){ + //通过关键词查询上架商品 + @GetMapping(value = "/searchGoodsByKeyName") + public Object searchGoodsByKeyName(@RequestParam String key_name){ String message = "error"; - String key_name = request.getParameter("key_name"); JSONObject jsonObject = new JSONObject(); List goodsList =goodsService.searchGoodsByKeyName(key_name); message = "success"; diff --git a/back-end_code/src/main/java/com/shop/controller/OrderController.java b/back-end_code/src/main/java/com/shop/controller/OrderController.java index 934b14907ce7c691efa179e2335ba281ef9a8d8e..6c0d5bb439153d7df6a8cb14674b407947755010 100644 --- a/back-end_code/src/main/java/com/shop/controller/OrderController.java +++ b/back-end_code/src/main/java/com/shop/controller/OrderController.java @@ -10,10 +10,7 @@ import com.shop.service.OrderService; import com.shop.service.UserService; import net.minidev.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -22,6 +19,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.Map; @RestController @RequestMapping("/order") @@ -158,21 +156,21 @@ public class OrderController { } //意向购买者下单 - @RequestMapping(value = "/addToOrderWanted") - public Object addToOrderWanted(HttpServletRequest request, HttpServletResponse response){ + @PostMapping(value = "/addToOrderWanted") + public Object addToOrderWanted(@RequestBody Map request){ String message = "error"; - int item_id = Integer.parseInt(request.getParameter("item_id")); + int item_id = Integer.parseInt(request.get("item_id")); Goods good = goodsService.searchGoods(item_id); String goods_name = good.getGoods_name(); String goods_img = good.getGoods_img(); String goods_discribe = good.getGoods_discribe(); float goods_price = good.getGoods_price(); String seller_username = good.getSeller_username(); - String buyer_username = request.getParameter("buyer_username"); + String buyer_username = request.get("buyer_username"); User user = userService.getUserInfo(buyer_username); - String buyer_realname = request.getParameter("buyer_realname"); - String buyer_phonenumber = request.getParameter("buyer_phonenumber"); - String buyer_address = request.getParameter("buyer_address"); + String buyer_realname = request.get("buyer_realname"); + String buyer_phonenumber = request.get("buyer_phonenumber"); + String buyer_address = request.get("buyer_address"); if (buyer_realname == null){ buyer_realname = user.getRealname(); } @@ -182,12 +180,9 @@ public class OrderController { if (buyer_address == null){ buyer_address = user.getAddress(); } - int buy_sum = Integer.parseInt(request.getParameter("buy_sum")); + int buy_sum = Integer.parseInt(request.get("buy_sum")); float buy_amount; - if (buy_sum*good.getGoods_price() == Float.parseFloat(request.getParameter("buy_amount"))){ - buy_amount = Float.parseFloat(request.getParameter("buy_amount")); - }else - buy_amount = buy_sum*good.getGoods_price(); + buy_amount = buy_sum*good.getGoods_price(); String create_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); JSONObject jsonObject = new JSONObject(); Order order = new Order(item_id,goods_name,goods_img,goods_discribe,goods_price,seller_username,buyer_username,buyer_realname,buyer_phonenumber,buyer_address,buy_sum,buy_amount,5,create_time); @@ -214,4 +209,15 @@ public class OrderController { jsonObject.put("message",message); return jsonObject; } + //根据卖家用户名查找所有订单 + @GetMapping("/searchOrdersBySellerName") + public Object searchOrdersBySellerName(@RequestParam String seller_username){ + String message = "error"; + JSONObject jsonObject = new JSONObject(); + List orderList = orderService.searchOrdersBySellerName(seller_username); + message = "success"; + jsonObject.put("orders",orderList); + jsonObject.put("message",message); + return jsonObject; + } } diff --git a/back-end_code/src/main/java/com/shop/entity/Order.java b/back-end_code/src/main/java/com/shop/entity/Order.java index 6b7e05a42e383ea943c273f84ebb222d3939cd20..4246ea61e8abb1878cd2238a30666d58fac859c3 100644 --- a/back-end_code/src/main/java/com/shop/entity/Order.java +++ b/back-end_code/src/main/java/com/shop/entity/Order.java @@ -13,7 +13,7 @@ public class Order { private String buyer_phonenumber; private String buyer_address; private int buy_sum; - private float buy_amount; + private float buy_amount;//总价 private int state;//int,1表示进行中,2表示交易成功,3表示买家退款,4表示卖家关闭交易,5表示申请中 private String create_time; private String finish_time; diff --git a/back-end_code/src/main/java/com/shop/mapper/CategoryMapper.java b/back-end_code/src/main/java/com/shop/mapper/CategoryMapper.java index 8e9b7d2b09ff134b55ab57f2bbecb8c8c97b2235..907c7987fbb073243373bdcf138e8c376b17e064 100644 --- a/back-end_code/src/main/java/com/shop/mapper/CategoryMapper.java +++ b/back-end_code/src/main/java/com/shop/mapper/CategoryMapper.java @@ -21,6 +21,11 @@ public interface CategoryMapper { */ List searchParentCategory(); + /** + * 查询所有类别 + * @return + */ + List searchAllCategory(); /** * 根据parentCategory_id查询子类别 * @param parentCategory_id @@ -34,7 +39,12 @@ public interface CategoryMapper { * @return */ int deleteCategoryByItemId(int category_id); - + /** + * 根据categoryName查找category + * @param category_name + * @return + */ + Category searchCategoryByName(String category_name); /** * 根据categoryId修改Category * @param Category diff --git a/back-end_code/src/main/java/com/shop/mapper/GoodsMapper.java b/back-end_code/src/main/java/com/shop/mapper/GoodsMapper.java index e9b44ed57d5e65f1b804a957e9c18baf3e37a560..f6601725a2630668102c31a566c2399ee33c6be4 100644 --- a/back-end_code/src/main/java/com/shop/mapper/GoodsMapper.java +++ b/back-end_code/src/main/java/com/shop/mapper/GoodsMapper.java @@ -69,6 +69,7 @@ public interface GoodsMapper { */ List searchFreezingGoods(String seller_username); + /** * 通过类别查询商品 * @param goods_category diff --git a/back-end_code/src/main/java/com/shop/mapper/OrderMapper.java b/back-end_code/src/main/java/com/shop/mapper/OrderMapper.java index 632ac47ec375a179422f0231153538b1b272cd14..614eb4235e09a7c800993d726890b3d1679a3f2b 100644 --- a/back-end_code/src/main/java/com/shop/mapper/OrderMapper.java +++ b/back-end_code/src/main/java/com/shop/mapper/OrderMapper.java @@ -64,11 +64,15 @@ public interface OrderMapper { /** * 查询完成订单 * @param seller_username - * @param page * @return */ - List searchFinishOrder(String seller_username,int page); - + List searchFinishOrder(String seller_username); + /** + * 按卖家查询所有订单 + * @param seller_username + * @return + */ + List searchOrdersBySellerUserName(String seller_username); /** * 在Order表中查找已完成交易商品的历史意向买家 * @param seller_username diff --git a/back-end_code/src/main/java/com/shop/service/CategoryService.java b/back-end_code/src/main/java/com/shop/service/CategoryService.java index 034d8d1e7f345213e748d97cb735225027e99610..69af2ab65039d4731385e297535fa9942ff9f19f 100644 --- a/back-end_code/src/main/java/com/shop/service/CategoryService.java +++ b/back-end_code/src/main/java/com/shop/service/CategoryService.java @@ -17,4 +17,6 @@ public class CategoryService { public List searchChildCategory(int parentCategory_id){return categoryMapper.searchChildCategory(parentCategory_id);} public int deleteCategoryByItemId(int category_id){return categoryMapper.deleteCategoryByItemId(category_id);} public int updateCategory(Category category){return categoryMapper.updateCategory(category);} + public Category searchCategoryByName(String category_name){return categoryMapper.searchCategoryByName(category_name);} + public List searchAllCategory(){return categoryMapper.searchAllCategory();} } diff --git a/back-end_code/src/main/java/com/shop/service/OrderService.java b/back-end_code/src/main/java/com/shop/service/OrderService.java index 240f5bcfe6ec532cbaea088556d9da8eddad638d..9749d29bcf30fa3174b18ba796b573f3adb5c77f 100644 --- a/back-end_code/src/main/java/com/shop/service/OrderService.java +++ b/back-end_code/src/main/java/com/shop/service/OrderService.java @@ -67,7 +67,7 @@ public class OrderService { } public int finishOrder(String seller_username,int item_id,String finish_time){ return orderMapper.finishOrder(seller_username,item_id,finish_time); } public Order searchOrderByOrderId(String seller_username,int order_id){return orderMapper.searchOrderByOrderId(seller_username,order_id);} - public List searchFinishOrder(String seller_username,int page){return orderMapper.searchFinishOrder(seller_username,page);} + public List searchFinishOrder(String seller_username){return orderMapper.searchFinishOrder(seller_username);} public List searchDealingOrder(String seller_username,int page){return orderMapper.searchDealingOrder(seller_username,page);} public int cancelOrder(String seller_username,int order_id){ int result = orderMapper.cancelOrder(seller_username,order_id); @@ -82,4 +82,5 @@ public class OrderService { } public int addToOrderWanted(Order order){return orderMapper.addToOrderWanted(order); } public List searchFinishOrderByBuyerName(String buyer_username){return orderMapper.searchFinishOrderByBuyerName(buyer_username);} + public List searchOrdersBySellerName(String seller_username){return orderMapper.searchOrdersBySellerUserName(seller_username);} } diff --git a/back-end_code/src/main/java/com/shop/utils/Result.java b/back-end_code/src/main/java/com/shop/utils/Result.java new file mode 100644 index 0000000000000000000000000000000000000000..fa52d53503ce56ab835ed48bbce7e79e17af1dc6 --- /dev/null +++ b/back-end_code/src/main/java/com/shop/utils/Result.java @@ -0,0 +1,68 @@ +package com.shop.utils; + +import net.minidev.json.JSONObject; + +public class Result extends JSONObject { + + public static final String SUCCESS = "success"; + public static final String FAILURE = "error"; + + private boolean result; + private String message; + private Object data; + + private Result() {} + + public static Result ok() { + return Result.ok(SUCCESS); + } + + public static Result ok(String message) { + Result result = new Result(); + result.put("message:",message); + return result; + } + + + public static Result ok(String dataName, Object data) { + Result result = new Result(); + result.put("message:",SUCCESS); + result.put(dataName,data); + return result; + } + + public static Result fail() { + return Result.fail(FAILURE); + } + + public static Result fail(String message) { + return Result.fail("message", message); + } + + + public static Result fail(String dataName, Object data) { + Result result = new Result(); + result.put("message:",FAILURE); + result.put(dataName,data); + return result; + } + + public boolean isResult() { + return result; + } + public void setResult(boolean result) { + this.result = result; + } + public String getMsg() { + return message; + } + public void setMsg(String message) { + this.message = message; + } + public Object getData() { + return data; + } + public void setData(Object data) { + this.data = data; + } +} diff --git a/back-end_code/src/main/java/com/shop/utils/StringUtil.java b/back-end_code/src/main/java/com/shop/utils/StringUtil.java index 8f4dcc1420126d15ebac3f14fabdd95c07435150..c24785853dd5456059771f6de7fa11e26ddef65e 100644 --- a/back-end_code/src/main/java/com/shop/utils/StringUtil.java +++ b/back-end_code/src/main/java/com/shop/utils/StringUtil.java @@ -31,4 +31,20 @@ public class StringUtil { String path = "image/" + DateUtil.today() + "-" + uuid + suffix; return path; } + + public static String getRandomName(String fileName) { + + int index = fileName.lastIndexOf("."); + + if ((fileName == null || fileName.isEmpty()) || index == -1){ + throw new IllegalArgumentException(); + } + // 获取文件后缀 + String suffix = fileName.substring(index); + // 生成UUID + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + // 生成文件名 + String path = DateUtil.today() + "-" + uuid + suffix; + return path; + } } diff --git a/back-end_code/src/main/resources/application-dev.yml b/back-end_code/src/main/resources/application-dev.yml index 8fa5d15f71b0a42f3b32c3fc095f97181488eda7..55c39bad9eccff854cbcb2f3c281ceb6ae264c4a 100644 --- a/back-end_code/src/main/resources/application-dev.yml +++ b/back-end_code/src/main/resources/application-dev.yml @@ -24,4 +24,8 @@ oss: domain: http://cdn.souldays.top # 访问域名(默认使用七牛云测试域名) accessKey: KJb6ZIW_mplRncSOOFRDf5efUF_EY6LMwdD09uMb # 公钥 secretKey: _3ZryKtRPL3X66byb5evv7OC4X6ddgpdwpQRLJfI # 私钥 - bucketName: shop-software #存储空间名称 \ No newline at end of file + bucketName: shop-software #存储空间名称 + +#文件上传路径 +filepath: + bin: "E:/file/bin/" \ No newline at end of file diff --git a/back-end_code/src/main/resources/application-pro.yml b/back-end_code/src/main/resources/application-pro.yml new file mode 100644 index 0000000000000000000000000000000000000000..55c39bad9eccff854cbcb2f3c281ceb6ae264c4a --- /dev/null +++ b/back-end_code/src/main/resources/application-pro.yml @@ -0,0 +1,31 @@ +server: + port: 8083 + +spring: + datasource: + username: xiangwan + password: dingwanren + #url中database为对应的数据库名称 + url: jdbc:mysql://47.103.214.177:3306/service2.0?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC + driver-class-name: com.mysql.cj.jdbc.Driver + +mybatis: + mapper-locations: classpath:mapping/*.xml + type-aliases-package: com.shop.entity + +#showSql +logging: + level: + com.example.demo.mapper: debug + +# 七牛云存储 +oss: + qiniu: + domain: http://cdn.souldays.top # 访问域名(默认使用七牛云测试域名) + accessKey: KJb6ZIW_mplRncSOOFRDf5efUF_EY6LMwdD09uMb # 公钥 + secretKey: _3ZryKtRPL3X66byb5evv7OC4X6ddgpdwpQRLJfI # 私钥 + bucketName: shop-software #存储空间名称 + +#文件上传路径 +filepath: + bin: "E:/file/bin/" \ No newline at end of file diff --git a/back-end_code/src/main/resources/mapping/CategoryMapper.xml b/back-end_code/src/main/resources/mapping/CategoryMapper.xml index 9d0e15f3ab7942c88242681d18de202d9a50468f..5f1a15337dff4ffef198d70bd150e563eee18e8e 100644 --- a/back-end_code/src/main/resources/mapping/CategoryMapper.xml +++ b/back-end_code/src/main/resources/mapping/CategoryMapper.xml @@ -40,6 +40,12 @@ + + diff --git a/back-end_code/src/main/resources/mapping/GoodsMapper.xml b/back-end_code/src/main/resources/mapping/GoodsMapper.xml index 1e45344edf67faa33bdf28fcee2d2fbd68c4dcbe..593271809ecb044de4ad8126e9219ddb16e4cb6c 100644 --- a/back-end_code/src/main/resources/mapping/GoodsMapper.xml +++ b/back-end_code/src/main/resources/mapping/GoodsMapper.xml @@ -154,6 +154,7 @@ select * from goods where goodsName like '%${key_name}%' and goodsCategory = #{goods_category} and goodsState = 1 + update goods diff --git a/back-end_code/src/main/resources/mapping/OrderMapper.xml b/back-end_code/src/main/resources/mapping/OrderMapper.xml index e82961a2bc17c92e94e914eaf7c93c43753c590e..917127669407cf8f676ffdb2f2619376ef4fbee4 100644 --- a/back-end_code/src/main/resources/mapping/OrderMapper.xml +++ b/back-end_code/src/main/resources/mapping/OrderMapper.xml @@ -30,7 +30,7 @@ select * from orders where itemId = #{item_id,jdbcType=INTEGER} and state = 2 and sellerUsername = #{seller_username} - + @@ -70,7 +70,7 @@ select * from orders where sellerUsername = #{seller_username} and state = 2 - + @@ -174,5 +174,8 @@ + \ No newline at end of file