mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-09-13 23:41:39 +08:00
Compare commits
9 Commits
Chapter1-3
...
Chapter4
Author | SHA1 | Date | |
---|---|---|---|
544cd6b69e | |||
d3a21edbdc | |||
8feb8c078c | |||
ab0b78f278 | |||
14f999e598 | |||
65a5688804 | |||
add4aa6996 | |||
8bd1474f0d | |||
ff76e441e4 |
@@ -11,12 +11,77 @@
|
||||
Target Server Version : 50726
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 02/03/2022 11:35:11
|
||||
Date: 03/03/2022 18:37:04
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for item_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `item_info`;
|
||||
CREATE TABLE `item_info` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`price` decimal(10, 2) NOT NULL DEFAULT 0.00,
|
||||
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`sales` int(11) NOT NULL DEFAULT 0,
|
||||
`img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of item_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `item_info` VALUES (1, 'item-h7p0wt-22680', 22.00, '0sddhs4aeowc26638j5fp2ox', 0, 'https://domain.com/pic/190ghi.jpg');
|
||||
INSERT INTO `item_info` VALUES (2, '电视机', 1800.00, '一台电视机', 0, 'https://domain.com/pic/television.png');
|
||||
INSERT INTO `item_info` VALUES (3, '电冰箱', 2800.00, '一台电冰箱', 0, 'https://domain.com/pic/电冰箱.png');
|
||||
INSERT INTO `item_info` VALUES (4, '空调', 3600.00, '一台空调', 0, 'https://domain.com/pic/空调.png');
|
||||
INSERT INTO `item_info` VALUES (5, 'item-2xmm6g-5492', 235.00, 'lsudsf67ghobos3q1olbwx27', 0, 'https://domain.com/pic/1fvojf.jpg');
|
||||
INSERT INTO `item_info` VALUES (6, 'item-wlx9gu-1220', 270.00, '3q234qqp3wwo53mtdv0qjuvg', 0, 'https://domain.com/pic/tkxc5q.jpg');
|
||||
INSERT INTO `item_info` VALUES (7, 'item-cqru11-3487', 259.00, '04q6lopvj3ubb4458k4wldok', 0, 'https://domain.com/pic/nxmx2h.jpg');
|
||||
INSERT INTO `item_info` VALUES (8, 'item-7f7qa1-5168', 314.00, 'jqkgc5ks2r9e2k8za3zs9rlc', 0, 'https://domain.com/pic/gvwtzd.jpg');
|
||||
INSERT INTO `item_info` VALUES (9, 'item-i8flrb-7649', 129.00, 'i0m9w2x5w4gugeq7hlyp8nqx', 0, 'https://domain.com/pic/rz85vu.jpg');
|
||||
INSERT INTO `item_info` VALUES (10, 'item-epo4p3-8545', 40.00, 'x71zeodg46ziiid7pgfag4bc', 0, 'https://domain.com/pic/o0f3uk.jpg');
|
||||
INSERT INTO `item_info` VALUES (11, 'item-o7iiuj-1056', 322.00, 'fm3r99ko038jbfhy5cg7kwp8', 0, 'https://domain.com/pic/u0rjr8.jpg');
|
||||
INSERT INTO `item_info` VALUES (12, 'item-fi7q7p-11366', 24.00, '18e54me0cdbqt8n9mxjnisf8', 0, 'https://domain.com/pic/eetb26.jpg');
|
||||
INSERT INTO `item_info` VALUES (13, 'item-9lwcps-12165', 9.00, 'hlxnhcfak89wengpsnehgtqs', 0, 'https://domain.com/pic/r9yxmi.jpg');
|
||||
INSERT INTO `item_info` VALUES (14, 'item-pgdbqk-12664', 151.00, 'irydvab5wixg59c7scgt50yh', 0, 'https://domain.com/pic/xvfgwv.jpg');
|
||||
INSERT INTO `item_info` VALUES (15, 'item-0lq98b-13424', 164.00, 'vwz4rsb4qhsnjs3phos35415', 0, 'https://domain.com/pic/9qhi3l.jpg');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for item_stock
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `item_stock`;
|
||||
CREATE TABLE `item_stock` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`stock` int(11) NOT NULL,
|
||||
`item_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `item_id`(`item_id`) USING BTREE,
|
||||
CONSTRAINT `item_stock_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `item_info` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of item_stock
|
||||
-- ----------------------------
|
||||
INSERT INTO `item_stock` VALUES (1, 140, 1);
|
||||
INSERT INTO `item_stock` VALUES (2, 876, 2);
|
||||
INSERT INTO `item_stock` VALUES (3, 876, 3);
|
||||
INSERT INTO `item_stock` VALUES (4, 87, 4);
|
||||
INSERT INTO `item_stock` VALUES (5, 909, 5);
|
||||
INSERT INTO `item_stock` VALUES (6, 960, 6);
|
||||
INSERT INTO `item_stock` VALUES (7, 511, 7);
|
||||
INSERT INTO `item_stock` VALUES (8, 444, 8);
|
||||
INSERT INTO `item_stock` VALUES (9, 116, 9);
|
||||
INSERT INTO `item_stock` VALUES (10, 93, 10);
|
||||
INSERT INTO `item_stock` VALUES (11, 943, 11);
|
||||
INSERT INTO `item_stock` VALUES (12, 917, 12);
|
||||
INSERT INTO `item_stock` VALUES (13, 351, 13);
|
||||
INSERT INTO `item_stock` VALUES (14, 117, 14);
|
||||
INSERT INTO `item_stock` VALUES (15, 34, 15);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for user_info
|
||||
-- ----------------------------
|
||||
|
118
frontend/createitem.html
Normal file
118
frontend/createitem.html
Normal file
@@ -0,0 +1,118 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link href="static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/admin/pages/css/login.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="./static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body class="login">
|
||||
<div class="content">
|
||||
<h3 class="form-title">创建商品</h3>
|
||||
<div class="from-group">
|
||||
<label class="control-label">商品名</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="商品名" name="title" id="title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">商品描述</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="商品描述" name="description" id="description">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">价格</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="价格" name="price" id="price">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">图片</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="图片" name="imgUrl" id="imgUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">库存</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="库存" name="stock" id="stock">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn blue" id="create" type="submit">
|
||||
创建商品
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
$("#create").on("click", function () {
|
||||
var title = $("#title").val();
|
||||
var description = $("#description").val();
|
||||
var price = $("#price").val();
|
||||
var imgUrl = $("#imgUrl").val();
|
||||
var stock = $("#stock").val();
|
||||
|
||||
if (title == null || title == "") {
|
||||
alert("商品名不能为空");
|
||||
return false;
|
||||
}
|
||||
if (description == null || description == "") {
|
||||
alert("商品描述不能为空");
|
||||
return false;
|
||||
}
|
||||
if (price == null || price == "") {
|
||||
alert("价格不能为空");
|
||||
return false;
|
||||
}
|
||||
if (imgUrl == null || imgUrl == "") {
|
||||
alert("图片Url不能为空");
|
||||
return false;
|
||||
}
|
||||
if (stock == null || stock == "") {
|
||||
alert("库存不能为空");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
url: "http://localhost:8090/item/create",
|
||||
data: {
|
||||
"title": title,
|
||||
"description": description,
|
||||
"imgUrl": imgUrl,
|
||||
"price": price,
|
||||
"stock": stock,
|
||||
},
|
||||
xhrFields: {withCredentials: true},
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
alert("创建成功");
|
||||
} else {
|
||||
alert("创建失败,原因为" + data.data.errMsg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
alert("创建失败,原因为" + data.responseText);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function filldata() {
|
||||
const date = new Date();
|
||||
$("#title").val("item-" + Math.random().toString(36).slice(-6) + "-" + date.getSeconds() + date.getMilliseconds());
|
||||
$("#description").val(Math.random().toString(36).slice(-6) + Math.random().toString(36).slice(-6) + Math.random().toString(36).slice(-6) + Math.random().toString(36).slice(-6));
|
||||
$("#imgUrl").val("https://domain.com/pic/" + Math.random().toString(36).slice(-6) + ".jpg");
|
||||
$("#price").val(Math.round(Math.random() * (500 - 1) + 1));
|
||||
$("#stock").val(Math.round(Math.random() * (1000 - 1) + 1));
|
||||
}
|
||||
|
||||
filldata();
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
97
frontend/getitem.html
Normal file
97
frontend/getitem.html
Normal file
@@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link href="static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/admin/pages/css/login.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="./static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body class="login">
|
||||
<div class="content">
|
||||
<h3 class="form-title">商品详情</h3>
|
||||
<div class="from-group">
|
||||
<div>
|
||||
<label class="control-label" id="title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">商品描述</label>
|
||||
<div>
|
||||
<label class="control-label" id="description">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">价格</label>
|
||||
<div>
|
||||
<label class="control-label" id="price">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<img id="imgUrl" src="" style="width: 200px; height: auto;"/>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">库存</label>
|
||||
<div>
|
||||
<label class="control-label" id="stock">
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group">
|
||||
<label class="control-label">销量</label>
|
||||
<div>
|
||||
<label class="control-label" id="sales">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="listitem.html">返回</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//获取url中的参数
|
||||
function getUrlParam(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
|
||||
var r = window.location.search.substring(1).match(reg); //匹配目标参数
|
||||
if (r != null) return decodeURIComponent(r[2]);
|
||||
return null; //返回参数值
|
||||
}
|
||||
|
||||
var itemId = getUrlParam("id");
|
||||
|
||||
var g_itemVO = [];
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
// 获取商品详情
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "http://localhost:8090/item/get",
|
||||
data: {
|
||||
"id": itemId,
|
||||
},
|
||||
xhrFields: {withCredentials: true},
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
g_itemVO = data.data;
|
||||
reloadDom();
|
||||
} else {
|
||||
alert("获取信息失败,原因为" + data.data.errMsg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
alert("获取信息失败,原因为" + data.responseText);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function reloadDom() {
|
||||
$("#title").text(g_itemVO.title);
|
||||
$("#description").text(g_itemVO.description);
|
||||
$("#stock").text(g_itemVO.stock);
|
||||
$("#price").text(g_itemVO.price);
|
||||
$("#imgUrl").attr("src", g_itemVO.imgUrl);
|
||||
$("#sales").text(g_itemVO.sales);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
84
frontend/listitem.html
Normal file
84
frontend/listitem.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link href="static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="static/assets/admin/pages/css/login.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="./static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h3 class="form-title">商品列表浏览</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品名</th>
|
||||
<th>商品图片</th>
|
||||
<th>商品描述</th>
|
||||
<th>商品价格</th>
|
||||
<th>商品库存</th>
|
||||
<th>商品销量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="container">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 定义全局商品信息
|
||||
var g_itemList = [];
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "http://localhost:8090/item/list",
|
||||
xhrFields: {withCredentials: true},
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
g_itemList = data.data;
|
||||
reloadDom();
|
||||
} else {
|
||||
alert("获取商品信息失败,原因为" + data.data.errMsg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
alert("获取商品信息失败,原因为" + data.responseText);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function reloadDom() {
|
||||
for (var i = 0; i < g_itemList.length; i++) {
|
||||
var itemVO = g_itemList[i];
|
||||
var dom = "<tr id='itemDetail" + itemVO.id + "' data-id='" + itemVO.id + "' style='cursor: pointer;'>" +
|
||||
"<td>" + itemVO.title + "</td>" +
|
||||
"<td><img style='width: 100px; height: auto;' src='" + itemVO.imgUrl + "'/></td>" +
|
||||
"<td>" + itemVO.description + "</td>" +
|
||||
"<td>" + itemVO.price + "</td>" +
|
||||
"<td>" + itemVO.stock + "</td>" +
|
||||
"<td>" + itemVO.sales + "</td>" +
|
||||
"</tr>";
|
||||
$("#container").append($(dom));
|
||||
|
||||
$("#itemDetail" + itemVO.id).on("click", function (e) {
|
||||
window.location.href = "getitem.html?id=" + $(this).data("id");
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
4
pom.xml
4
pom.xml
@@ -149,8 +149,8 @@
|
||||
<configuration>
|
||||
<!--允许移动生成的文件-->
|
||||
<verbose>true</verbose>
|
||||
<!--允许自动覆盖文件(真正企业开发不要设置成true)-->
|
||||
<overwrite>true</overwrite>
|
||||
<!--不允许自动覆盖文件(真正企业开发不要设置成true)-->
|
||||
<overwrite>false</overwrite>
|
||||
<!--mybatis配置文件路径-->
|
||||
<configurationFile>
|
||||
src/main/resources/mybatis-generator.xml
|
||||
|
@@ -0,0 +1,81 @@
|
||||
package com.cxyxiaomo.flashsale.controller;
|
||||
|
||||
import com.cxyxiaomo.flashsale.controller.viewobject.ItemVO;
|
||||
import com.cxyxiaomo.flashsale.error.BusinessException;
|
||||
import com.cxyxiaomo.flashsale.response.CommonReturnType;
|
||||
import com.cxyxiaomo.flashsale.service.ItemService;
|
||||
import com.cxyxiaomo.flashsale.service.model.ItemModel;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller("/item")
|
||||
@RequestMapping("/item")
|
||||
@CrossOrigin(allowedHeaders = "*", allowCredentials = "true")
|
||||
public class ItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
|
||||
// 创建商品的Controller
|
||||
@RequestMapping(value = "/create", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType createItem(@RequestParam(name = "title") String title,
|
||||
@RequestParam(name = "description") String description,
|
||||
@RequestParam(name = "price") BigDecimal price,
|
||||
@RequestParam(name = "stock") Integer stock,
|
||||
@RequestParam(name = "imgUrl") String imgUrl) throws BusinessException {
|
||||
// 封装Service请求用来创建商品
|
||||
ItemModel itemModel = new ItemModel();
|
||||
itemModel.setTitle(title);
|
||||
itemModel.setDescription(description);
|
||||
itemModel.setPrice(price);
|
||||
itemModel.setStock(stock);
|
||||
itemModel.setImgUrl(imgUrl);
|
||||
|
||||
ItemModel itemModelForReturn = itemService.createItem(itemModel);
|
||||
ItemVO itemVO = convertVOFromModel(itemModelForReturn);
|
||||
|
||||
return CommonReturnType.create(itemVO);
|
||||
}
|
||||
|
||||
// 商品详情页浏览
|
||||
@RequestMapping(value = "/get", method = {RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public CommonReturnType getItem(@RequestParam(name = "id") Integer id) {
|
||||
ItemModel itemModel = itemService.getItemById(id);
|
||||
|
||||
ItemVO itemVO = convertVOFromModel(itemModel);
|
||||
|
||||
return CommonReturnType.create(itemVO);
|
||||
}
|
||||
|
||||
// 商品列表页面浏览
|
||||
@RequestMapping(value = "/list", method = {RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public CommonReturnType listItem() {
|
||||
List<ItemModel> itemModelList = itemService.listItem();
|
||||
|
||||
// 使用 Stream Api将list内的itemModel转化为ItemVO
|
||||
List<ItemVO> itemVOList = itemModelList.stream().map(itemModel -> {
|
||||
ItemVO itemVO = this.convertVOFromModel(itemModel);
|
||||
return itemVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return CommonReturnType.create(itemVOList);
|
||||
}
|
||||
|
||||
private ItemVO convertVOFromModel(ItemModel itemModel) {
|
||||
if (itemModel == null) {
|
||||
return null;
|
||||
}
|
||||
ItemVO itemVO = new ItemVO();
|
||||
BeanUtils.copyProperties(itemModel, itemVO);
|
||||
return itemVO;
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.cxyxiaomo.flashsale.controller.viewobject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ItemVO {
|
||||
// 商品价格
|
||||
private Integer id;
|
||||
|
||||
// 商品名称
|
||||
private String title;
|
||||
|
||||
// 商品价格
|
||||
private BigDecimal price;
|
||||
|
||||
// 商品的库存
|
||||
private Integer stock;
|
||||
|
||||
// 商品的描述
|
||||
private String description;
|
||||
|
||||
// 商品的销量
|
||||
private Integer sales;
|
||||
|
||||
// 商品描述图片的URL
|
||||
private String imgUrl;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Integer getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(Integer stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer getSales() {
|
||||
return sales;
|
||||
}
|
||||
|
||||
public void setSales(Integer sales) {
|
||||
this.sales = sales;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
}
|
57
src/main/java/com/cxyxiaomo/flashsale/dao/ItemDOMapper.java
Normal file
57
src/main/java/com/cxyxiaomo/flashsale/dao/ItemDOMapper.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.cxyxiaomo.flashsale.dao;
|
||||
|
||||
import com.cxyxiaomo.flashsale.dataobject.ItemDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ItemDOMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int insert(ItemDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int insertSelective(ItemDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
ItemDO selectByPrimaryKey(Integer id);
|
||||
|
||||
List<ItemDO> listItem();
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int updateByPrimaryKeySelective(ItemDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_info
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int updateByPrimaryKey(ItemDO record);
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.cxyxiaomo.flashsale.dao;
|
||||
|
||||
import com.cxyxiaomo.flashsale.dataobject.ItemStockDO;
|
||||
|
||||
public interface ItemStockDOMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int insert(ItemStockDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int insertSelective(ItemStockDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
ItemStockDO selectByPrimaryKey(Integer id);
|
||||
|
||||
ItemStockDO selectByItemId(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int updateByPrimaryKeySelective(ItemStockDO record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table item_stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
int updateByPrimaryKey(ItemStockDO record);
|
||||
}
|
203
src/main/java/com/cxyxiaomo/flashsale/dataobject/ItemDO.java
Normal file
203
src/main/java/com/cxyxiaomo/flashsale/dataobject/ItemDO.java
Normal file
@@ -0,0 +1,203 @@
|
||||
package com.cxyxiaomo.flashsale.dataobject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ItemDO {
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.title
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.price
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.description
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.sales
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private Integer sales;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_info.img_url
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.id
|
||||
*
|
||||
* @return the value of item_info.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.id
|
||||
*
|
||||
* @param id the value for item_info.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.title
|
||||
*
|
||||
* @return the value of item_info.title
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.title
|
||||
*
|
||||
* @param title the value for item_info.title
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setTitle(String title) {
|
||||
this.title = title == null ? null : title.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.price
|
||||
*
|
||||
* @return the value of item_info.price
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.price
|
||||
*
|
||||
* @param price the value for item_info.price
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.description
|
||||
*
|
||||
* @return the value of item_info.description
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.description
|
||||
*
|
||||
* @param description the value for item_info.description
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description == null ? null : description.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.sales
|
||||
*
|
||||
* @return the value of item_info.sales
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public Integer getSales() {
|
||||
return sales;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.sales
|
||||
*
|
||||
* @param sales the value for item_info.sales
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setSales(Integer sales) {
|
||||
this.sales = sales;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_info.img_url
|
||||
*
|
||||
* @return the value of item_info.img_url
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_info.img_url
|
||||
*
|
||||
* @param imgUrl the value for item_info.img_url
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl == null ? null : imgUrl.trim();
|
||||
}
|
||||
}
|
@@ -0,0 +1,102 @@
|
||||
package com.cxyxiaomo.flashsale.dataobject;
|
||||
|
||||
public class ItemStockDO {
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_stock.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_stock.stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column item_stock.item_id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
private Integer itemId;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_stock.id
|
||||
*
|
||||
* @return the value of item_stock.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_stock.id
|
||||
*
|
||||
* @param id the value for item_stock.id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_stock.stock
|
||||
*
|
||||
* @return the value of item_stock.stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public Integer getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_stock.stock
|
||||
*
|
||||
* @param stock the value for item_stock.stock
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setStock(Integer stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column item_stock.item_id
|
||||
*
|
||||
* @return the value of item_stock.item_id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public Integer getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column item_stock.item_id
|
||||
*
|
||||
* @param itemId the value for item_stock.item_id
|
||||
*
|
||||
* @mbg.generated Thu Mar 03 13:12:13 CST 2022
|
||||
*/
|
||||
public void setItemId(Integer itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.cxyxiaomo.flashsale.service;
|
||||
|
||||
import com.cxyxiaomo.flashsale.error.BusinessException;
|
||||
import com.cxyxiaomo.flashsale.service.model.ItemModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ItemService {
|
||||
// 创建商品
|
||||
ItemModel createItem(ItemModel itemModel) throws BusinessException;
|
||||
|
||||
// 商品列表浏览
|
||||
List<ItemModel> listItem();
|
||||
|
||||
// 商品详情浏览
|
||||
ItemModel getItemById(Integer id);
|
||||
}
|
@@ -0,0 +1,113 @@
|
||||
package com.cxyxiaomo.flashsale.service.impl;
|
||||
|
||||
import com.cxyxiaomo.flashsale.dao.ItemDOMapper;
|
||||
import com.cxyxiaomo.flashsale.dao.ItemStockDOMapper;
|
||||
import com.cxyxiaomo.flashsale.dataobject.ItemDO;
|
||||
import com.cxyxiaomo.flashsale.dataobject.ItemStockDO;
|
||||
import com.cxyxiaomo.flashsale.error.BusinessException;
|
||||
import com.cxyxiaomo.flashsale.error.EmBusinessError;
|
||||
import com.cxyxiaomo.flashsale.service.ItemService;
|
||||
import com.cxyxiaomo.flashsale.service.model.ItemModel;
|
||||
import com.cxyxiaomo.flashsale.validator.ValidationResult;
|
||||
import com.cxyxiaomo.flashsale.validator.ValidatorImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ItemServiceImpl implements ItemService {
|
||||
|
||||
@Autowired
|
||||
private ValidatorImpl validator;
|
||||
|
||||
@Autowired
|
||||
private ItemDOMapper itemDOMapper;
|
||||
|
||||
@Autowired
|
||||
private ItemStockDOMapper itemStockDOMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ItemModel createItem(ItemModel itemModel) throws BusinessException {
|
||||
// 校验入参
|
||||
ValidationResult result = validator.validate(itemModel);
|
||||
|
||||
if (result.isHasErrors()) {
|
||||
throw new BusinessException(EmBusinessError.PARAMETER_VALIDATION_ERROR, result.getErrMsg());
|
||||
}
|
||||
|
||||
// 转化 ItemModel -> Data Object
|
||||
ItemDO itemDO = this.convertItemDOFromItemModel(itemModel);
|
||||
|
||||
// 写入数据库
|
||||
itemDOMapper.insertSelective(itemDO);
|
||||
itemModel.setId(itemDO.getId());
|
||||
|
||||
ItemStockDO itemStockDO = this.convertItemStockDOFormItemStockModel(itemModel);
|
||||
|
||||
itemStockDOMapper.insertSelective(itemStockDO);
|
||||
|
||||
// 返回创建完成的对象
|
||||
return this.getItemById(itemModel.getId());
|
||||
}
|
||||
|
||||
private ItemDO convertItemDOFromItemModel(ItemModel itemModel) {
|
||||
if (itemModel == null) {
|
||||
return null;
|
||||
}
|
||||
ItemDO itemDO = new ItemDO();
|
||||
BeanUtils.copyProperties(itemModel, itemDO);
|
||||
|
||||
return itemDO;
|
||||
}
|
||||
|
||||
private ItemStockDO convertItemStockDOFormItemStockModel(ItemModel itemModel) {
|
||||
if (itemModel == null) {
|
||||
return null;
|
||||
}
|
||||
ItemStockDO itemStockDO = new ItemStockDO();
|
||||
itemStockDO.setItemId(itemModel.getId());
|
||||
itemStockDO.setStock(itemModel.getStock());
|
||||
|
||||
return itemStockDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemModel> listItem() {
|
||||
List<ItemDO> itemDOList = itemDOMapper.listItem();
|
||||
|
||||
List<ItemModel> itemModelList = itemDOList.stream().map(itemDO -> {
|
||||
ItemStockDO itemStockDO = itemStockDOMapper.selectByItemId(itemDO.getId());
|
||||
ItemModel itemModel = this.convertModelFromDataObject(itemDO, itemStockDO);
|
||||
return itemModel;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return itemModelList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemModel getItemById(Integer id) {
|
||||
ItemDO itemDO = itemDOMapper.selectByPrimaryKey(id);
|
||||
if (itemDO == null) {
|
||||
return null;
|
||||
}
|
||||
// 操作获得库存数量
|
||||
ItemStockDO itemStockDO = itemStockDOMapper.selectByItemId(itemDO.getId());
|
||||
|
||||
// 将Data Object -> Model
|
||||
ItemModel itemModel = convertModelFromDataObject(itemDO, itemStockDO);
|
||||
return itemModel;
|
||||
}
|
||||
|
||||
private ItemModel convertModelFromDataObject(ItemDO itemDO, ItemStockDO itemStockDO) {
|
||||
ItemModel itemModel = new ItemModel();
|
||||
BeanUtils.copyProperties(itemDO, itemModel);
|
||||
itemModel.setStock(itemStockDO.getStock());
|
||||
|
||||
return itemModel;
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package com.cxyxiaomo.flashsale.service.model;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ItemModel {
|
||||
// 商品价格
|
||||
private Integer id;
|
||||
|
||||
// 商品名称
|
||||
@NotBlank(message = "商品名称不能为空")
|
||||
private String title;
|
||||
|
||||
// 商品价格
|
||||
@NotNull(message = "商品价格不能为空")
|
||||
@Min(value = 0, message = "商品价格必须大于0")
|
||||
private BigDecimal price;
|
||||
|
||||
// 商品的库存
|
||||
@NotNull(message = "库存不能不填")
|
||||
private Integer stock;
|
||||
|
||||
// 商品的描述
|
||||
@NotBlank(message = "商品描述信息不能为空")
|
||||
private String description;
|
||||
|
||||
// 商品的销量
|
||||
private Integer sales;
|
||||
|
||||
// 商品描述图片的URL
|
||||
@NotBlank(message = "商品描述图片不能为空")
|
||||
private String imgUrl;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Integer getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(Integer stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer getSales() {
|
||||
return sales;
|
||||
}
|
||||
|
||||
public void setSales(Integer sales) {
|
||||
this.sales = sales;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
}
|
152
src/main/resources/mapping/ItemDOMapper.xml
Normal file
152
src/main/resources/mapping/ItemDOMapper.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?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.cxyxiaomo.flashsale.dao.ItemDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cxyxiaomo.flashsale.dataobject.ItemDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
<result column="price" jdbcType="DECIMAL" property="price" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="sales" jdbcType="INTEGER" property="sales" />
|
||||
<result column="img_url" jdbcType="VARCHAR" property="imgUrl" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
id, title, price, description, sales, img_url
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from item_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
delete from item_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO" useGeneratedKeys="true" keyProperty="id">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into item_info (id, title, price,
|
||||
description, sales, img_url
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
|
||||
#{description,jdbcType=VARCHAR}, #{sales,jdbcType=INTEGER}, #{imgUrl,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO" useGeneratedKeys="true" keyProperty="id">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into item_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="title != null">
|
||||
title,
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="sales != null">
|
||||
sales,
|
||||
</if>
|
||||
<if test="imgUrl != null">
|
||||
img_url,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="title != null">
|
||||
#{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
#{price,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sales != null">
|
||||
#{sales,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="imgUrl != null">
|
||||
#{imgUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update item_info
|
||||
<set>
|
||||
<if test="title != null">
|
||||
title = #{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price = #{price,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sales != null">
|
||||
sales = #{sales,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="imgUrl != null">
|
||||
img_url = #{imgUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update item_info
|
||||
set title = #{title,jdbcType=VARCHAR},
|
||||
price = #{price,jdbcType=DECIMAL},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
sales = #{sales,jdbcType=INTEGER},
|
||||
img_url = #{imgUrl,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="listItem" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from item_info
|
||||
order by sales DESC
|
||||
</select>
|
||||
</mapper>
|
117
src/main/resources/mapping/ItemStockDOMapper.xml
Normal file
117
src/main/resources/mapping/ItemStockDOMapper.xml
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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.cxyxiaomo.flashsale.dao.ItemStockDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cxyxiaomo.flashsale.dataobject.ItemStockDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="stock" jdbcType="INTEGER" property="stock" />
|
||||
<result column="item_id" jdbcType="INTEGER" property="itemId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
id, stock, item_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from item_stock
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
delete from item_stock
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemStockDO" useGeneratedKeys="true" keyProperty="id">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into item_stock (id, stock, item_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{stock,jdbcType=INTEGER}, #{itemId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemStockDO" useGeneratedKeys="true" keyProperty="id">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into item_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
stock,
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
item_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
#{stock,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
#{itemId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemStockDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update item_stock
|
||||
<set>
|
||||
<if test="stock != null">
|
||||
stock = #{stock,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
item_id = #{itemId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemStockDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update item_stock
|
||||
set stock = #{stock,jdbcType=INTEGER},
|
||||
item_id = #{itemId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByItemId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from item_stock
|
||||
where item_id = #{itemId,jdbcType=INTEGER}
|
||||
</select>
|
||||
</mapper>
|
@@ -5,7 +5,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
@@ -19,21 +19,15 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
id, name, gender, age, telephone, register_mode, third_party_id
|
||||
</sql>
|
||||
<select id="selectByTelephone" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_info
|
||||
where telephone = #{telephone,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
@@ -44,16 +38,16 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
delete from user_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.UserDO">
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.UserDO" keyProperty="id" useGeneratedKeys="true">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into user_info (id, name, gender,
|
||||
age, telephone, register_mode,
|
||||
@@ -66,7 +60,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -120,7 +114,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update user_info
|
||||
<set>
|
||||
@@ -149,7 +143,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update user_info
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
@@ -160,4 +154,10 @@
|
||||
third_party_id = #{thirdPartyId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByTelephone" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_info
|
||||
where telephone = #{telephone,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
@@ -5,7 +5,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="encrypt_password" jdbcType="VARCHAR" property="encryptPassword" />
|
||||
@@ -15,7 +15,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
id, encrypt_password, user_id
|
||||
</sql>
|
||||
@@ -23,44 +23,38 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_password
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_password
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
delete from user_password
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.UserPasswordDO">
|
||||
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.UserPasswordDO" keyProperty="id" useGeneratedKeys="true">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into user_password (id, encrypt_password, user_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{encryptPassword,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.UserPasswordDO">
|
||||
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.UserPasswordDO" keyProperty="id" useGeneratedKeys="true">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
insert into user_password
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -90,7 +84,7 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update user_password
|
||||
<set>
|
||||
@@ -107,11 +101,17 @@
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
This element was generated on Tue Mar 01 14:58:29 CST 2022.
|
||||
This element was generated on Thu Mar 03 13:12:13 CST 2022.
|
||||
-->
|
||||
update user_password
|
||||
set encrypt_password = #{encryptPassword,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_password
|
||||
where user_id = #{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
</mapper>
|
@@ -33,20 +33,26 @@
|
||||
<property name="enableSubPackages" value="true"/>
|
||||
</javaClientGenerator>
|
||||
|
||||
<!-- 生成对应表及其类名 -->
|
||||
<table tableName="user_info" domainObjectName="userDO" enableCountByExample="false"
|
||||
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
|
||||
selectByExampleQueryId="false">
|
||||
<!--去除复杂操作语句-->
|
||||
<!--enableCountByExample="false"-->
|
||||
<!--enableUpdateByExample="false" -->
|
||||
<!--enableDeleteByExample="false" -->
|
||||
<!--enableSelectByExample="false"-->
|
||||
<!--selectByExampleQueryId="false"-->
|
||||
</table>
|
||||
<table tableName="user_password" domainObjectName="userPasswordDO" enableCountByExample="false"
|
||||
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
|
||||
selectByExampleQueryId="false"></table>
|
||||
|
||||
<!-- 生成对应表及其类名 -->
|
||||
<!--<table tableName="user_info" domainObjectName="UserDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="user_password" domainObjectName="UserPasswordDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="item_info" domainObjectName="ItemDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
<!--<table tableName="item_stock" domainObjectName="ItemStockDO" enableCountByExample="false"-->
|
||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||
<!-- selectByExampleQueryId="false"></table>-->
|
||||
|
||||
</context>
|
||||
</generatorConfiguration>
|
Reference in New Issue
Block a user