parent
a63b08e3a5
commit
75a4bea6db
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zxf 1532322479@qq.com
|
||||||
|
* @Date: 2026-01-04 17:03:25
|
||||||
|
* @LastEditors: zxf 1532322479@qq.com
|
||||||
|
* @LastEditTime: 2026-01-04 17:05:28
|
||||||
|
* @FilePath: \crmebTwo\admin\src\api\pmtentanthouserel.js
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增pmtenanthouserel
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function pmtentanthouserelCreateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/pmtenanthouserel/save`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pmtenanthouserel更新
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function pmtentanthouserelUpdateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/pmtenanthouserel/update`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pmtenanthouserel详情
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function pmtentanthouserelDetailApi(id) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/pmtenanthouserel/info/${id}`,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pmtenanthouserel批量删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
export function pmtentanthouserelDeleteApi(ids) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/pmtenanthouserel/delete`,
|
||||||
|
method: 'POST',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pmtenanthouserel列表
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function pmtentanthouserelListApi(params) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/pmtenanthouserel/list`,
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增syspost
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function syspostCreateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/syspost/save`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* syspost更新
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function syspostUpdateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/syspost/update`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* syspost详情
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function syspostDetailApi(id) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/syspost/info/${id}`,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* syspost批量删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
export function syspostDeleteApi(ids) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/syspost/delete`,
|
||||||
|
method: 'POST',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* syspost列表
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function syspostListApi(params) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/syspost/list`,
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增sysuserpost
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function sysuserpostCreateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/sysuserpost/save`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysuserpost更新
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function sysuserpostUpdateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/sysuserpost/update`,
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysuserpost详情
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function sysuserpostDetailApi(id) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/sysuserpost/info/${id}`,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysuserpost批量删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
export function sysuserpostDeleteApi(ids) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/sysuserpost/delete`,
|
||||||
|
method: 'POST',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysuserpost列表
|
||||||
|
* @param pram
|
||||||
|
*/
|
||||||
|
export function sysuserpostListApi(params) {
|
||||||
|
return request({
|
||||||
|
url: `autogencode/sysuserpost/list`,
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 基于 Element UI 新增和修改弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="!dataForm.id ? '添加' : '修改'"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="visible"
|
||||||
|
:z-index="3000">
|
||||||
|
<!-- 新增和修改表单 -->
|
||||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="120px">
|
||||||
|
<el-form-item label="绑定时间" prop="rentBeginTime">
|
||||||
|
<el-date-picker v-model="dataForm.rentBeginTime" type="datetime" placeholder="选择绑定时间" style="width: 100%"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="解绑时间" prop="rentEndTime">
|
||||||
|
<el-date-picker v-model="dataForm.rentEndTime" type="datetime" placeholder="选择解绑时间" style="width: 100%"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="押金金额" prop="depositAmount">
|
||||||
|
<el-input-number v-model="dataForm.depositAmount" :min="0" :precision="2" placeholder="押金金额" style="width: 100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="月租金" prop="rentAmount">
|
||||||
|
<el-input-number v-model="dataForm.rentAmount" :min="0" :precision="2" placeholder="月租金" style="width: 100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="授权范围" prop="authScope">
|
||||||
|
<el-input v-model="dataForm.authScope" placeholder="授权范围"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-input v-model="dataForm.status" placeholder="状态"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" placeholder="备注" type="textarea"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as api from '@/api/pmtenanthouse.js'
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
tenantId: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: 0,
|
||||||
|
rentId: 0,
|
||||||
|
rentBeginTime: '',
|
||||||
|
rentEndTime: '',
|
||||||
|
depositAmount: 0,
|
||||||
|
rentAmount: 0,
|
||||||
|
authScope: '',
|
||||||
|
status: '',
|
||||||
|
remark: ''
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
rentBeginTime: [
|
||||||
|
{ required: true, message: '绑定时间为必填项', trigger: 'change' }
|
||||||
|
],
|
||||||
|
rentEndTime: [
|
||||||
|
{ required: true, message: '解绑时间为必填项', trigger: 'change' }
|
||||||
|
],
|
||||||
|
depositAmount: [
|
||||||
|
{ required: true, message: '押金金额为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
rentAmount: [
|
||||||
|
{ required: true, message: '月租金为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
authScope: [
|
||||||
|
{ required: true, message: '授权范围为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
status: [
|
||||||
|
{ required: true, message: '状态为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init (id, tenantId) { // 初始化表单验证规则
|
||||||
|
this.dataForm.id = id || 0
|
||||||
|
this.dataForm.rentId = tenantId || 0
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields()
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
api.pmtenanthouseDetailApi(id).then(res => {
|
||||||
|
this.dataForm = res;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单数据提交
|
||||||
|
dataSubmit () {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
api.pmtenanthouseUpdateApi(this.dataForm).then(res => {
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
this.$emit('saveRentRecord', res)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
api.pmtenanthouseCreateApi(this.dataForm).then(res => {
|
||||||
|
this.$message.success('新增成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
this.$emit('saveRentRecord', res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 基于 Element UI 新增和修改弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="!dataForm.postId ? '添加' : '修改'"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="visible">
|
||||||
|
<!-- 新增和修改表单 -->
|
||||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
|
||||||
|
<el-form-item label="岗位编码" prop="postCode">
|
||||||
|
<el-input v-model="dataForm.postCode" placeholder="岗位编码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="岗位名称" prop="postName">
|
||||||
|
<el-input v-model="dataForm.postName" placeholder="岗位名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="显示顺序" prop="postSort">
|
||||||
|
<el-input v-model="dataForm.postSort" placeholder="显示顺序"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="dataForm.status" placeholder="请选择状态" clearable style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.post_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门" prop="deptId">
|
||||||
|
<treeselect
|
||||||
|
v-model="dataForm.deptId"
|
||||||
|
:options="deptTreeOptions"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
placeholder="选择部门"
|
||||||
|
style="width: 100%"
|
||||||
|
></treeselect>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" type="textarea" placeholder="备注"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as api from '@/api/syspost.js'
|
||||||
|
import * as deptApi from '@/api/sysdept.js'
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Treeselect },
|
||||||
|
dicts: ['post_status'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
deptTreeOptions: [],
|
||||||
|
dataForm: {
|
||||||
|
postId: 0,
|
||||||
|
postCode: '' ,
|
||||||
|
postName: '' ,
|
||||||
|
postSort: '' ,
|
||||||
|
status: '' ,
|
||||||
|
remark: '' ,
|
||||||
|
deptId: '' ,
|
||||||
|
updatestamp: '' ,
|
||||||
|
syncstamp: ''
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
postCode: [
|
||||||
|
{ required: true, message: '岗位编码 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
postName: [
|
||||||
|
{ required: true, message: '岗位名称 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
postSort: [
|
||||||
|
{ required: true, message: '显示顺序 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
status: [
|
||||||
|
{ required: true, message: '状态 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.handleGetDeptList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleGetDeptList() {
|
||||||
|
deptApi.deptTreeSelect().then(res => {
|
||||||
|
this.deptTreeOptions = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.deptId ? node.deptId : '0',
|
||||||
|
label: node.deptName ? node.deptName : '顶级部门',
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
init (id) { // 初始化表单验证规则
|
||||||
|
this.dataForm.postId = id || 0
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.$refs['dataForm'].resetFields()
|
||||||
|
if (this.dataForm.postId) {
|
||||||
|
api.syspostDetailApi(id).then(function(res) {
|
||||||
|
this.dataForm = res;
|
||||||
|
}.bind(this))
|
||||||
|
}
|
||||||
|
}.bind(this))
|
||||||
|
},
|
||||||
|
// 表单数据提交
|
||||||
|
dataSubmit () {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.dataForm.postId) {
|
||||||
|
api.syspostUpdateApi(this.dataForm).then(function(res) {
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}.bind(this));
|
||||||
|
} else {
|
||||||
|
api.syspostCreateApi(this.dataForm).then(function(res) {
|
||||||
|
this.$message.success('新增成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 基于 Element UI 新增和修改弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="!dataForm.id ? '添加' : '修改'"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="visible">
|
||||||
|
<!-- 新增和修改表单 -->
|
||||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="80px">
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input v-model="dataForm.userId" placeholder="用户ID"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="岗位ID" prop="postId">
|
||||||
|
<el-input v-model="dataForm.postId" placeholder="岗位ID"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门id 权限标识" prop="deptId">
|
||||||
|
<el-input v-model="dataForm.deptId" placeholder="部门id 权限标识"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新时间" prop="updatestamp">
|
||||||
|
<el-input v-model="dataForm.updatestamp" placeholder="更新时间"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="同步时间" prop="syncstamp">
|
||||||
|
<el-input v-model="dataForm.syncstamp" placeholder="同步时间"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as api from '@/api/sysuserpost.js'
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: 0,
|
||||||
|
userId: '' ,
|
||||||
|
postId: '' ,
|
||||||
|
deptId: '' ,
|
||||||
|
updatestamp: '' ,
|
||||||
|
syncstamp: '' ,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
userId: [
|
||||||
|
{ required: true, message: '用户ID 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
postId: [
|
||||||
|
{ required: true, message: '岗位ID 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
deptId: [
|
||||||
|
{ required: true, message: '部门id 权限标识 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
updatestamp: [
|
||||||
|
{ required: true, message: '更新时间 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
syncstamp: [
|
||||||
|
{ required: true, message: '同步时间 为必填项', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init (id) { // 初始化表单验证规则
|
||||||
|
this.dataForm.id = id || 0
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.$refs['dataForm'].resetFields()
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
api.sysuserpostDetailApi(id).then(function(res) {
|
||||||
|
this.dataForm = res;
|
||||||
|
}.bind(this))
|
||||||
|
}
|
||||||
|
}.bind(this))
|
||||||
|
},
|
||||||
|
// 表单数据提交
|
||||||
|
dataSubmit () {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
api.sysuserpostUpdateApi(this.dataForm).then(function(res) {
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}.bind(this));
|
||||||
|
} else {
|
||||||
|
api.sysuserpostCreateApi(this.dataForm).then(function(res) {
|
||||||
|
this.$message.success('新增成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
package com.zbkj.admin.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zbkj.common.request.PageParamRequest;
|
||||||
|
import com.zbkj.common.response.CommonResult;
|
||||||
|
import com.zbkj.common.page.CommonPage;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zbkj.common.model.system.SysUserPost;
|
||||||
|
import com.zbkj.service.service.SysUserPostService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户与岗位关联表 控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/autogencode/sysuserpost")
|
||||||
|
public class SysUserPostController {
|
||||||
|
@Autowired
|
||||||
|
private SysUserPostService sysUserPostService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件设置
|
||||||
|
* 根据实体类字段自动生成查询条件
|
||||||
|
*/
|
||||||
|
private void condition(LambdaQueryWrapper<SysUserPost> queryWrapper, SysUserPost request) {
|
||||||
|
if (request == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据实体类字段自动生成查询条件
|
||||||
|
|
||||||
|
// 主键
|
||||||
|
if (StrUtil.isNotBlank(request.getId())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getId, request.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户ID
|
||||||
|
if (StrUtil.isNotBlank(request.getUserId())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getUserId, request.getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 岗位ID
|
||||||
|
if (StrUtil.isNotBlank(request.getPostId())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getPostId, request.getPostId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 部门id 权限标识
|
||||||
|
if (StrUtil.isNotBlank(request.getDeptId())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getDeptId, request.getDeptId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除标示 默认为1 有效数据 ,0为无效已删除
|
||||||
|
if (StrUtil.isNotBlank(request.getDelFlag())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getDelFlag, request.getDelFlag());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 租户id
|
||||||
|
if (StrUtil.isNotBlank(request.getTenantId())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getTenantId, request.getTenantId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新时间
|
||||||
|
if (request.getUpdatestamp() != null) {
|
||||||
|
queryWrapper.eq(SysUserPost::getUpdatestamp, request.getUpdatestamp());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同步时间
|
||||||
|
if (request.getSyncstamp() != null) {
|
||||||
|
queryWrapper.eq(SysUserPost::getSyncstamp, request.getSyncstamp());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建人
|
||||||
|
if (StrUtil.isNotBlank(request.getCreateBy())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getCreateBy, request.getCreateBy());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建时间
|
||||||
|
if (request.getCreateTime() != null) {
|
||||||
|
queryWrapper.eq(SysUserPost::getCreateTime, request.getCreateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改人
|
||||||
|
if (StrUtil.isNotBlank(request.getUpdateBy())) {
|
||||||
|
queryWrapper.eq(SysUserPost::getUpdateBy, request.getUpdateBy());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改时间
|
||||||
|
if (request.getUpdateTime() != null) {
|
||||||
|
queryWrapper.eq(SysUserPost::getUpdateTime, request.getUpdateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页显示用户与岗位关联表
|
||||||
|
* @param request 搜索条件
|
||||||
|
* @param pageParamRequest 分页参数
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "分页列表")
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||||
|
public CommonResult<CommonPage<SysUserPost>> getList(@Validated SysUserPost request, @Validated PageParamRequest pageParamRequest) {
|
||||||
|
LambdaQueryWrapper<SysUserPost> queryWrapper = new LambdaQueryWrapper();
|
||||||
|
|
||||||
|
// 应用搜索条件
|
||||||
|
condition(queryWrapper, request);
|
||||||
|
|
||||||
|
CommonPage<SysUserPost> page = CommonPage.restPage(sysUserPostService.pageList(queryWrapper, pageParamRequest));
|
||||||
|
return CommonResult.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
||||||
|
public CommonResult<SysUserPost> info(@PathVariable("id") String id){
|
||||||
|
SysUserPost sysUserPost = sysUserPostService.getById(id);
|
||||||
|
|
||||||
|
return CommonResult.success(sysUserPost);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
||||||
|
public CommonResult<String> save(@RequestBody SysUserPost sysUserPost){
|
||||||
|
if (sysUserPostService.save(sysUserPost)) {
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
return CommonResult.failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
||||||
|
public CommonResult<String> update(@RequestBody SysUserPost sysUserPost){
|
||||||
|
if (sysUserPostService.updateById(sysUserPost)) {
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
return CommonResult.failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除:根据id集合
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||||
|
public CommonResult<String> delete(@RequestBody String[] ids){
|
||||||
|
if (sysUserPostService.removeByIds(Arrays.asList(ids))) {
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
return CommonResult.failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
<?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.zbkj.modules.autogencode.dao.SysPostDao">
|
||||||
|
|
||||||
|
<!-- 根据包名 模块名 以及类名 生成Mapper XML 配置文件 -->
|
||||||
|
<resultMap type="com.zbkj.modules.autogencode.entity.SysPost" id="sysPostMap">
|
||||||
|
<result property="postId" column="post_id"/>
|
||||||
|
<result property="postCode" column="post_code"/>
|
||||||
|
<result property="postName" column="post_name"/>
|
||||||
|
<result property="postSort" column="post_sort"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="deptId" column="dept_id"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="tenantId" column="tenant_id"/>
|
||||||
|
<result property="updatestamp" column="updatestamp"/>
|
||||||
|
<result property="syncstamp" column="syncstamp"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?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.zbkj.modules.autogencode.dao.SysUserPostDao">
|
||||||
|
|
||||||
|
<!-- 根据包名 模块名 以及类名 生成Mapper XML 配置文件 -->
|
||||||
|
<resultMap type="com.zbkj.modules.autogencode.entity.SysUserPost" id="sysUserPostMap">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="postId" column="post_id"/>
|
||||||
|
<result property="deptId" column="dept_id"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="tenantId" column="tenant_id"/>
|
||||||
|
<result property="updatestamp" column="updatestamp"/>
|
||||||
|
<result property="syncstamp" column="syncstamp"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.zbkj.common.handler;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
import org.apache.ibatis.type.MappedTypes;
|
||||||
|
import org.apache.ibatis.type.TypeHandler;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.sql.CallableStatement;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<String> 类型处理器
|
||||||
|
* 用于处理数据库中的字符串与 Java List<String> 之间的转换
|
||||||
|
*/
|
||||||
|
@MappedTypes({List.class})
|
||||||
|
public class ListStringTypeHandler implements TypeHandler<List<String>> {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ListStringTypeHandler.class);
|
||||||
|
|
||||||
|
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException {
|
||||||
|
if (parameter == null || parameter.isEmpty()) {
|
||||||
|
ps.setString(i, null);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
ps.setString(i, objectMapper.writeValueAsString(parameter));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("List<String> 序列化失败", e);
|
||||||
|
throw new SQLException("List<String> 序列化失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getResult(ResultSet rs, String columnName) throws SQLException {
|
||||||
|
String value = rs.getString(columnName);
|
||||||
|
return parseStringToList(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||||
|
String value = rs.getString(columnIndex);
|
||||||
|
return parseStringToList(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||||
|
String value = cs.getString(columnIndex);
|
||||||
|
return parseStringToList(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> parseStringToList(String value) {
|
||||||
|
if (value == null || value.trim().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(value, List.class);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
logger.error("List<String> 反序列化失败,值: {}", value, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.zbkj.common.model.system;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("sys_user_post")
|
||||||
|
public class SysUserPost implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
@TableId
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private String userId;
|
||||||
|
/**
|
||||||
|
* 岗位ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位ID")
|
||||||
|
private String postId;
|
||||||
|
/**
|
||||||
|
* 部门id 权限标识
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "部门id 权限标识")
|
||||||
|
private String deptId;
|
||||||
|
/**
|
||||||
|
* 删除标示 默认为1 有效数据 ,0为无效已删除
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "删除标示 默认为1 有效数据 ,0为无效已删除")
|
||||||
|
private String delFlag;
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private String tenantId;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private Date updatestamp;
|
||||||
|
/**
|
||||||
|
* 同步时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "同步时间")
|
||||||
|
private Date syncstamp;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String updateBy;
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.zbkj.service.dao;
|
||||||
|
|
||||||
|
import com.zbkj.common.model.system.SysPost;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息表 DAO 映射层
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysPostDao extends BaseMapper<SysPost> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.zbkj.service.dao;
|
||||||
|
|
||||||
|
import com.zbkj.common.model.system.SysUserPost;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户岗位关联表 DAO 映射层
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysUserPostDao extends BaseMapper<SysUserPost> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.zbkj.service.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zbkj.common.model.system.SysPost;
|
||||||
|
import com.zbkj.common.request.PageParamRequest;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息表 业务接口
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public interface SysPostService extends IService<SysPost> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysPost 列表查询
|
||||||
|
* @param pageParamRequest 分页参数对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysPost> pageList(LambdaQueryWrapper<SysPost> queryWrapper, PageParamRequest pageParamRequest);
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.zbkj.service.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zbkj.common.model.system.SysUserPost;
|
||||||
|
import com.zbkj.common.request.PageParamRequest;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户与岗位关联表 业务接口
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public interface SysUserPostService extends IService<SysUserPost> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SysUserPost 列表查询
|
||||||
|
* @param pageParamRequest 分页参数对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysUserPost> pageList(LambdaQueryWrapper<SysUserPost> queryWrapper, PageParamRequest pageParamRequest);
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.zbkj.service.service.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.zbkj.service.dao.SysPostDao;
|
||||||
|
import com.zbkj.common.model.system.SysPost;
|
||||||
|
import com.zbkj.service.service.SysPostService;
|
||||||
|
import com.zbkj.common.page.CommonPage;
|
||||||
|
import com.zbkj.common.request.PageParamRequest;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service("sysPostService")
|
||||||
|
public class SysPostServiceImpl extends ServiceImpl<SysPostDao, SysPost> implements SysPostService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysPostDao dao;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带分页参数的列表查询实现
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysPost> pageList(LambdaQueryWrapper<SysPost> queryWrapper, PageParamRequest pageParamRequest) {
|
||||||
|
|
||||||
|
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
||||||
|
|
||||||
|
return dao.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.zbkj.service.service.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.zbkj.service.dao.SysUserPostDao;
|
||||||
|
import com.zbkj.common.model.system.SysUserPost;
|
||||||
|
import com.zbkj.service.service.SysUserPostService;
|
||||||
|
import com.zbkj.common.page.CommonPage;
|
||||||
|
import com.zbkj.common.request.PageParamRequest;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service("sysUserPostService")
|
||||||
|
public class SysUserPostServiceImpl extends ServiceImpl<SysUserPostDao, SysUserPost> implements SysUserPostService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysUserPostDao dao;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带分页参数的列表查询实现
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysUserPost> pageList(LambdaQueryWrapper<SysUserPost> queryWrapper, PageParamRequest pageParamRequest) {
|
||||||
|
|
||||||
|
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
||||||
|
|
||||||
|
return dao.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue