积分商城
This commit is contained in:
parent
7e6e73eeca
commit
089dcbabbe
@ -43,6 +43,7 @@
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "3.25.3",
|
||||
"echarts": "4.9.0",
|
||||
"element-tiptap": "^1.27.1",
|
||||
"element-ui": "2.15.12",
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
|
28
fuintAdmin/src/api/integral/category.js
Normal file
28
fuintAdmin/src/api/integral/category.js
Normal file
@ -0,0 +1,28 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询油罐列表
|
||||
export function getGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory/queryByPage',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 新增有关信息
|
||||
export function insertGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改有关信息
|
||||
export function updateGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
28
fuintAdmin/src/api/integral/gift.js
Normal file
28
fuintAdmin/src/api/integral/gift.js
Normal file
@ -0,0 +1,28 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询油罐列表
|
||||
export function getGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory/queryByPage',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 新增有关信息
|
||||
export function insertGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改有关信息
|
||||
export function updateGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
8
fuintAdmin/src/api/integral/giftForm.js
Normal file
8
fuintAdmin/src/api/integral/giftForm.js
Normal file
@ -0,0 +1,8 @@
|
||||
Vue.component('button-counter', {
|
||||
data: function () {
|
||||
return {
|
||||
count: 0
|
||||
}
|
||||
},
|
||||
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
|
||||
})
|
460
fuintAdmin/src/views/integral/gift/index.vue
Normal file
460
fuintAdmin/src/views/integral/gift/index.vue
Normal file
@ -0,0 +1,460 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input
|
||||
v-model="queryParams.categoryName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.status" style="width: 217px" placeholder="全部" clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="giftAdd"
|
||||
>新增礼品</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="分类" align="center" prop="id" width="50px"/>
|
||||
<el-table-column label="礼品信息" align="center">
|
||||
<el-table-column label="名称" align="center" prop="sort20"/>
|
||||
<el-table-column label="封面图" align="center" prop="sort634"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换信息" align="center">
|
||||
<el-table-column label="兑换方式" align="center" prop="sort65"/>
|
||||
<el-table-column label="兑换方式" align="center" prop="sort67"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送类型" align="center">
|
||||
<el-table-column label="配送方式" align="center" prop="sort56"/>
|
||||
<el-table-column label="快递费用" align="center" prop="sort55"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="礼品类型" align="center" prop="sort44" />
|
||||
<el-table-column label="礼品库存信息" align="center">
|
||||
<el-table-column label="总库存" align="center" prop="sort23"/>
|
||||
<el-table-column label="已用" align="center" prop="sort12"/>
|
||||
<el-table-column label="可用" align="center" prop="categoryName2"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.status == '启用'" size="medium">启用</el-tag>
|
||||
<el-tag v-if ="scope.row.status == '禁用'" type="danger" size="medium">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="dataForm" :rules="rules" label-width="80px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="15">
|
||||
<el-form-item label="礼品名称" prop="categoryName">
|
||||
<el-input v-model="dataForm.categoryName" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="分类" prop="categoryName">
|
||||
<el-input v-model="dataForm.categoryName" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="11">
|
||||
<el-form-item label="封面图" >
|
||||
<el-upload
|
||||
:action="uploadAction"
|
||||
list-type="picture-card"
|
||||
:class="{hide:hideUpload}"
|
||||
:file-list="uploadFiles"
|
||||
:auto-upload="true"
|
||||
:show-file-list="false"
|
||||
:headers="uploadHeader"
|
||||
:on-success="handleUploadSuccess">
|
||||
<img
|
||||
v-if="this.form.logo"
|
||||
:src="imagePath + this.form.logo"
|
||||
class="list-img"
|
||||
/>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="11">
|
||||
<el-form-item label="礼品图片" >
|
||||
<el-upload
|
||||
:action="uploadAction"
|
||||
list-type="picture-card"
|
||||
:class="{hide:hideUpload}"
|
||||
:file-list="uploadFiles"
|
||||
:auto-upload="true"
|
||||
:show-file-list="false"
|
||||
:headers="uploadHeader"
|
||||
:on-success="handleUploadSuccess">
|
||||
<img
|
||||
v-if="this.form.logo"
|
||||
:src="imagePath + this.form.logo"
|
||||
class="list-img"
|
||||
/>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="礼品类型" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
@change="handleIsopenSelect"
|
||||
:value="dict.value"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="优惠卷" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="礼品数量" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="市场价格" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="礼品库存" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="兑换方式" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
@change="handleIsopenSelect"
|
||||
:value="dict.value"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="顿换积分" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="加钱比例" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="7.5">
|
||||
<el-form-item label="兑换次数" prop="supplierName">
|
||||
<el-input v-model="dataForm.sort" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="礼品排序" prop="contactPerson">
|
||||
<el-input-number v-model="dataForm.sort" :min="1" :max="10" label=""></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="礼品状态" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
@change="handleIsopenSelect"
|
||||
:value="dict.value"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row :gutter="24">
|
||||
<el-col :span="23">
|
||||
<el-form-item label="图文详情" prop="contactPerson">
|
||||
<element-tiptap v-model="content" :extensions="extensions" :editor="editor" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
name: "gift",
|
||||
dicts: ['zhzt'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
|
||||
dataForm:{
|
||||
id: null,
|
||||
categoryName: 1,
|
||||
sort: null,
|
||||
status: null
|
||||
},
|
||||
|
||||
// 上传地址
|
||||
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
|
||||
uploadHeader: { 'Access-Token' : getToken() },
|
||||
// 隐藏上传
|
||||
hideUpload: false,
|
||||
// 上传文件列表
|
||||
uploadFiles: [],
|
||||
// 图片根目录
|
||||
imagePath: "",
|
||||
|
||||
form:{logo:''},
|
||||
imageUrl: '',
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
// 是否显示弹出层
|
||||
open: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
categoryName: 1,
|
||||
status: '',
|
||||
page:null,
|
||||
pageSize:null
|
||||
},
|
||||
dateRange:{},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
rules: {},
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
imageUrl: '',
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
},
|
||||
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.dataForm.id == null) {
|
||||
// 判断是否是新增还是修改
|
||||
insertGiftCategoryApi(this.dataForm).then(res => {
|
||||
this.getList()
|
||||
this.open = false
|
||||
})
|
||||
} else {
|
||||
// 判断是否是新增还是修改
|
||||
updateGiftCategoryApi(this.dataForm).then(res => {
|
||||
this.getList()
|
||||
this.open = false
|
||||
})
|
||||
}
|
||||
}})
|
||||
},
|
||||
handleIsopenSelect() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 新增
|
||||
giftAdd() {
|
||||
this.dataForm = {}
|
||||
this.dataForm.status = '启用'
|
||||
this.open = true
|
||||
this.title = '添加分类'
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 修改按钮
|
||||
handleUpdate(data) {
|
||||
this.dataForm = data
|
||||
this.open = true
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
|
||||
},
|
||||
reset(){
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
// 查询分类
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getGoodsCateInfo(id).then(response => {
|
||||
this.form = response.data.cateInfo;
|
||||
this.uploadFiles = [{ url: response.data.imagePath + this.form.logo, status: 'finished'}]
|
||||
this.open = true;
|
||||
this.title = "编辑商品分类";
|
||||
});
|
||||
},
|
||||
|
||||
handleUploadSuccess(file) {
|
||||
this.form.logo = file.data.fileName;
|
||||
},
|
||||
|
||||
handleAvatarSuccess(res, file) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = file.type;
|
||||
const isLt2M = file.size / 1024 / 1024;
|
||||
|
||||
// if (!isJPG) {
|
||||
// this.$message.error('上传头像图片只能是 JPG 格式!');
|
||||
// }
|
||||
// if (!isLt2M) {
|
||||
// this.$message.error('上传头像图片大小不能超过 2MB!');
|
||||
// }
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.common-dialog >>> .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 50px;
|
||||
line-height: 60px;
|
||||
}
|
||||
</style>
|
245
fuintAdmin/src/views/integral/giftCategory/index.vue
Normal file
245
fuintAdmin/src/views/integral/giftCategory/index.vue
Normal file
@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input
|
||||
v-model="queryParams.categoryName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.status" style="width: 217px" placeholder="全部" clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="categoryAdd"
|
||||
>新增分类</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="ID" align="center" prop="id" width="50px"/>
|
||||
<el-table-column label="分类名称" align="center" prop="categoryName"/>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.status == '启用'" size="medium">启用</el-tag>
|
||||
<el-tag v-if ="scope.row.status == '禁用'" type="danger" size="medium">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
</template>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
|
||||
<!-- 新增/修改-->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="dataForm" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="分类名称" prop="supplierName">
|
||||
<el-input v-model="dataForm.categoryName" placeholder="分类名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="排序" prop="contactPerson">
|
||||
<el-input-number v-model="dataForm.sort" :min="1" :max="10" label=""></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
@change="handleIsopenSelect"
|
||||
:value="dict.value"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getGiftCategoryApi,insertGiftCategoryApi,updateGiftCategoryApi } from "@/api/integral/category";
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
dicts: ['zhzt'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
|
||||
dataForm:{
|
||||
id: null,
|
||||
categoryName: null,
|
||||
sort: null,
|
||||
status: null
|
||||
},
|
||||
|
||||
rules: {
|
||||
categoryName: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: "排序不能为空", trigger: "blur" },
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
categoryName: '',
|
||||
status: '',
|
||||
page:null,
|
||||
pageSize:null
|
||||
},
|
||||
dateRange:{},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getGiftCategoryApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.dataList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
})
|
||||
this.loading = false;
|
||||
},
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.dataForm.id == null) {
|
||||
// 判断是否是新增还是修改
|
||||
insertGiftCategoryApi(this.dataForm).then(res => {
|
||||
this.getList()
|
||||
this.open = false
|
||||
})
|
||||
} else {
|
||||
// 判断是否是新增还是修改
|
||||
updateGiftCategoryApi(this.dataForm).then(res => {
|
||||
this.getList()
|
||||
this.open = false
|
||||
})
|
||||
}
|
||||
}})
|
||||
},
|
||||
handleIsopenSelect() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 新增
|
||||
categoryAdd() {
|
||||
this.dataForm = {}
|
||||
this.dataForm.status = '启用'
|
||||
this.open = true
|
||||
this.title = '添加分类'
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 修改按钮
|
||||
handleUpdate(data) {
|
||||
this.dataForm = data
|
||||
this.open = true
|
||||
this.getList();
|
||||
},
|
||||
resetQuery(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -340,3 +340,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.fuint.business.integral.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.service.IntegralGiftCategoryService;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilGun;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 礼品分类表(IntegralGiftCategory)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 09:46:46
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("business/integral/integralGiftCategory")
|
||||
public class IntegralGiftCategoryController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private IntegralGiftCategoryService integralGiftCategoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGiftCategory 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo, pageSize);
|
||||
IPage<IntegralGiftCategory> integralGiftCategoryIPage = this.integralGiftCategoryService.queryByPage(page, integralGiftCategory);
|
||||
return getSuccessResult(integralGiftCategoryIPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.integralGiftCategoryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGiftCategory 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@RequestBody IntegralGiftCategory integralGiftCategory) {
|
||||
return getSuccessResult(this.integralGiftCategoryService.insert(integralGiftCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param integralGiftCategory 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@RequestBody IntegralGiftCategory integralGiftCategory) {
|
||||
return getSuccessResult(this.integralGiftCategoryService.update(integralGiftCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject deleteById(Integer id) {
|
||||
return getSuccessResult(this.integralGiftCategoryService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
package com.fuint.business.integral.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (IntegralGift)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("integralGift")
|
||||
public class IntegralGiftController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private IntegralGiftService integralGiftService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGift 筛选条件
|
||||
* @param pageNo 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralGiftCategory") IntegralGift integralGift) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo, pageSize);
|
||||
IPage<IntegralGiftVO> integralGiftCategoryIPage = this.integralGiftService.queryByPage(page, integralGift);
|
||||
return getSuccessResult(integralGiftCategoryIPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.integralGiftService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGift 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@RequestBody IntegralGift integralGift) {
|
||||
return getSuccessResult(this.integralGiftService.insert(integralGift));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param integralGift 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@RequestBody IntegralGift integralGift) {
|
||||
return getSuccessResult(this.integralGiftService.update(integralGift));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject deleteById(Integer id) {
|
||||
return getSuccessResult(this.integralGiftService.deleteById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,377 @@
|
||||
package com.fuint.business.integral.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (IntegralGift)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
public class IntegralGift implements Serializable {
|
||||
private static final long serialVersionUID = -94300211865653814L;
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
private String giftName;
|
||||
/**
|
||||
* 分类ID
|
||||
*/
|
||||
private Integer categoryId;
|
||||
/**
|
||||
* 封面图
|
||||
*/
|
||||
private String coverImage;
|
||||
/**
|
||||
* 礼品图片
|
||||
*/
|
||||
private String giftImages;
|
||||
/**
|
||||
* 礼品类型
|
||||
*/
|
||||
private String giftType;
|
||||
/**
|
||||
* 优惠券ID
|
||||
*/
|
||||
private Integer couponId;
|
||||
/**
|
||||
* 兑换券ID
|
||||
*/
|
||||
private Integer voucherId;
|
||||
/**
|
||||
* 关联商品ID
|
||||
*/
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 礼品数量
|
||||
*/
|
||||
private Integer giftQuantity;
|
||||
/**
|
||||
* 礼品总库存
|
||||
*/
|
||||
private Integer totalInventory;
|
||||
/**
|
||||
* 礼品剩余库存
|
||||
*/
|
||||
private Integer remainingInventory;
|
||||
/**
|
||||
* 商家卡券
|
||||
*/
|
||||
private Integer merchantCouponId;
|
||||
/**
|
||||
* 兑换方式
|
||||
*/
|
||||
private String exchangeMethod;
|
||||
/**
|
||||
* 兑换积分
|
||||
*/
|
||||
private Integer exchangePoints;
|
||||
/**
|
||||
* 加钱比例
|
||||
*/
|
||||
private Double moneyRatio;
|
||||
/**
|
||||
* 兑换金额
|
||||
*/
|
||||
private Double exchangeAmount;
|
||||
/**
|
||||
* 兑换加油金
|
||||
*/
|
||||
private Double exchangeFuelAmount;
|
||||
/**
|
||||
* 配送方式
|
||||
*/
|
||||
private String deliveryMethod;
|
||||
/**
|
||||
* 快递运费
|
||||
*/
|
||||
private Double expressShippingFee;
|
||||
/**
|
||||
* 运费金额
|
||||
*/
|
||||
private Double shippingFeeAmount;
|
||||
/**
|
||||
* 兑换次数
|
||||
*/
|
||||
private Integer exchangeTimes;
|
||||
/**
|
||||
* 礼品排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 礼品状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 图文详情
|
||||
*/
|
||||
private String detailedDescription;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Integer createBy;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private Integer updateBy;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public Integer getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(Integer categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public String getCoverImage() {
|
||||
return coverImage;
|
||||
}
|
||||
|
||||
public void setCoverImage(String coverImage) {
|
||||
this.coverImage = coverImage;
|
||||
}
|
||||
|
||||
public String getGiftImages() {
|
||||
return giftImages;
|
||||
}
|
||||
|
||||
public void setGiftImages(String giftImages) {
|
||||
this.giftImages = giftImages;
|
||||
}
|
||||
|
||||
public String getGiftType() {
|
||||
return giftType;
|
||||
}
|
||||
|
||||
public void setGiftType(String giftType) {
|
||||
this.giftType = giftType;
|
||||
}
|
||||
|
||||
public Integer getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public void setCouponId(Integer couponId) {
|
||||
this.couponId = couponId;
|
||||
}
|
||||
|
||||
public Integer getVoucherId() {
|
||||
return voucherId;
|
||||
}
|
||||
|
||||
public void setVoucherId(Integer voucherId) {
|
||||
this.voucherId = voucherId;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public Integer getGiftQuantity() {
|
||||
return giftQuantity;
|
||||
}
|
||||
|
||||
public void setGiftQuantity(Integer giftQuantity) {
|
||||
this.giftQuantity = giftQuantity;
|
||||
}
|
||||
|
||||
public Integer getTotalInventory() {
|
||||
return totalInventory;
|
||||
}
|
||||
|
||||
public void setTotalInventory(Integer totalInventory) {
|
||||
this.totalInventory = totalInventory;
|
||||
}
|
||||
|
||||
public Integer getRemainingInventory() {
|
||||
return remainingInventory;
|
||||
}
|
||||
|
||||
public void setRemainingInventory(Integer remainingInventory) {
|
||||
this.remainingInventory = remainingInventory;
|
||||
}
|
||||
|
||||
public Integer getMerchantCouponId() {
|
||||
return merchantCouponId;
|
||||
}
|
||||
|
||||
public void setMerchantCouponId(Integer merchantCouponId) {
|
||||
this.merchantCouponId = merchantCouponId;
|
||||
}
|
||||
|
||||
public String getExchangeMethod() {
|
||||
return exchangeMethod;
|
||||
}
|
||||
|
||||
public void setExchangeMethod(String exchangeMethod) {
|
||||
this.exchangeMethod = exchangeMethod;
|
||||
}
|
||||
|
||||
public Integer getExchangePoints() {
|
||||
return exchangePoints;
|
||||
}
|
||||
|
||||
public void setExchangePoints(Integer exchangePoints) {
|
||||
this.exchangePoints = exchangePoints;
|
||||
}
|
||||
|
||||
public Double getMoneyRatio() {
|
||||
return moneyRatio;
|
||||
}
|
||||
|
||||
public void setMoneyRatio(Double moneyRatio) {
|
||||
this.moneyRatio = moneyRatio;
|
||||
}
|
||||
|
||||
public Double getExchangeAmount() {
|
||||
return exchangeAmount;
|
||||
}
|
||||
|
||||
public void setExchangeAmount(Double exchangeAmount) {
|
||||
this.exchangeAmount = exchangeAmount;
|
||||
}
|
||||
|
||||
public Double getExchangeFuelAmount() {
|
||||
return exchangeFuelAmount;
|
||||
}
|
||||
|
||||
public void setExchangeFuelAmount(Double exchangeFuelAmount) {
|
||||
this.exchangeFuelAmount = exchangeFuelAmount;
|
||||
}
|
||||
|
||||
public String getDeliveryMethod() {
|
||||
return deliveryMethod;
|
||||
}
|
||||
|
||||
public void setDeliveryMethod(String deliveryMethod) {
|
||||
this.deliveryMethod = deliveryMethod;
|
||||
}
|
||||
|
||||
public Double getExpressShippingFee() {
|
||||
return expressShippingFee;
|
||||
}
|
||||
|
||||
public void setExpressShippingFee(Double expressShippingFee) {
|
||||
this.expressShippingFee = expressShippingFee;
|
||||
}
|
||||
|
||||
public Double getShippingFeeAmount() {
|
||||
return shippingFeeAmount;
|
||||
}
|
||||
|
||||
public void setShippingFeeAmount(Double shippingFeeAmount) {
|
||||
this.shippingFeeAmount = shippingFeeAmount;
|
||||
}
|
||||
|
||||
public Integer getExchangeTimes() {
|
||||
return exchangeTimes;
|
||||
}
|
||||
|
||||
public void setExchangeTimes(Integer exchangeTimes) {
|
||||
this.exchangeTimes = exchangeTimes;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDetailedDescription() {
|
||||
return detailedDescription;
|
||||
}
|
||||
|
||||
public void setDetailedDescription(String detailedDescription) {
|
||||
this.detailedDescription = detailedDescription;
|
||||
}
|
||||
|
||||
public Integer getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(Integer storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Integer getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(Integer createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Integer getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(Integer updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.fuint.business.integral.entity;
|
||||
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 礼品分类表(IntegralGiftCategory)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 09:46:56
|
||||
*/
|
||||
@Data
|
||||
public class IntegralGiftCategory extends BaseEntity {
|
||||
private static final long serialVersionUID = 550461931964672244L;
|
||||
/**
|
||||
* 礼品分类id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.fuint.business.integral.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品分类表(IntegralGiftCategory)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 09:46:54
|
||||
*/
|
||||
public interface IntegralGiftCategoryMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGiftCategory queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param integralGiftCategory 查询条件
|
||||
* @param 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<IntegralGiftCategory> queryAllByLimit(@Param("page") Page page, @Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param integralGiftCategory 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralGiftCategory> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<IntegralGiftCategory> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralGiftCategory> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<IntegralGiftCategory> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,87 @@
|
||||
package com.fuint.business.integral.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (IntegralGift)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
public interface IntegralGiftMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGift queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param integralGift 查询条件
|
||||
* @param page 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<IntegralGiftVO> queryAllByLimit(@Param("page") Page page, @Param("integralGift") IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param integralGift 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralGift> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<IntegralGift> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralGift> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<IntegralGift> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,165 @@
|
||||
<?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.fuint.business.integral.mapper.IntegralGiftCategoryMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.integral.entity.IntegralGiftCategory" id="IntegralGiftCategoryMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="categoryName" column="category_name" jdbcType="VARCHAR"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="IntegralGiftCategoryMap">
|
||||
select
|
||||
id, category_name, sort, status, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_gift_category
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="IntegralGiftCategoryMap">
|
||||
select
|
||||
id, category_name, sort, status, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_gift_category
|
||||
<where>
|
||||
<if test="integralGiftCategory.id != null">
|
||||
and id = #{integralGiftCategory.id}
|
||||
</if>
|
||||
<if test="integralGiftCategory.categoryName != null and integralGiftCategory.categoryName != ''">
|
||||
and category_name like CONCAT ('%',#{integralGiftCategory.categoryName},'%')
|
||||
</if>
|
||||
<if test="integralGiftCategory.sort != null">
|
||||
and sort = #{integralGiftCategory.sort}
|
||||
</if>
|
||||
<if test="integralGiftCategory.status != null and integralGiftCategory.status != ''">
|
||||
and status = #{integralGiftCategory.status}
|
||||
</if>
|
||||
<if test="integralGiftCategory.storeId != null">
|
||||
and store_id = #{integralGiftCategory.storeId}
|
||||
</if>
|
||||
<if test="integralGiftCategory.createTime != null">
|
||||
and create_time = #{integralGiftCategory.createTime}
|
||||
</if>
|
||||
<if test="integralGiftCategory.updateTime != null">
|
||||
and update_time = #{integralGiftCategory.updateTime}
|
||||
</if>
|
||||
<if test="integralGiftCategory.createBy != null">
|
||||
and create_by = #{integralGiftCategory.createBy}
|
||||
</if>
|
||||
<if test="integralGiftCategory.updateBy != null">
|
||||
and update_by = #{integralGiftCategory.updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from integral_gift_category
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="categoryName != null and categoryName != ''">
|
||||
and category_name = #{categoryName}
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift_category(category_name, sort, status, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{categoryName}, #{sort}, #{status}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift_category(category_name, sort, status, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.categoryName}, #{entity.sort}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift_category(category_name, sort, status, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.categoryName}, #{entity.sort}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
category_name = values(category_name),
|
||||
sort = values(sort),
|
||||
status = values(status),
|
||||
store_id = values(store_id),
|
||||
create_time = values(create_time),
|
||||
update_time = values(update_time),
|
||||
create_by = values(create_by),
|
||||
update_by = values(update_by)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update integral_gift_category
|
||||
<set>
|
||||
<if test="categoryName != null and categoryName != ''">
|
||||
category_name = #{categoryName},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from integral_gift_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,400 @@
|
||||
<?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.fuint.business.integral.mapper.IntegralGiftMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.integral.entity.IntegralGift" id="IntegralGiftMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="giftName" column="gift_name" jdbcType="VARCHAR"/>
|
||||
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
|
||||
<result property="coverImage" column="cover_image" jdbcType="VARCHAR"/>
|
||||
<result property="giftImages" column="gift_images" jdbcType="VARCHAR"/>
|
||||
<result property="giftType" column="gift_type" jdbcType="VARCHAR"/>
|
||||
<result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
|
||||
<result property="voucherId" column="voucher_id" jdbcType="INTEGER"/>
|
||||
<result property="goodsId" column="goods_id" jdbcType="INTEGER"/>
|
||||
<result property="giftQuantity" column="gift_quantity" jdbcType="INTEGER"/>
|
||||
<result property="totalInventory" column="total_inventory" jdbcType="INTEGER"/>
|
||||
<result property="remainingInventory" column="remaining_inventory" jdbcType="INTEGER"/>
|
||||
<result property="merchantCouponId" column="merchant_coupon_id" jdbcType="INTEGER"/>
|
||||
<result property="exchangeMethod" column="exchange_method" jdbcType="VARCHAR"/>
|
||||
<result property="exchangePoints" column="exchange_points" jdbcType="INTEGER"/>
|
||||
<result property="moneyRatio" column="money_ratio" jdbcType="NUMERIC"/>
|
||||
<result property="exchangeAmount" column="exchange_amount" jdbcType="NUMERIC"/>
|
||||
<result property="exchangeFuelAmount" column="exchange_fuel_amount" jdbcType="NUMERIC"/>
|
||||
<result property="deliveryMethod" column="delivery_method" jdbcType="VARCHAR"/>
|
||||
<result property="expressShippingFee" column="express_shipping_fee" jdbcType="NUMERIC"/>
|
||||
<result property="shippingFeeAmount" column="shipping_fee_amount" jdbcType="NUMERIC"/>
|
||||
<result property="exchangeTimes" column="exchange_times" jdbcType="INTEGER"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="detailedDescription" column="detailed_description" jdbcType="VARCHAR"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="IntegralGiftMapVO" type="com.fuint.business.integral.vo.IntegralGiftVO" >
|
||||
<association property="goodsId" resultMap="IntegralGiftMap" />
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="IntegralGiftMap">
|
||||
select
|
||||
id, gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_gift
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="IntegralGiftMap">
|
||||
select
|
||||
id, gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_gift
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="giftName != null and giftName != ''">
|
||||
and gift_name = #{giftName}
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
and category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="coverImage != null and coverImage != ''">
|
||||
and cover_image = #{coverImage}
|
||||
</if>
|
||||
<if test="giftImages != null and giftImages != ''">
|
||||
and gift_images = #{giftImages}
|
||||
</if>
|
||||
<if test="giftType != null and giftType != ''">
|
||||
and gift_type = #{giftType}
|
||||
</if>
|
||||
<if test="couponId != null">
|
||||
and coupon_id = #{couponId}
|
||||
</if>
|
||||
<if test="voucherId != null">
|
||||
and voucher_id = #{voucherId}
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
and goods_id = #{goodsId}
|
||||
</if>
|
||||
<if test="giftQuantity != null">
|
||||
and gift_quantity = #{giftQuantity}
|
||||
</if>
|
||||
<if test="totalInventory != null">
|
||||
and total_inventory = #{totalInventory}
|
||||
</if>
|
||||
<if test="remainingInventory != null">
|
||||
and remaining_inventory = #{remainingInventory}
|
||||
</if>
|
||||
<if test="merchantCouponId != null">
|
||||
and merchant_coupon_id = #{merchantCouponId}
|
||||
</if>
|
||||
<if test="exchangeMethod != null and exchangeMethod != ''">
|
||||
and exchange_method = #{exchangeMethod}
|
||||
</if>
|
||||
<if test="exchangePoints != null">
|
||||
and exchange_points = #{exchangePoints}
|
||||
</if>
|
||||
<if test="moneyRatio != null">
|
||||
and money_ratio = #{moneyRatio}
|
||||
</if>
|
||||
<if test="exchangeAmount != null">
|
||||
and exchange_amount = #{exchangeAmount}
|
||||
</if>
|
||||
<if test="exchangeFuelAmount != null">
|
||||
and exchange_fuel_amount = #{exchangeFuelAmount}
|
||||
</if>
|
||||
<if test="deliveryMethod != null and deliveryMethod != ''">
|
||||
and delivery_method = #{deliveryMethod}
|
||||
</if>
|
||||
<if test="expressShippingFee != null">
|
||||
and express_shipping_fee = #{expressShippingFee}
|
||||
</if>
|
||||
<if test="shippingFeeAmount != null">
|
||||
and shipping_fee_amount = #{shippingFeeAmount}
|
||||
</if>
|
||||
<if test="exchangeTimes != null">
|
||||
and exchange_times = #{exchangeTimes}
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="detailedDescription != null and detailedDescription != ''">
|
||||
and detailed_description = #{detailedDescription}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from integral_gift
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="giftName != null and giftName != ''">
|
||||
and gift_name = #{giftName}
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
and category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="coverImage != null and coverImage != ''">
|
||||
and cover_image = #{coverImage}
|
||||
</if>
|
||||
<if test="giftImages != null and giftImages != ''">
|
||||
and gift_images = #{giftImages}
|
||||
</if>
|
||||
<if test="giftType != null and giftType != ''">
|
||||
and gift_type = #{giftType}
|
||||
</if>
|
||||
<if test="couponId != null">
|
||||
and coupon_id = #{couponId}
|
||||
</if>
|
||||
<if test="voucherId != null">
|
||||
and voucher_id = #{voucherId}
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
and goods_id = #{goodsId}
|
||||
</if>
|
||||
<if test="giftQuantity != null">
|
||||
and gift_quantity = #{giftQuantity}
|
||||
</if>
|
||||
<if test="totalInventory != null">
|
||||
and total_inventory = #{totalInventory}
|
||||
</if>
|
||||
<if test="remainingInventory != null">
|
||||
and remaining_inventory = #{remainingInventory}
|
||||
</if>
|
||||
<if test="merchantCouponId != null">
|
||||
and merchant_coupon_id = #{merchantCouponId}
|
||||
</if>
|
||||
<if test="exchangeMethod != null and exchangeMethod != ''">
|
||||
and exchange_method = #{exchangeMethod}
|
||||
</if>
|
||||
<if test="exchangePoints != null">
|
||||
and exchange_points = #{exchangePoints}
|
||||
</if>
|
||||
<if test="moneyRatio != null">
|
||||
and money_ratio = #{moneyRatio}
|
||||
</if>
|
||||
<if test="exchangeAmount != null">
|
||||
and exchange_amount = #{exchangeAmount}
|
||||
</if>
|
||||
<if test="exchangeFuelAmount != null">
|
||||
and exchange_fuel_amount = #{exchangeFuelAmount}
|
||||
</if>
|
||||
<if test="deliveryMethod != null and deliveryMethod != ''">
|
||||
and delivery_method = #{deliveryMethod}
|
||||
</if>
|
||||
<if test="expressShippingFee != null">
|
||||
and express_shipping_fee = #{expressShippingFee}
|
||||
</if>
|
||||
<if test="shippingFeeAmount != null">
|
||||
and shipping_fee_amount = #{shippingFeeAmount}
|
||||
</if>
|
||||
<if test="exchangeTimes != null">
|
||||
and exchange_times = #{exchangeTimes}
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="detailedDescription != null and detailedDescription != ''">
|
||||
and detailed_description = #{detailedDescription}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.giftName}, #{entity.categoryId}, #{entity.coverImage}, #{entity.giftImages}, #{entity.giftType}, #{entity.couponId}, #{entity.voucherId}, #{entity.goodsId}, #{entity.giftQuantity}, #{entity.totalInventory}, #{entity.remainingInventory}, #{entity.merchantCouponId}, #{entity.exchangeMethod}, #{entity.exchangePoints}, #{entity.moneyRatio}, #{entity.exchangeAmount}, #{entity.exchangeFuelAmount}, #{entity.deliveryMethod}, #{entity.expressShippingFee}, #{entity.shippingFeeAmount}, #{entity.exchangeTimes}, #{entity.sort}, #{entity.status}, #{entity.detailedDescription}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.giftName}, #{entity.categoryId}, #{entity.coverImage}, #{entity.giftImages}, #{entity.giftType}, #{entity.couponId}, #{entity.voucherId}, #{entity.goodsId}, #{entity.giftQuantity}, #{entity.totalInventory}, #{entity.remainingInventory}, #{entity.merchantCouponId}, #{entity.exchangeMethod}, #{entity.exchangePoints}, #{entity.moneyRatio}, #{entity.exchangeAmount}, #{entity.exchangeFuelAmount}, #{entity.deliveryMethod}, #{entity.expressShippingFee}, #{entity.shippingFeeAmount}, #{entity.exchangeTimes}, #{entity.sort}, #{entity.status}, #{entity.detailedDescription}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
gift_name = values(gift_name),
|
||||
category_id = values(category_id),
|
||||
cover_image = values(cover_image),
|
||||
gift_images = values(gift_images),
|
||||
gift_type = values(gift_type),
|
||||
coupon_id = values(coupon_id),
|
||||
voucher_id = values(voucher_id),
|
||||
goods_id = values(goods_id),
|
||||
gift_quantity = values(gift_quantity),
|
||||
total_inventory = values(total_inventory),
|
||||
remaining_inventory = values(remaining_inventory),
|
||||
merchant_coupon_id = values(merchant_coupon_id),
|
||||
exchange_method = values(exchange_method),
|
||||
exchange_points = values(exchange_points),
|
||||
money_ratio = values(money_ratio),
|
||||
exchange_amount = values(exchange_amount),
|
||||
exchange_fuel_amount = values(exchange_fuel_amount),
|
||||
delivery_method = values(delivery_method),
|
||||
express_shipping_fee = values(express_shipping_fee),
|
||||
shipping_fee_amount = values(shipping_fee_amount),
|
||||
exchange_times = values(exchange_times),
|
||||
sort = values(sort),
|
||||
status = values(status),
|
||||
detailed_description = values(detailed_description),
|
||||
store_id = values(store_id),
|
||||
create_time = values(create_time),
|
||||
update_time = values(update_time),
|
||||
create_by = values(create_by),
|
||||
update_by = values(update_by)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update integral_gift
|
||||
<set>
|
||||
<if test="giftName != null and giftName != ''">
|
||||
gift_name = #{giftName},
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
category_id = #{categoryId},
|
||||
</if>
|
||||
<if test="coverImage != null and coverImage != ''">
|
||||
cover_image = #{coverImage},
|
||||
</if>
|
||||
<if test="giftImages != null and giftImages != ''">
|
||||
gift_images = #{giftImages},
|
||||
</if>
|
||||
<if test="giftType != null and giftType != ''">
|
||||
gift_type = #{giftType},
|
||||
</if>
|
||||
<if test="couponId != null">
|
||||
coupon_id = #{couponId},
|
||||
</if>
|
||||
<if test="voucherId != null">
|
||||
voucher_id = #{voucherId},
|
||||
</if>
|
||||
<if test="goodsId != null">
|
||||
goods_id = #{goodsId},
|
||||
</if>
|
||||
<if test="giftQuantity != null">
|
||||
gift_quantity = #{giftQuantity},
|
||||
</if>
|
||||
<if test="totalInventory != null">
|
||||
total_inventory = #{totalInventory},
|
||||
</if>
|
||||
<if test="remainingInventory != null">
|
||||
remaining_inventory = #{remainingInventory},
|
||||
</if>
|
||||
<if test="merchantCouponId != null">
|
||||
merchant_coupon_id = #{merchantCouponId},
|
||||
</if>
|
||||
<if test="exchangeMethod != null and exchangeMethod != ''">
|
||||
exchange_method = #{exchangeMethod},
|
||||
</if>
|
||||
<if test="exchangePoints != null">
|
||||
exchange_points = #{exchangePoints},
|
||||
</if>
|
||||
<if test="moneyRatio != null">
|
||||
money_ratio = #{moneyRatio},
|
||||
</if>
|
||||
<if test="exchangeAmount != null">
|
||||
exchange_amount = #{exchangeAmount},
|
||||
</if>
|
||||
<if test="exchangeFuelAmount != null">
|
||||
exchange_fuel_amount = #{exchangeFuelAmount},
|
||||
</if>
|
||||
<if test="deliveryMethod != null and deliveryMethod != ''">
|
||||
delivery_method = #{deliveryMethod},
|
||||
</if>
|
||||
<if test="expressShippingFee != null">
|
||||
express_shipping_fee = #{expressShippingFee},
|
||||
</if>
|
||||
<if test="shippingFeeAmount != null">
|
||||
shipping_fee_amount = #{shippingFeeAmount},
|
||||
</if>
|
||||
<if test="exchangeTimes != null">
|
||||
exchange_times = #{exchangeTimes},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="detailedDescription != null and detailedDescription != ''">
|
||||
detailed_description = #{detailedDescription},
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from integral_gift where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.fuint.business.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 礼品分类表(IntegralGiftCategory)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 09:46:57
|
||||
*/
|
||||
public interface IntegralGiftCategoryService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGiftCategory queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGiftCategory 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<IntegralGiftCategory> queryByPage(@Param("page") Page page, @Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGiftCategory insert(IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGiftCategory update(IntegralGiftCategory integralGiftCategory);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.fuint.business.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
/**
|
||||
* (IntegralGift)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
public interface IntegralGiftService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGift queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGift 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<IntegralGiftVO> queryByPage(@Param("page") com.baomidou.mybatisplus.extension.plugins.pagination.Page page, @Param("integralGift") IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGift insert(IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralGift update(IntegralGift integralGift);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.mapper.IntegralGiftCategoryMapper;
|
||||
import com.fuint.business.integral.service.IntegralGiftCategoryService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 礼品分类表(IntegralGiftCategory)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 09:46:58
|
||||
*/
|
||||
@Service("integralGiftCategoryService")
|
||||
public class IntegralGiftCategoryServiceImpl implements IntegralGiftCategoryService {
|
||||
@Resource
|
||||
private IntegralGiftCategoryMapper integralGiftCategoryDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGiftCategory queryById(Integer id) {
|
||||
return this.integralGiftCategoryDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGiftCategory 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralGiftCategory> queryByPage(@Param("page") Page page, @Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGiftCategory.setStoreId(nowAccountInfo.getStoreId());
|
||||
return integralGiftCategoryDao.queryAllByLimit(page, integralGiftCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGiftCategory insert(IntegralGiftCategory integralGiftCategory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGiftCategory.setStoreId(nowAccountInfo.getStoreId());
|
||||
integralGiftCategory.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
this.integralGiftCategoryDao.insert(integralGiftCategory);
|
||||
return integralGiftCategory;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGiftCategory 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGiftCategory update(IntegralGiftCategory integralGiftCategory) {
|
||||
this.integralGiftCategoryDao.update(integralGiftCategory);
|
||||
return this.queryById(integralGiftCategory.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.integralGiftCategoryDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.mapper.IntegralGiftMapper;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (IntegralGift)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
@Service("integralGiftService")
|
||||
public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
@Resource
|
||||
private IntegralGiftMapper integralGiftDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGift queryById(Integer id) {
|
||||
return this.integralGiftDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGift 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralGiftVO> queryByPage(@Param("page") com.baomidou.mybatisplus.extension.plugins.pagination.Page page, @Param("integralGiftCategory") IntegralGift integralGift) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGift.setStoreId(nowAccountInfo.getStoreId());
|
||||
return integralGiftDao.queryAllByLimit(page, integralGift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGift insert(IntegralGift integralGift) {
|
||||
this.integralGiftDao.insert(integralGift);
|
||||
return integralGift;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralGift 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralGift update(IntegralGift integralGift) {
|
||||
this.integralGiftDao.update(integralGift);
|
||||
return this.queryById(integralGift.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.integralGiftDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.fuint.business.integral.vo;
|
||||
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralGiftVO extends IntegralGift {
|
||||
// 商品
|
||||
// 优惠卷
|
||||
}
|
Loading…
Reference in New Issue
Block a user