mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 18:56:18 +09:00
어드민 메뉴 관리, 파티션 관리 추가
This commit is contained in:
@@ -1914,6 +1914,32 @@ textarea:focus{
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.contents .search_check input[type="checkbox"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contents .search_check input[type="checkbox"] + div > label:first-child {
|
||||
width: 20px;
|
||||
height: 30px;
|
||||
display: block;
|
||||
background: url(../images/icon-chk-n-square.png) no-repeat center/100% auto;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.contents .search_check input[type="checkbox"]:checked + div > label:first-child {
|
||||
background: url(../images/icon-chk-square.png) no-repeat center/100% auto;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.contents .search_check .label_group {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@keyframes spScaleAlpha {
|
||||
0% {
|
||||
opacity: 1;
|
||||
|
||||
292
frontend/src/modules/sysMgt/components/MenuPop.vue
Normal file
292
frontend/src/modules/sysMgt/components/MenuPop.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<!-- <div class="wrap bg-wrap"> -->
|
||||
<div>
|
||||
<div class="dimmed modal20" @click="ModalClose();"></div>
|
||||
<div class="popup-wrap modal20">
|
||||
<!-- 메뉴 등록 -->
|
||||
<div class="popup modal20 popup_form">
|
||||
<div class="pop-head">
|
||||
<h3 class="pop-tit" v-if="popType == 'reg'">메뉴 등록</h3>
|
||||
<h3 class="pop-tit" v-else>메뉴 수정</h3>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>메뉴명</th>
|
||||
<td>
|
||||
<input type="text" placeholder="메뉴명 입력" v-model.trim="menuNm" ref="_menuNm">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>상위메뉴</th>
|
||||
<td>
|
||||
<div v:class="select_box">
|
||||
<select name="" v-model="prntsMenuNo" ref="_prntsMenuNo" v-if="popType == 'reg'">
|
||||
<option value="">선택</option>
|
||||
<option v-for="(option, i) in menuCate" v-bind:value="option.menuNo" v-bind:key="i">
|
||||
{{ option.menuNm }}
|
||||
</option>
|
||||
</select>
|
||||
<select name="" v-model="prntsMenuNo" ref="_prntsMenuNo" disabled v-else>
|
||||
<option value="">선택</option>
|
||||
<option v-for="(option, i) in menuCate" v-bind:value="option.menuNo" v-bind:key="i">
|
||||
{{ option.menuNm }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>URL</th>
|
||||
<td><input type="text" v-model.trim="menuUrl" ref="_menuUrl"></td>
|
||||
</tr>
|
||||
<tr v-if="popType == 'modi'">
|
||||
<th>순번</th>
|
||||
<td>
|
||||
<select name="" v-model="menuOdrg" ref="_menuOdrg">
|
||||
<option value="">선택</option>
|
||||
<option v-for="i in maxMenuOdrg" v-bind:value="(i)" v-bind:key="i">
|
||||
{{ (i) }}
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="center">상태</th>
|
||||
<td>
|
||||
<input type="radio" name="useYn" value="Y" id="popup_radio1" v-model="useYn" ref="_useYn">
|
||||
<label for="popup_radio1">사용</label>
|
||||
<input type="radio" name="useYn" value="N" id="popup_radio2" v-model="useYn">
|
||||
<label for="popup_radio2">정지</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="center">그룹</th>
|
||||
<td><input type="text" placeholder="숫자만 입력" v-model.trim="autchkGrpno" @keypress="onlyNum" @input="onlyNum" maxlength="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="popup-btn2">
|
||||
<button class="btn-pcolor" @click="addMenu" v-if="popType == 'reg'">저장</button>
|
||||
<button class="btn-pcolor" @click="modiMenu" v-else>수정</button>
|
||||
<button class="btn-default" @click="ModalClose();">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commmonSysModal"></common-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from '@/service/api';
|
||||
import sysMgtApi from "../service/sysMgtApi.js";
|
||||
import commonModal from "../components/commonModal";
|
||||
import {utils_mixin, chkPattern2} from '../service/mixins';
|
||||
|
||||
export default {
|
||||
name: "menuPop",
|
||||
mixins: [utils_mixin, chkPattern2],
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
menuNo: '',
|
||||
menuNm: '',
|
||||
menuUrl: '',
|
||||
prntsMenuNo: '',
|
||||
menuOdrg: '',
|
||||
useYn: '',
|
||||
autchkGrpno: '',
|
||||
props: {},
|
||||
menuCate: [],
|
||||
maxMenuOdrg: 0,
|
||||
popType: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
commonModal
|
||||
},
|
||||
created() {
|
||||
this.formReset();
|
||||
},
|
||||
methods: {
|
||||
async ModalOpen(param) {
|
||||
this.formReset();
|
||||
this.popType = param.popType;
|
||||
this.row.menuNo = param.menuNo;
|
||||
var dimmed = document.getElementsByClassName('modal20');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'block';
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await sysMgtApi.menuCate(this.row);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.menuCate = result.data.list;
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '상위 메뉴 목록 조회 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.alertSysModalOpen.alertSysModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
if(this.popType == 'modi'){
|
||||
this.getMenuDetail();
|
||||
}
|
||||
},
|
||||
ModalClose() {
|
||||
var dimmed = document.getElementsByClassName('modal20');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
async getMenuDetail() {
|
||||
try {
|
||||
const response = await sysMgtApi.getMenuDetail(this.row);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.maxMenuOdrg = result.data.data.maxMenuOdrg;
|
||||
this.menuNm = result.data.data.menuNm;
|
||||
this.menuNo = result.data.data.menuNo;
|
||||
this.menuOdrg = result.data.data.menuOdrg;
|
||||
this.prntsMenuNo = result.data.data.prntsMenuNo;
|
||||
this.menuUrl = result.data.data.menuUrl;
|
||||
this.useYn = result.data.data.useYn;
|
||||
this.autchkGrpno = result.data.data.autchkGrpno;
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '상위 메뉴 목록 조회 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.alertSysModalOpen.alertSysModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
formReset() {
|
||||
Object.assign(this.$data, this.$options.data());
|
||||
},
|
||||
doValidate() {
|
||||
if (this.isNull(this.menuNm)) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '메뉴명을 입력해 주세요.';
|
||||
this.$refs.commmonSysModal.alertSysModalOpen(this.row);
|
||||
this.row.focusTaget = '1';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.prntsMenuNo)) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '상위 메뉴를 선택해 주세요.';
|
||||
this.$refs.commmonSysModal.alertSysModalOpen(this.row);
|
||||
this.row.focusTaget = '2';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.menuUrl)) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = 'URL을 입력해 주세요.';
|
||||
this.$refs.commmonSysModal.alertSysModalOpen(this.row);
|
||||
this.row.focusTaget = '3';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.popType == "modi" && this.isNull(this.menuOdrg)) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '순번를 선택해 주세요.';
|
||||
this.$refs.commmonSysModal.alertSysModalOpen(this.row);
|
||||
this.row.focusTaget = '4';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.useYn)) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '사용 여부를 선택해 주세요.';
|
||||
this.$refs.commmonSysModal.alertSysModalOpen(this.row);
|
||||
this.row.focusTaget = '5';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
async addMenu() {
|
||||
if(this.doValidate()){
|
||||
this.row.menuNm = this.menuNm;
|
||||
this.row.prntsMenuNo = this.prntsMenuNo;
|
||||
this.row.menuUrl = this.menuUrl;
|
||||
this.row.useYn = this.useYn;
|
||||
this.row.autchkGrpno = this.autchkGrpno;
|
||||
|
||||
try {
|
||||
const response = await sysMgtApi.insertMenu(this.row);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.ModalClose();
|
||||
this.$parent.getMenuList();
|
||||
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '메뉴 저장 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.alertSysModalOpen.alertSysModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
async modiMenu() {
|
||||
if(this.doValidate()){
|
||||
this.row.menuNo = this.menuNo;
|
||||
this.row.menuNm = this.menuNm;
|
||||
this.row.menuUrl = this.menuUrl;
|
||||
this.row.menuOdrg = this.menuOdrg;
|
||||
this.row.useYn = this.useYn;
|
||||
this.row.autchkGrpno = this.autchkGrpno;
|
||||
|
||||
try {
|
||||
const response = await sysMgtApi.updateMenu(this.row);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.ModalClose();
|
||||
this.$parent.getMenuList();
|
||||
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '메뉴 저장 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.alertSysModalOpen.alertSysModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkFocus () {
|
||||
if (this.row.focusTaget === '1') {
|
||||
this.$refs._menuNm.focus();
|
||||
} else if (this.row.focusTaget === '2') {
|
||||
this.$refs._prntsMenuNo.focus();
|
||||
}else if(this.row.focusTaget === '3'){
|
||||
this.$refs._menuUrl.focus();
|
||||
}else if(this.row.focusTaget === '4'){
|
||||
this.$refs._menuOdrg.focus();
|
||||
}else if(this.row.focusTaget === '5'){
|
||||
this.$refs._useYn.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -6,6 +6,8 @@ import BatchList from '../views/BatchList'
|
||||
import BatchDetail from '../views/BatchDetail'
|
||||
import NotiList from '../views/NotiList'
|
||||
import WorkState from '../views/WorkState'
|
||||
import PartitionList from '../views/PartitionList'
|
||||
import MenuList from '../views/MenuList'
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -56,6 +58,18 @@ export default [
|
||||
component: WorkState,
|
||||
name: 'workState',
|
||||
meta: { public: false }
|
||||
},
|
||||
{
|
||||
path: '/sysMgt/partition',
|
||||
component: PartitionList,
|
||||
name: 'partitionList',
|
||||
meta: { public: false }
|
||||
},
|
||||
{
|
||||
path: '/sysMgt/menuList',
|
||||
component: MenuList,
|
||||
name: 'menuList',
|
||||
meta: { public: false }
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -97,6 +97,37 @@ const athMenuList = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/selectAuthMemuListForAddAuth', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const partitionCate = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/partitionCate', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const deletePartition = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/deletePartition', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const menuList = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/menuList', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const menuCate = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/menuCate', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const getMenuDetail = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/menuDetail', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const insertMenu = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/insertMenu', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const updateMenu = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/updateMenu', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
const deleteMenu = (params) => {
|
||||
return httpClient.post('/api/v1/bo/sysMgt/deleteMenu', params, { withCredentials: false })
|
||||
}
|
||||
|
||||
export default {
|
||||
insertAdmin,
|
||||
@@ -119,5 +150,13 @@ export default {
|
||||
notiList,
|
||||
setWorkState,
|
||||
svcCheckList,
|
||||
athMenuList
|
||||
athMenuList,
|
||||
partitionCate,
|
||||
deletePartition,
|
||||
menuList,
|
||||
menuCate,
|
||||
getMenuDetail,
|
||||
insertMenu,
|
||||
updateMenu,
|
||||
deleteMenu
|
||||
}
|
||||
|
||||
195
frontend/src/modules/sysMgt/views/MenuList.vue
Normal file
195
frontend/src/modules/sysMgt/views/MenuList.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<div class="contents">
|
||||
<div class="contents_wrap">
|
||||
<div class="top_wrap">
|
||||
<h3 class="title">메뉴 관리</h3>
|
||||
<p class="breadcrumb">운영 관리 > 메뉴 관리</p>
|
||||
</div>
|
||||
<div class="search_wrap">
|
||||
<div class="select_box">
|
||||
<label for="right" class="label">상위 메뉴 명</label>
|
||||
<select name="" id="right" v-model="params.searchText" @change="getMenuList">
|
||||
<option value="">전체</option>
|
||||
<option v-for="(option, i) in menuCate" v-bind:value="option.menuNo" v-bind:key="i">
|
||||
{{ option.menuNm }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="count">
|
||||
총 <span>{{ totalCnt }}</span
|
||||
>건
|
||||
</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue add" @click="menuRegPopOpen">메뉴 추가</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="10%" />
|
||||
<col width="15%" />
|
||||
<col width="15%" />
|
||||
<col width="5%" />
|
||||
<col width="5%" />
|
||||
<col width="17%" />
|
||||
<col width="5%" />
|
||||
<col width="13%" />
|
||||
<col width="15%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>메뉴번호</th>
|
||||
<th>메뉴명</th>
|
||||
<th>상위 메뉴명</th>
|
||||
<th>상태</th>
|
||||
<th>그룹</th>
|
||||
<th>URL</th>
|
||||
<th>메뉴순번</th>
|
||||
<th>등록일</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(option, i) in list" v-bind:key="i">
|
||||
<td>{{ option.menuNo }}</td>
|
||||
<td>{{ option.menuNm }}</td>
|
||||
<td>{{ option.prntsMenuNm }}</td>
|
||||
<td>{{ option.useYn }}</td>
|
||||
<td>{{ option.autchkGrpno }}</td>
|
||||
<td>{{ option.menuUrl }}</td>
|
||||
<td>{{ option.menuOdrg }}</td>
|
||||
<td>{{ option.regDt }}</td>
|
||||
<td class="two_btn_group">
|
||||
<button type="button" class="button grey" @click="menuModiPopOpen(option.menuNo)">수정</button>
|
||||
<button type="button" class="button white delete" @click="menuDelete(option.menuNo)">삭제</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<menu-pop ref="menuModal"></menu-pop>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import sysMgtApi from '../service/sysMgtApi.js';
|
||||
import commonModal from '@/components/modal/commonModal';
|
||||
import MenuPop from '../components/MenuPop';
|
||||
export default {
|
||||
name: 'menuList',
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
list: [],
|
||||
menuCate: [],
|
||||
totalCnt: '',
|
||||
popParam:{},
|
||||
params: {
|
||||
searchText: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
commonModal,
|
||||
MenuPop
|
||||
},
|
||||
created() {},
|
||||
destroyed() {},
|
||||
mounted() {
|
||||
this.setMenuCate();
|
||||
this.getMenuList();
|
||||
},
|
||||
methods: {
|
||||
async getMenuList() {
|
||||
try {
|
||||
const response = await sysMgtApi.menuList(this.params);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.list = result.data.list;
|
||||
this.totalCnt = result.data.list.length;
|
||||
} else {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '조회정보가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
} catch (err) {
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '실패 하였습니다.'
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
},
|
||||
async setMenuCate() {
|
||||
try {
|
||||
const response = await sysMgtApi.menuCate(this.params);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.menuCate = result.data.list;
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '상위 메뉴 목록 조회 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
menuRegPopOpen: function () {
|
||||
this.popParam.popType = 'reg';
|
||||
this.$refs.menuModal.ModalOpen(this.popParam);
|
||||
},
|
||||
menuModiPopOpen: function (menuNo) {
|
||||
this.popParam.popType = 'modi';
|
||||
this.popParam.menuNo = menuNo;
|
||||
this.$refs.menuModal.ModalOpen(this.popParam);
|
||||
},
|
||||
ModalOpen: function (target) {},
|
||||
|
||||
menuDelete(target) {
|
||||
const obj = this.list.filter(e => { if(e.menuNo == target) return true; else return false});
|
||||
|
||||
if(obj.length < 1) {
|
||||
this.row = {};
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '삭제 대상이 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}else{
|
||||
this.row.menuNo = target;
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = obj[0].menuNm + ' 메뉴를 삭제 하시겠습니까?';
|
||||
this.$refs.commmonModal.confirmModalOpen2(this.row);
|
||||
}
|
||||
},
|
||||
async deleteMenu() {
|
||||
try {
|
||||
let response = await sysMgtApi.deleteMenu(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.getMenuList();
|
||||
return;
|
||||
} else {
|
||||
this.row = {};
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
} catch (err) {
|
||||
this.row = {};
|
||||
this.row.title = '메뉴 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
},
|
||||
confirmCalbackFnc(props) {
|
||||
if (props.result) {
|
||||
this.deleteMenu();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
219
frontend/src/modules/sysMgt/views/PartitionList.vue
Normal file
219
frontend/src/modules/sysMgt/views/PartitionList.vue
Normal file
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div class="contents">
|
||||
<div class="contents_wrap">
|
||||
<div class="top_wrap">
|
||||
<h3 class="title">파티션 관리</h3>
|
||||
<p class="breadcrumb">운영 관리 > 파티션 관리</p>
|
||||
</div>
|
||||
<div class="search_wrap">
|
||||
<div class="select_box">
|
||||
<label for="right" class="label">테이블 명</label>
|
||||
<select name="" id="right" v-model="searchText" @change="search">
|
||||
<option value="">전체</option>
|
||||
<option v-for="(option, i) in partitionCate" v-bind:value="option.tableName" v-bind:key="i">
|
||||
{{ option.tableName }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="search_check">
|
||||
<input type="checkbox" id="right_check" value="Y" v-model="deleteListView" @change="search"/>
|
||||
<div class="label_group">
|
||||
<label for="right_check"></label>
|
||||
<label for="right_check">삭제 대상 목록</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="count">
|
||||
총 <span>{{ totalItems.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</span
|
||||
>건
|
||||
<div class="select_box NumberSe">
|
||||
<select name="" id="perpage" v-model="perPageCnt" @change="changePerPage()">
|
||||
<option v-for="option in options" v-bind:value="option.value" v-bind:key="option.value">
|
||||
{{ option.text }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title" v-if="deleteListView">
|
||||
3년 경과 된 삭제 대상 파티션 목록(※주의 삭제 시 복구 불가능)
|
||||
</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button white delete del" @click="rowDelete()" v-if="deleteListView">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table">
|
||||
<custom-grid
|
||||
ref="table"
|
||||
:totalItems="'totalItems'"
|
||||
:url="grid.url"
|
||||
:pagePerRows="grid.pagePerRows"
|
||||
:initialRequest="grid.initialRequest"
|
||||
:pagination="grid.pagination"
|
||||
:isCheckbox="grid.isCheckbox"
|
||||
:columns="grid.columns"
|
||||
:noDataStr="grid.noDataStr"
|
||||
:addCls="grid.addCls"
|
||||
:header="grid.headder"
|
||||
></custom-grid>
|
||||
</div>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import customGrid from '@/components/CustomGrid';
|
||||
import commonModal from '@/components/modal/commonModal';
|
||||
import sysMgtApi from '../service/sysMgtApi.js';
|
||||
|
||||
export default {
|
||||
name: 'partitionList',
|
||||
data() {
|
||||
return {
|
||||
isFocused: false,
|
||||
row: {},
|
||||
totalItems: 0,
|
||||
// 테이블 리스트 데이터
|
||||
perPageCnt: 50,
|
||||
options: [
|
||||
{ text: '20', value: 20 },
|
||||
{ text: '50', value: 50 },
|
||||
{ text: '100', value: 100 },
|
||||
],
|
||||
partitionCate: [],
|
||||
searchText: '',
|
||||
deleteListView:false,
|
||||
grid: {
|
||||
url: '/api/v1/bo/sysMgt/partitionList',
|
||||
pagePerRows: 50,
|
||||
pagination: true,
|
||||
isCheckbox: true, // true:첫번째 컬럼 앞에 체크박스 생성 / false:체크박스 제거
|
||||
initialRequest: false,
|
||||
addCls: 'box_OFvis',
|
||||
|
||||
columns: [
|
||||
{ name: 'no', header: 'No', align: 'center', width: '6%' },
|
||||
{ name: 'tableName', header: '테이블명', align: 'center', width: '25%' },
|
||||
{ name: 'partitionName', header: '파티션명', align: 'center', width: '30%' },
|
||||
{ name: 'partitionExp', header: '분할비교대상', align: 'center', width: '15%' },
|
||||
{ name: 'partitionDesc', header: '분할비교대값', align: 'center', width: '20%' },
|
||||
{ name: 'partitionOrdPos', header: '분할순번', align: 'center', width: '10%' },
|
||||
],
|
||||
noDataStr: '검색 결과가 없습니다.',
|
||||
params: {
|
||||
searchText: '',
|
||||
},
|
||||
excelHeader: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
customGrid: customGrid,
|
||||
commonModal
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
destroyed() {},
|
||||
mounted() {
|
||||
this.setPartitionCate();
|
||||
|
||||
let page = 1;
|
||||
// 페이지 정보 및 검색 조건
|
||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||
// store에 저장된 페이지 정보 및 검색 조건을 불러오기
|
||||
let isKeep = false;
|
||||
/*
|
||||
if (getCondition) {
|
||||
this.grid.pagePerRows = getCondition.perPage;
|
||||
this.grid.params = getCondition.params;
|
||||
page = getCondition.page;
|
||||
isKeep = true;
|
||||
}
|
||||
*/
|
||||
this.grid.pagePerRows = 50;
|
||||
page = 1;
|
||||
this.search(isKeep);
|
||||
},
|
||||
methods: {
|
||||
search: function (isKeep) {
|
||||
this.grid.params.searchText = this.searchText;
|
||||
this.grid.params.deleteListView = this.deleteListView;
|
||||
|
||||
this.$refs.table.search(this.grid.params, isKeep);
|
||||
this.sendStoreData();
|
||||
},
|
||||
sendStoreData: function () {
|
||||
const getP = this.$refs.table.getPagination();
|
||||
this.$store.commit('searchcondition/updateSearchCondition', {
|
||||
page: getP._currentPage,
|
||||
perPage: this.perPageCnt,
|
||||
params: this.grid.params,
|
||||
});
|
||||
|
||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||
},
|
||||
async setPartitionCate() {
|
||||
try {
|
||||
const response = await sysMgtApi.partitionCate(this.params);
|
||||
|
||||
const result = response.data;
|
||||
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.partitionCate = result.data.list;
|
||||
}
|
||||
|
||||
} catch(err){
|
||||
this.row.title = '파티션 목록 조회 실패';
|
||||
this.row.msg1 = err;
|
||||
this.$parent.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
rowDelete() {
|
||||
var chkList = this.$refs.table.checkedElementDatas();
|
||||
if (chkList.length == 0) {
|
||||
this.row.title = '파티션 관리';
|
||||
this.row.msg1 = '삭제대상을 체크 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}else{
|
||||
const param = chkList.map((row) => ({ partitionName: row.partitionName, tableName: row.tableName }));
|
||||
this.row.list = param;
|
||||
|
||||
this.row.title = '파티션 관리';
|
||||
this.row.msg1 = '삭제 하시겠습니까?';
|
||||
this.$refs.commmonModal.confirmModalOpen2(this.row);
|
||||
}
|
||||
},
|
||||
async deleteRow() {
|
||||
|
||||
try {
|
||||
let response = await sysMgtApi.deletePartition(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.$refs.table.reloadData();
|
||||
return;
|
||||
}
|
||||
this.row.title = '파티션 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
} catch (err) {
|
||||
this.row.title = '파티션 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
},
|
||||
confirmCalbackFnc(props) {
|
||||
if (props.result) {
|
||||
this.deleteRow();
|
||||
}
|
||||
},
|
||||
changePerPage: function () {
|
||||
// 페이지당 조회할 개수
|
||||
this.grid.pagePerRows = this.perPageCnt;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -177,6 +177,8 @@ router.beforeEach((to, from, next) => {
|
||||
nextUrl == '/sysMgt/authAdd' ||
|
||||
nextUrl == '/sysMgt/authModify' ||
|
||||
nextUrl == '/sysMgt/authModify' ||
|
||||
nextUrl == '/sysMgt/partition' ||
|
||||
nextUrl == '/sysMgt/menuList' ||
|
||||
nextUrl.indexOf('/sysMgt/batchDetail') > -1
|
||||
) {
|
||||
for (var i = 0; i < menuUrls.length; i++) {
|
||||
|
||||
@@ -507,7 +507,176 @@ public class SysMgtController {
|
||||
return sysService.selectAuthMemuListForAddAuth();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 목록 조회
|
||||
* @param partitionListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "partitionList", notes = "파티션 목록 조회")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/partitionList", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public PartitionListResDto partitionList(@RequestBody @Valid PartitionListReqDto partitionListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new PartitionListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return sysService.partitionList(partitionListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 조회를 위한 테이블 명의 카테고리(조회용 셀렉트 박스)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "partitionCate", notes = "파티션 테이블 목록 조회")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/partitionCate", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public PartitionListResDto partitionCate() {
|
||||
return sysService.partitionCate();
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 삭제 실행
|
||||
* @param deletePartitionReqDto
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "deletePartition", notes = "관리자 삭제")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/deletePartition", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public DeletePartitionResDto deletePartition(@RequestBody @Valid DeletePartitionReqDto deletePartitionReqDto,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new DeletePartitionResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return sysService.deletePartition(deletePartitionReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 목록
|
||||
* @param menuListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "menuList", notes = "메뉴 목록 조회")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/menuList", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto menuList(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return sysService.menuList(menuListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 상위 메뉴 목록
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "menuCate", notes = "메뉴 상위 목록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/menuCate", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto menuCate() {
|
||||
return sysService.menuCate();
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 상세
|
||||
* @param menuListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "menuDetail", notes = "메뉴 상위 목록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/menuDetail", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto menuDetail(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return sysService.menuDetail(menuListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 입력
|
||||
* @param menuListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "insertMenu", notes = "메뉴 상위 목록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/insertMenu", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto insertMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return sysService.insertMenu(menuListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 삭제
|
||||
* @param menuListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "deleteMenu", notes = "메뉴 상위 목록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/deleteMenu", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto deleteMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return sysService.deleteMenu(menuListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 수정
|
||||
* @param menuListReqDto
|
||||
* @param bindingResult
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "updateMenu", notes = "메뉴 상위 목록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/updateMenu", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public MenuListResDto updateMenu(@RequestBody @Valid MenuListReqDto menuListReqDto, BindingResult bindingResult, HttpServletResponse response) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
return sysService.updateMenu(menuListReqDto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -64,5 +64,34 @@ public interface SysMgtMapper {
|
||||
List<AuthMenuUpper> selectAuthMemuUpperList(); //권한 추가를 위한 메뉴 조회
|
||||
|
||||
List<AuthMenu> selectAuthMemuChdList(AuthMenuUpper authMenuUpper); //권한 추가를 위한 메뉴 조회
|
||||
|
||||
|
||||
int selectPartitionTotalCnt(PartitionListReqDto partitionListReqDto);
|
||||
|
||||
List<Partition> selectPartitionList(PartitionListReqDto partitionListReqDto);
|
||||
|
||||
List<Partition> selectPartitionCate();
|
||||
|
||||
DeletePartition selectDeletePartition(DeletePartition deletePartition);
|
||||
|
||||
int deletePartition(DeletePartition deletePartition);
|
||||
|
||||
int selectMenuTotalCnt(MenuListReqDto menuListReqDto);
|
||||
|
||||
List<Menu> selectMenuList(MenuListReqDto menuListReqDto);
|
||||
|
||||
List<Menu> selectMenuCate();
|
||||
|
||||
Menu selectMenuDetail(MenuListReqDto menuListReqDto);
|
||||
|
||||
int insertMenu(MenuListReqDto menuListReqDto);
|
||||
|
||||
String getMenuNo();
|
||||
|
||||
int deleteMenu(MenuListReqDto menuListReqDto);
|
||||
|
||||
int updateMenuOdrg(MenuListReqDto menuListReqDto);
|
||||
|
||||
int updateMenu(MenuListReqDto menuListReqDto);
|
||||
|
||||
int deleteAuthMenuFromMenu(MenuListReqDto menuListReqDto);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto;
|
||||
import kr.co.uplus.ez.api.sysMgt.dto.*;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import kr.co.uplus.ez.common.data.UserAuthCode;
|
||||
import kr.co.uplus.ez.common.utils.EncryptionUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -18,6 +19,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -792,4 +795,279 @@ public class SysMgtService {
|
||||
|
||||
return new AuthMenuResDto(ApiResponseCode.SUCCESS, authMenuData);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 목록 조회
|
||||
* @param partitionListReqDto
|
||||
* @return
|
||||
*/
|
||||
public PartitionListResDto partitionList(PartitionListReqDto partitionListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
String nowPage = String.valueOf(partitionListReqDto.getPage());
|
||||
int totalCnt = sysMgtMapper.selectPartitionTotalCnt(partitionListReqDto);
|
||||
|
||||
if(totalCnt == 0) {
|
||||
Paging paging = new Paging();
|
||||
paging.setPage(nowPage);
|
||||
paging.setTotalCnt(String.valueOf(totalCnt));
|
||||
PartitionListRes partitionListRes = new PartitionListRes();
|
||||
partitionListRes.setList(new ArrayList<>());
|
||||
partitionListRes.setPaging(paging);
|
||||
return new PartitionListResDto(ApiResponseCode.CM_NOT_FOUND, partitionListRes);
|
||||
}
|
||||
|
||||
int page = partitionListReqDto.getPage();
|
||||
int pagePerRows = partitionListReqDto.getPagePerRows();
|
||||
page = (page -1) * pagePerRows;
|
||||
partitionListReqDto.setPage(page);
|
||||
|
||||
List<Partition> partitions = sysMgtMapper.selectPartitionList(partitionListReqDto);
|
||||
|
||||
Paging paging = new Paging();
|
||||
paging.setPage(nowPage);
|
||||
paging.setTotalCnt(String.valueOf(totalCnt));
|
||||
|
||||
PartitionListRes partitionListRes = new PartitionListRes();
|
||||
partitionListRes.setList(partitions);
|
||||
partitionListRes.setPaging(paging);
|
||||
|
||||
return new PartitionListResDto(ApiResponseCode.SUCCESS, partitionListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 조회를 위한 테이블 명의 카테고리(조회용 셀렉트 박스)
|
||||
* @return
|
||||
*/
|
||||
public PartitionListResDto partitionCate() {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
List<Partition> partitions = sysMgtMapper.selectPartitionCate();
|
||||
|
||||
PartitionListRes partitionListRes = new PartitionListRes();
|
||||
partitionListRes.setList(partitions);
|
||||
|
||||
return new PartitionListResDto(ApiResponseCode.SUCCESS, partitionListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 삭제 대상(3년 경과) 파티션 삭제 실행
|
||||
* @param deletePartitionReqDto
|
||||
* @return
|
||||
*/
|
||||
public DeletePartitionResDto deletePartition(DeletePartitionReqDto deletePartitionReqDto) {
|
||||
|
||||
SysMgtMapper sysMgtMapper = sqlSessionMaster.getMapper(SysMgtMapper.class);
|
||||
|
||||
try {
|
||||
|
||||
if(deletePartitionReqDto.getList() == null || deletePartitionReqDto.getList().size() == 0) {
|
||||
return new DeletePartitionResDto(ApiResponseCode.CM_MISSING_REQUIRED);
|
||||
}
|
||||
|
||||
for(DeletePartition partition : deletePartitionReqDto.getList()) {
|
||||
|
||||
DeletePartition target = sysMgtMapper.selectDeletePartition(partition);
|
||||
|
||||
if(target == null) {
|
||||
return new DeletePartitionResDto(ApiResponseCode.CM_NOT_FOUND);
|
||||
}
|
||||
|
||||
sysMgtMapper.deletePartition(target);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return new DeletePartitionResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
DeletePartitionResDto result = new DeletePartitionResDto(ApiResponseCode.SUCCESS);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 목록
|
||||
* @param menuListReqDto
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto menuList(MenuListReqDto menuListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
int totalCnt = sysMgtMapper.selectMenuTotalCnt(menuListReqDto);
|
||||
|
||||
if(totalCnt == 0) {
|
||||
|
||||
MenuListRes menuListRes = new MenuListRes();
|
||||
menuListRes.setList(new ArrayList<>());
|
||||
return new MenuListResDto(ApiResponseCode.CM_NOT_FOUND, menuListRes);
|
||||
}
|
||||
|
||||
|
||||
List<Menu> menus = sysMgtMapper.selectMenuList(menuListReqDto);
|
||||
|
||||
MenuListRes menuListRes = new MenuListRes();
|
||||
menuListRes.setList(menus);
|
||||
menuListRes.setTotalCnt(totalCnt);
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 상위 메뉴 목록
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto menuCate() {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
List<Menu> menus = sysMgtMapper.selectMenuCate();
|
||||
|
||||
MenuListRes menuListRes = new MenuListRes();
|
||||
menuListRes.setList(menus);
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 상세(수정 시 사용)
|
||||
* @param menuListReqDto
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto menuDetail(MenuListReqDto menuListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto);
|
||||
|
||||
MenuListRes menuListRes = new MenuListRes();
|
||||
menuListRes.setData(menu);
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS, menuListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 입력
|
||||
* @param menuListReqDto
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto insertMenu(MenuListReqDto menuListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
|
||||
menuListReqDto.setRegId(userDetails.getUsername());
|
||||
menuListReqDto.setChgId(userDetails.getUsername());
|
||||
|
||||
String menuNo = sysMgtMapper.getMenuNo();
|
||||
|
||||
menuListReqDto.setMenuNo(menuNo);
|
||||
|
||||
int result = sysMgtMapper.insertMenu(menuListReqDto);
|
||||
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
HashMap<String, Object> authMenuParamMap = new HashMap<String, Object>();
|
||||
authMenuParamMap.put("authCd", UserAuthCode.SUPER_ADMIN_USER.getValue());
|
||||
authMenuParamMap.put("regId", menuListReqDto.getRegId());
|
||||
authMenuParamMap.put("menuNo", menuListReqDto.getMenuNo());
|
||||
|
||||
result = sysMgtMapper.insertAuthMenu(authMenuParamMap);
|
||||
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 삭제
|
||||
* @param menuListReqDto
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto deleteMenu(MenuListReqDto menuListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
|
||||
menuListReqDto.setChgId(userDetails.getUsername());
|
||||
|
||||
|
||||
Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto);
|
||||
|
||||
int result = sysMgtMapper.deleteMenu(menuListReqDto);
|
||||
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
menuListReqDto.setPrntsMenuNo(menu.getPrntsMenuNo());
|
||||
menuListReqDto.setMenuOdrg(menu.getMenuOdrg());
|
||||
|
||||
if(!menu.getMenuOdrg().equals(String.valueOf(menu.getMaxMenuOdrg()))) {
|
||||
result = sysMgtMapper.updateMenuOdrg(menuListReqDto);
|
||||
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
sysMgtMapper.deleteAuthMenuFromMenu(menuListReqDto);
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 18.
|
||||
* auth : Jeon
|
||||
* desc : 메뉴 수정
|
||||
* @param menuListReqDto
|
||||
* @return
|
||||
*/
|
||||
public MenuListResDto updateMenu(MenuListReqDto menuListReqDto) {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
|
||||
menuListReqDto.setChgId(userDetails.getUsername());
|
||||
|
||||
|
||||
Menu menu = sysMgtMapper.selectMenuDetail(menuListReqDto);
|
||||
menuListReqDto.setPrntsMenuNo(menu.getPrntsMenuNo());
|
||||
menuListReqDto.setOldMenuOdrg(menu.getMenuOdrg());
|
||||
|
||||
int result = 0;
|
||||
|
||||
if(!(menuListReqDto.getMenuOdrg().equals(menuListReqDto.getOldMenuOdrg()))) {
|
||||
result = sysMgtMapper.updateMenuOdrg(menuListReqDto);
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
result = sysMgtMapper.updateMenu(menuListReqDto);
|
||||
if(result < 1 ) {
|
||||
return new MenuListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new MenuListResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeletePartition implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "테이블명", name = "테이블명", dataType = "String")
|
||||
private String tableName;
|
||||
|
||||
@ApiModelProperty(example = "테이블스키마", name = "테이블스키마", dataType = "String")
|
||||
private String tableSchema;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "파티션명", name = "파티션명", dataType = "String")
|
||||
private String partitionName;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeletePartitionReqDto implements Serializable {
|
||||
|
||||
// 삭제 대상 List.
|
||||
private List<DeletePartition> list;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeletePartitionResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public DeletePartitionResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public DeletePartitionResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public DeletePartitionResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
32
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Menu.java
Normal file
32
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Menu.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class Menu implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "메뉴번호", name = "메뉴번호", dataType = "String")
|
||||
private String menuNo;
|
||||
@ApiModelProperty(example = "메뉴명", name = "메뉴명", dataType = "String")
|
||||
private String menuNm;
|
||||
@ApiModelProperty(example = "상위 메뉴명", name = "상위 메뉴명", dataType = "String")
|
||||
private String prntsMenuNm;
|
||||
@ApiModelProperty(example = "상위 메뉴번호", name = "상위 메뉴번호", dataType = "String")
|
||||
private String prntsMenuNo;
|
||||
@ApiModelProperty(example = "URL", name = "URL", dataType = "String")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty(example = "메뉴순번", name = "메뉴순번", dataType = "String")
|
||||
private String menuOdrg;
|
||||
@ApiModelProperty(example = "상태", name = "상태", dataType = "String")
|
||||
private String useYn;
|
||||
@ApiModelProperty(example = "입력일자", name = "입력일자", dataType = "String")
|
||||
private String regDt;
|
||||
@ApiModelProperty(example = "마지막메뉴순번", name = "마지막메뉴순번", dataType = "String")
|
||||
private int maxMenuOdrg;
|
||||
@ApiModelProperty(example = "그룹", name = "그룹", dataType = "String")
|
||||
private String autchkGrpno;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class MenuListReqDto implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "검색값", name = "검색값", dataType = "String")
|
||||
private String searchText;
|
||||
|
||||
@ApiModelProperty(example = "메뉴번호", name = "메뉴번호", dataType = "String")
|
||||
private String menuNo;
|
||||
|
||||
@ApiModelProperty(example = "메뉴명", name = "메뉴명", dataType = "String")
|
||||
private String menuNm;
|
||||
|
||||
@ApiModelProperty(example = "URL", name = "URL", dataType = "String")
|
||||
private String menuUrl;
|
||||
|
||||
@ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
@ApiModelProperty(example = "상위 메뉴 번호", name = "상위 메뉴 번호", dataType = "String")
|
||||
private String prntsMenuNo;
|
||||
|
||||
@ApiModelProperty(example = "메뉴순번", name = "메뉴순번", dataType = "String")
|
||||
private String menuOdrg;
|
||||
|
||||
@ApiModelProperty(example = "변경전 메뉴순번", name = "변경전 메뉴순번", dataType = "String")
|
||||
private String oldMenuOdrg;
|
||||
|
||||
@ApiModelProperty(example = "그룹", name = "그룹", dataType = "String")
|
||||
private String autchkGrpno;
|
||||
|
||||
@ApiModelProperty(example = "입력자", name = "입력자", dataType = "String")
|
||||
private String regId;
|
||||
|
||||
@ApiModelProperty(example = "수정자", name = "수정자", dataType = "String")
|
||||
private String chgId;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int")
|
||||
private int pagePerRows;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int")
|
||||
private int page;
|
||||
|
||||
}
|
||||
16
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListRes.java
Normal file
16
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/MenuListRes.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class MenuListRes implements Serializable{
|
||||
|
||||
private int totalCnt;
|
||||
private List<Menu> list;
|
||||
private Menu data;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class MenuListResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private MenuListRes data;
|
||||
|
||||
public MenuListResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public MenuListResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public MenuListResDto(ApiResponseCode returnStr, MenuListRes data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
25
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Partition.java
Normal file
25
src/main/java/kr/co/uplus/ez/api/sysMgt/dto/Partition.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class Partition implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "리스트번호", name = "리스트번호", dataType = "String")
|
||||
private Integer no;
|
||||
@ApiModelProperty(example = "테이블명", name = "테이블명", dataType = "String")
|
||||
private String tableName;
|
||||
@ApiModelProperty(example = "파티션명", name = "파티션명", dataType = "String")
|
||||
private String partitionName;
|
||||
@ApiModelProperty(example = "분할비교대상", name = "분할비교대상", dataType = "String")
|
||||
private String partitionExp;
|
||||
@ApiModelProperty(example = "분할비교값", name = "분할비교값", dataType = "String")
|
||||
private String partitionDesc;
|
||||
@ApiModelProperty(example = "분할순번", name = "분할순번", dataType = "String")
|
||||
private String partitionOrdPos;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class PartitionListReqDto implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "검색값", name = "검색값", dataType = "String")
|
||||
private String searchText;
|
||||
|
||||
@ApiModelProperty(example = "조회 종류", name = "조회 종류", dataType = "String")
|
||||
private String deleteListView;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int")
|
||||
private int pagePerRows;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int")
|
||||
private int page;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class PartitionListRes implements Serializable{
|
||||
|
||||
private Paging paging;
|
||||
private List<Partition> list;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class PartitionListResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private PartitionListRes data;
|
||||
|
||||
public PartitionListResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public PartitionListResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public PartitionListResDto(ApiResponseCode returnStr, PartitionListRes data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
30
src/main/java/kr/co/uplus/ez/common/data/UserAuthCode.java
Normal file
30
src/main/java/kr/co/uplus/ez/common/data/UserAuthCode.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package kr.co.uplus.ez.common.data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum UserAuthCode {
|
||||
SUPER_ADMIN_USER("1001");
|
||||
|
||||
private String value;
|
||||
private String desc;
|
||||
private UserAuthCode(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
private static final Map<String, UserAuthCode> lookup = new HashMap<String, UserAuthCode>();
|
||||
static {
|
||||
for (UserAuthCode e : UserAuthCode.values()) {
|
||||
lookup.put(e.getValue(), e);
|
||||
}
|
||||
}
|
||||
public static UserAuthCode find(String value) {
|
||||
return lookup.get(value);
|
||||
}
|
||||
}
|
||||
@@ -551,4 +551,263 @@
|
||||
ORDER BY A.MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
<select id="selectPartitionTotalCnt" parameterType="kr.co.uplus.ez.api.sysMgt.dto.PartitionListReqDto" resultType="int">
|
||||
/* sysMgt-mapper.xml(selectPartitionTotalCnt) */
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.PARTITIONS
|
||||
<include refid="partitionListCondition"></include>
|
||||
</select>
|
||||
|
||||
<select id="selectPartitionList" parameterType="kr.co.uplus.ez.api.sysMgt.dto.PartitionListReqDto" resultType="kr.co.uplus.ez.api.sysMgt.dto.Partition">
|
||||
/* sysMgt-mapper.xml(selectPartitionList) */
|
||||
SELECT
|
||||
@ROWNUM := @ROWNUM + 1 AS NO
|
||||
,A.*
|
||||
FROM(
|
||||
SELECT
|
||||
TABLE_NAME
|
||||
,TABLE_SCHEMA
|
||||
,PARTITION_NAME
|
||||
,PARTITION_EXPRESSION AS PARTITION_EXP
|
||||
,PARTITION_DESCRIPTION AS PARTITION_DESC
|
||||
,PARTITION_ORDINAL_POSITION AS PARTITION_ORD_POS
|
||||
FROM INFORMATION_SCHEMA.PARTITIONS
|
||||
<include refid="partitionListCondition"></include>
|
||||
LIMIT #{page}, #{pagePerRows}) A,
|
||||
( SELECT @ROWNUM := #{page} ) AS R
|
||||
</select>
|
||||
|
||||
<sql id="partitionListCondition">
|
||||
WHERE PARTITION_NAME IS NOT NULL
|
||||
AND PARTITION_DESCRIPTION IS NOT NULL
|
||||
AND PARTITION_DESCRIPTION IS NOT NULL
|
||||
AND (SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$' OR SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}0[0-9]|^2[0-9]{3}1[0-2]')
|
||||
<if test="deleteListView == 'true'">
|
||||
AND STR_TO_DATE(IF(SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$',CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'0101'),CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'01')),'%Y%m%d') <![CDATA[ < ]]> DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -3 YEAR),'%Y%m%d')
|
||||
</if>
|
||||
<if test="searchText != null and searchText != ''">
|
||||
AND TABLE_NAME = #{searchText}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectPartitionCate" resultType="kr.co.uplus.ez.api.sysMgt.dto.Partition">
|
||||
/* sysMgt-mapper.xml(selectPartitionCate) */
|
||||
SELECT
|
||||
TABLE_NAME
|
||||
FROM INFORMATION_SCHEMA.PARTITIONS
|
||||
WHERE PARTITION_NAME IS NOT NULL
|
||||
AND PARTITION_DESCRIPTION IS NOT NULL
|
||||
AND (SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$' OR SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}0[0-9]|^2[0-9]{3}1[0-2]')
|
||||
GROUP BY TABLE_NAME
|
||||
ORDER BY TABLE_NAME ASC
|
||||
</select>
|
||||
|
||||
<select id="selectDeletePartition" parameterType="kr.co.uplus.ez.api.sysMgt.dto.DeletePartition" resultType="kr.co.uplus.ez.api.sysMgt.dto.DeletePartition">
|
||||
/* sysMgt-mapper.xml(selectDeletePartition) */
|
||||
SELECT
|
||||
TABLE_NAME
|
||||
,TABLE_SCHEMA
|
||||
,PARTITION_NAME
|
||||
FROM INFORMATION_SCHEMA.PARTITIONS
|
||||
WHERE PARTITION_NAME IS NOT NULL
|
||||
AND PARTITION_DESCRIPTION IS NOT NULL
|
||||
AND (SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$' OR SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}0[0-9]|^2[0-9]{3}1[0-2]')
|
||||
AND STR_TO_DATE(IF(SUBSTRING_INDEX(PARTITION_NAME,'_',-1) REGEXP '^2[0-9]{3}$',CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'0101'),CONCAT(SUBSTRING_INDEX(PARTITION_NAME,'_',-1),'01')),'%Y%m%d') <![CDATA[ < ]]> DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -3 YEAR),'%Y%m%d')
|
||||
AND TABLE_NAME = #{tableName}
|
||||
AND PARTITION_NAME = #{partitionName}
|
||||
</select>
|
||||
|
||||
<update id="deletePartition" parameterType="kr.co.uplus.ez.api.sysMgt.dto.DeletePartition">
|
||||
/* sysMgt-mapper.xml(deletePartition) */
|
||||
ALTER TABLE ${tableSchema}.${tableName} DROP PARTITION ${partitionName}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectMenuTotalCnt" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto" resultType="int">
|
||||
/* sysMgt-mapper.xml(selectMenuTotalCnt) */
|
||||
SELECT
|
||||
COUNT(A.MENU_NO)
|
||||
FROM hubez_admin.EZ_ADM_MENU A
|
||||
,(
|
||||
SELECT
|
||||
MENU_NO
|
||||
, MENU_NM
|
||||
, MENU_ODRG
|
||||
FROM hubez_admin.EZ_ADM_MENU
|
||||
WHERE MENU_LVL = '1'
|
||||
) B
|
||||
WHERE A.PRNTS_MENU_NO = B.MENU_NO
|
||||
AND A.MENU_LVL = '2'
|
||||
<include refid="menuListCondition"></include>
|
||||
ORDER BY B.MENU_ODRG ASC, A.MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
<select id="selectMenuList" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto" resultType="kr.co.uplus.ez.api.sysMgt.dto.Menu">
|
||||
/* sysMgt-mapper.xml(selectMenuList) */
|
||||
SELECT
|
||||
A.*
|
||||
FROM (
|
||||
SELECT
|
||||
A.MENU_NO
|
||||
,A.MENU_NM
|
||||
,B.MENU_NM AS PRNTS_MENU_NM
|
||||
,A.USE_YN
|
||||
,A.MENU_URL
|
||||
,A.MENU_ODRG
|
||||
,A.AUTCHK_GRPNO
|
||||
,B.MENU_ODRG AS PRNTS_MENU_ODRG
|
||||
,DATE_FORMAT(A.REG_DT,'%Y-%m-%d %H:%i:%s') AS REG_DT
|
||||
FROM hubez_admin.EZ_ADM_MENU A
|
||||
,(
|
||||
SELECT
|
||||
MENU_NO
|
||||
, MENU_NM
|
||||
, MENU_ODRG
|
||||
FROM hubez_admin.EZ_ADM_MENU
|
||||
WHERE MENU_LVL = '1'
|
||||
) B
|
||||
WHERE A.PRNTS_MENU_NO = B.MENU_NO
|
||||
AND A.MENU_LVL = '2'
|
||||
<include refid="menuListCondition"></include>
|
||||
) A
|
||||
ORDER BY A.PRNTS_MENU_ODRG ASC, A.MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
<sql id="menuListCondition">
|
||||
<if test="searchText != null and searchText != ''">
|
||||
AND A.PRNTS_MENU_NO = #{searchText}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuCate" resultType="kr.co.uplus.ez.api.sysMgt.dto.Menu">
|
||||
/* sysMgt-mapper.xml(selectMenuCate) */
|
||||
SELECT
|
||||
MENU_NO
|
||||
, MENU_NM
|
||||
, MENU_ODRG
|
||||
FROM hubez_admin.EZ_ADM_MENU
|
||||
WHERE MENU_LVL = '1'
|
||||
ORDER BY MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
<select id="selectMenuDetail" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto" resultType="kr.co.uplus.ez.api.sysMgt.dto.Menu">
|
||||
/* sysMgt-mapper.xml(selectMenuDetail) */
|
||||
SELECT
|
||||
A.MENU_NO
|
||||
,A.MENU_NM
|
||||
,A.MENU_URL
|
||||
,A.USE_YN
|
||||
,A.MENU_ODRG
|
||||
,A.PRNTS_MENU_NO
|
||||
,A.AUTCHK_GRPNO
|
||||
,MAX(B.MENU_ODRG) AS MAX_MENU_ODRG
|
||||
FROM hubez_admin.EZ_ADM_MENU A, hubez_admin.EZ_ADM_MENU B
|
||||
WHERE A.PRNTS_MENU_NO = B.PRNTS_MENU_NO
|
||||
AND A.MENU_NO = #{menuNo}
|
||||
GROUP BY A.MENU_NO
|
||||
</select>
|
||||
|
||||
<select id="getMenuNo" resultType="String">
|
||||
/* sysMgt-mapper.xml(getMenuNo) */
|
||||
SELECT (MAX(MENU_NO)+1) AS MENU_NO FROM hubez_admin.EZ_ADM_MENU A
|
||||
</select>
|
||||
|
||||
<insert id="insertMenu" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto">
|
||||
/* sysMgt-mapper.xml(insertMenu) */
|
||||
INSERT INTO hubez_admin.EZ_ADM_MENU
|
||||
(
|
||||
MENU_NO
|
||||
, PRNTS_MENU_NO
|
||||
, MENU_NM
|
||||
, MENU_ODRG
|
||||
, USE_YN
|
||||
, MENU_LVL
|
||||
, MENU_URL
|
||||
<if test="autchkGrpno != null and autchkGrpno != ''">
|
||||
, AUTCHK_GRPNO
|
||||
</if>
|
||||
, REG_ID
|
||||
, REG_DT
|
||||
, CHG_ID
|
||||
, CHG_DT
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{menuNo}
|
||||
, #{prntsMenuNo}
|
||||
, #{menuNm}
|
||||
, (SELECT MAX(MENU_ODRG)+1 FROM hubez_admin.EZ_ADM_MENU A WHERE PRNTS_MENU_NO = #{prntsMenuNo})
|
||||
, #{useYn}
|
||||
, 2
|
||||
, #{menuUrl}
|
||||
<if test="autchkGrpno != null and autchkGrpno != ''">
|
||||
, #{autchkGrpno}
|
||||
</if>
|
||||
, #{regId}
|
||||
, NOW()
|
||||
, #{regId}
|
||||
, NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMenu" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto">
|
||||
/* sysMgt-mapper.xml(deleteMenu) */
|
||||
DELETE FROM hubez_admin.EZ_ADM_MENU
|
||||
WHERE MENU_NO = #{menuNo}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAuthMenuFromMenu" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto">
|
||||
/* sysMgt-mapper.xml(deleteAuthMenuFromMenu) */
|
||||
DELETE FROM hubez_admin.EZ_ADM_AUTMENU
|
||||
WHERE MENU_NO = #{menuNo}
|
||||
</delete>
|
||||
|
||||
<update id="updateMenuOdrg" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto">
|
||||
/* sysMgt-mapper.xml(updateMenuOdrg) */
|
||||
UPDATE hubez_admin.EZ_ADM_MENU
|
||||
SET
|
||||
<choose>
|
||||
<when test="oldMenuOdrg != null and oldMenuOdrg != ''">
|
||||
<choose>
|
||||
<when test="oldMenuOdrg lt menuOdrg">
|
||||
MENU_ODRG = IF(MENU_ODRG <![CDATA[ <= ]]> #{menuOdrg} AND MENU_ODRG <![CDATA[ > ]]> #{oldMenuOdrg}, MENU_ODRG-1, IF(MENU_ODRG = #{oldMenuOdrg} , #{menuOdrg},MENU_ODRG))
|
||||
</when>
|
||||
<when test="oldMenuOdrg gt menuOdrg">
|
||||
MENU_ODRG = IF(MENU_ODRG <![CDATA[ < ]]> #{oldMenuOdrg} AND MENU_ODRG <![CDATA[ >= ]]> #{menuOdrg}, MENU_ODRG+1, IF(MENU_ODRG = #{oldMenuOdrg} , #{menuOdrg},MENU_ODRG))
|
||||
</when>
|
||||
</choose>
|
||||
</when>
|
||||
<otherwise>
|
||||
MENU_ODRG = MENU_ODRG - 1
|
||||
</otherwise>
|
||||
</choose>
|
||||
,CHG_ID = #{chgId}
|
||||
,CHG_DT = NOW()
|
||||
WHERE PRNTS_MENU_NO = #{prntsMenuNo}
|
||||
<if test="!(oldMenuOdrg != null and oldMenuOdrg != '')">
|
||||
AND MENU_ODRG <![CDATA[ > ]]> #{menuOdrg}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="updateMenu" parameterType="kr.co.uplus.ez.api.sysMgt.dto.MenuListReqDto">
|
||||
/* sysMgt-mapper.xml(updateMenu) */
|
||||
UPDATE hubez_admin.EZ_ADM_MENU
|
||||
SET
|
||||
MENU_NM = #{menuNm}
|
||||
,MENU_URL = #{menuUrl}
|
||||
,USE_YN = #{useYn}
|
||||
<choose>
|
||||
<when test="autchkGrpno != null and autchkGrpno != ''">
|
||||
,AUTCHK_GRPNO = #{autchkGrpno}
|
||||
</when>
|
||||
<otherwise>
|
||||
,AUTCHK_GRPNO = null
|
||||
</otherwise>
|
||||
</choose>
|
||||
,CHG_ID = #{chgId}
|
||||
,CHG_DT = NOW()
|
||||
WHERE MENU_NO = #{menuNo}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user