提交 d165d33b 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 43cd0bcd
...@@ -7,6 +7,7 @@ import * as mutations from './mutations'; ...@@ -7,6 +7,7 @@ import * as mutations from './mutations';
import * as getters from './getters'; import * as getters from './getters';
import viewaction from './modules/view-action' import viewaction from './modules/view-action'
import unifiedresource from './modules/unified-resource'
const state = { const state = {
...rootstate ...rootstate
...@@ -20,7 +21,8 @@ const store = new Vuex.Store({ ...@@ -20,7 +21,8 @@ const store = new Vuex.Store({
mutations, mutations,
getters, getters,
modules: { modules: {
viewaction viewaction,
unifiedresource
}, },
}); });
......
/**
* 提交统一资源数据
*
* @param param0
* @param data
*/
export const commitResourceData = ({ commit, state }: { commit: any, state: any }, { unires, enablepermissionvalid }: { unires: Array<any>, enablepermissionvalid: boolean }) => {
if(unires && unires.length > 0){
commit('setResourceData', unires);
}
if(enablepermissionvalid){
commit('setEnablePermissionValid', enablepermissionvalid);
}
}
\ No newline at end of file
/**
* 判断指定统一资源是否存在
*
* @param state
*/
export const getResourceData = (state: any) => (resourcetag: string) => {
let itemIndex: any = state.resourceData.findIndex((obj: any, objIndex: any, objs: any) => {
return Object.is(obj.unirescode, resourcetag);
})
return itemIndex === -1 ? false : true;
}
/**
* 获取是否开启权限认证
*
* @param state
*/
export const getEnablePermissionValid = (state: any) => {
return state.enablePermissionValid;
}
\ No newline at end of file
import { resourcestate } from './state';
import * as actions from './actions';
import * as mutations from './mutations';
import * as getters from './getters';
const state = {
...resourcestate
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
}
\ No newline at end of file
/**
* 设置统一资源数据
*
* @param state
* @param resourceArray
*/
export const setResourceData = (state: any, resourceArray:Array<any>) => {
if(resourceArray && resourceArray.length === 0){
return;
}
state.resourceData = resourceArray;
}
/**
* 设置是否开启权限认证
*
* @param state
* @param resourceArray
*/
export const setEnablePermissionValid = (state: any, enablepermissionvalid:boolean) => {
state.enablePermissionValid = enablepermissionvalid;
}
/**
* 所有资源状态
*/
export const resourcestate: any = {
// 统一资源数据
resourceData: [],
// 是否开启权限认证
enablePermissionValid: false
}
\ No newline at end of file
...@@ -206,6 +206,15 @@ ...@@ -206,6 +206,15 @@
padding-bottom: 16px; padding-bottom: 16px;
} }
} }
.view-container.degridview, .view-container.degridview9, .view-container.dewfgridview{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
}
}
}
/*** END:多数据视图属性布局 ***/ /*** END:多数据视图属性布局 ***/
// 看板视图,卡片模式 // 看板视图,卡片模式
......
...@@ -56,6 +56,8 @@ export class AuthGuard { ...@@ -56,6 +56,8 @@ export class AuthGuard {
const { data }: { data: any } = response; const { data }: { data: any } = response;
if (data) { if (data) {
router.app.$store.commit('addAppData', data); router.app.$store.commit('addAppData', data);
// 提交统一资源数据
router.app.$store.dispatch('unifiedresource/commitResourceData', data);
} }
} }
resolve(true); resolve(true);
......
...@@ -449,8 +449,10 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -449,8 +449,10 @@ export default class MainBase extends Vue implements ControlInterface {
if (Object.keys(item).length === 0) { if (Object.keys(item).length === 0) {
return; return;
} }
if(!item.hidden){
this.click(item); this.click(item);
} }
}
/** /**
* 计算菜单选中项 * 计算菜单选中项
...@@ -675,11 +677,41 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -675,11 +677,41 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof Main * @memberof Main
*/ */
public load(data: any) { public load(data: any) {
this.handleMenusResource(this.menuMode.getAppMenuItems());
}
/**
* 通过统一资源标识计算菜单
*
* @param {*} data
* @memberof Main
*/
public handleMenusResource(inputMenus:Array<any>){
if(this.$store.getters['unifiedresource/getEnablePermissionValid']){
this.computedEffectiveMenus(inputMenus);
}
this.dataProcess(this.menuMode.getAppMenuItems()); this.dataProcess(this.menuMode.getAppMenuItems());
this.menus = this.menuMode.getAppMenuItems(); this.menus = this.menuMode.getAppMenuItems();
this.doMenuSelect(); this.doMenuSelect();
} }
/**
* 计算有效菜单项
*
* @param {*} data
* @memberof Main
*/
public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{
if(_item.resourcetag && !this.$store.getters['unifiedresource/getResourceData'](_item.resourcetag)){
_item.hidden = true;
if (_item.items && _item.items.length > 0) {
this.computedEffectiveMenus(_item.items);
}
}
})
}
/** /**
* 数据处理 * 数据处理
* *
......
...@@ -37,11 +37,6 @@ ...@@ -37,11 +37,6 @@
git clone -b master $para2 ibzuaa/ git clone -b master $para2 ibzuaa/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibzuaa/ cd ibzuaa/
mvn clean package -Pweb
cd ibzuaa-app/ibzuaa-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-app-web.yaml ibzlab-rt --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \ sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
EXPOSE 30002 EXPOSE 8080
ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar
...@@ -3,11 +3,9 @@ services: ...@@ -3,11 +3,9 @@ services:
ibzuaa-app-web: ibzuaa-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports: ports:
- "30002:30002" - "8080:8080"
networks: networks:
- agent_network - agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
......
server: server:
port: 30002 port: 8080
\ No newline at end of file \ No newline at end of file
server: server:
port: 30002 port: 8080
#zuul网关路由设置 #zuul网关路由设置
zuul: zuul:
......
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{ ...@@ -33,7 +34,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{ ...@@ -41,7 +42,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{ ...@@ -49,7 +50,7 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,6 +58,6 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{ ...@@ -57,6 +58,6 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{ ...@@ -33,7 +34,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{ ...@@ -41,7 +42,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{ ...@@ -49,7 +50,7 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,6 +58,6 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{ ...@@ -57,6 +58,6 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{ ...@@ -33,7 +34,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{ ...@@ -41,7 +42,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{ ...@@ -49,7 +50,7 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,6 +58,6 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{ ...@@ -57,6 +58,6 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{ ...@@ -33,7 +34,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{ ...@@ -41,7 +42,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{ ...@@ -49,7 +50,7 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,6 +58,6 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{ ...@@ -57,6 +58,6 @@ public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{ ...@@ -33,7 +34,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{ ...@@ -41,7 +42,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{ ...@@ -49,7 +50,7 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,6 +58,6 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{ ...@@ -57,6 +58,6 @@ public interface SYS_PSSYSUNIRESMapper extends BaseMapper<SYS_PSSYSUNIRES>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -37,7 +38,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{ ...@@ -37,7 +38,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -45,7 +46,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{ ...@@ -45,7 +46,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -53,7 +54,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{ ...@@ -53,7 +54,7 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -61,6 +62,6 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{ ...@@ -61,6 +62,6 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO ...@@ -33,7 +34,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO ...@@ -41,7 +42,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO ...@@ -49,7 +50,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,7 +58,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO ...@@ -57,7 +58,7 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<SYS_ROLE_PERMISSION> selectByPermissionid(@Param("permissionid") Serializable permissionid) ; List<SYS_ROLE_PERMISSION> selectByPermissionid(@Param("permissionid") Serializable permissionid) ;
......
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -37,7 +38,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{ ...@@ -37,7 +38,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -45,7 +46,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{ ...@@ -45,7 +46,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -53,7 +54,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{ ...@@ -53,7 +54,7 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -61,6 +62,6 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{ ...@@ -61,6 +62,6 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
} }
...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper; ...@@ -2,6 +2,7 @@ package cn.ibizlab.core.uaa.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -33,7 +34,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{ ...@@ -33,7 +34,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
* @return * @return
*/ */
@Select("${sql}") @Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql); List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义更新SQL * 自定义更新SQL
...@@ -41,7 +42,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{ ...@@ -41,7 +42,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
* @return * @return
*/ */
@Update("${sql}") @Update("${sql}")
boolean updateBySQL(@Param("sql") String sql); boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义插入SQL * 自定义插入SQL
...@@ -49,7 +50,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{ ...@@ -49,7 +50,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
* @return * @return
*/ */
@Insert("${sql}") @Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql); boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/** /**
* 自定义删除SQL * 自定义删除SQL
...@@ -57,7 +58,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{ ...@@ -57,7 +58,7 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
* @return * @return
*/ */
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<SYS_USER_ROLE> selectByRoleid(@Param("roleid") Serializable roleid) ; List<SYS_USER_ROLE> selectByRoleid(@Param("roleid") Serializable roleid) ;
......
...@@ -36,11 +36,20 @@ public interface ISYS_PERMISSIONService extends IService<SYS_PERMISSION>{ ...@@ -36,11 +36,20 @@ public interface ISYS_PERMISSIONService extends IService<SYS_PERMISSION>{
boolean checkKey(SYS_PERMISSION et) ; boolean checkKey(SYS_PERMISSION et) ;
SYS_PERMISSION get(String key) ; SYS_PERMISSION get(String key) ;
Page<SYS_PERMISSION> searchDefault(SYS_PERMISSIONSearchContext context) ; Page<SYS_PERMISSION> searchDefault(SYS_PERMISSIONSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_PSAPPMENUITEMService extends IService<SYS_PSAPPMENUITEM>{ ...@@ -36,11 +36,20 @@ public interface ISYS_PSAPPMENUITEMService extends IService<SYS_PSAPPMENUITEM>{
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
SYS_PSAPPMENUITEM get(String key) ; SYS_PSAPPMENUITEM get(String key) ;
Page<SYS_PSAPPMENUITEM> searchDefault(SYS_PSAPPMENUITEMSearchContext context) ; Page<SYS_PSAPPMENUITEM> searchDefault(SYS_PSAPPMENUITEMSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_PSDEOPPRIVService extends IService<SYS_PSDEOPPRIV>{ ...@@ -36,11 +36,20 @@ public interface ISYS_PSDEOPPRIVService extends IService<SYS_PSDEOPPRIV>{
boolean save(SYS_PSDEOPPRIV et) ; boolean save(SYS_PSDEOPPRIV et) ;
void saveBatch(List<SYS_PSDEOPPRIV> list) ; void saveBatch(List<SYS_PSDEOPPRIV> list) ;
Page<SYS_PSDEOPPRIV> searchDefault(SYS_PSDEOPPRIVSearchContext context) ; Page<SYS_PSDEOPPRIV> searchDefault(SYS_PSDEOPPRIVSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_PSSYSTEMService extends IService<SYS_PSSYSTEM>{ ...@@ -36,11 +36,20 @@ public interface ISYS_PSSYSTEMService extends IService<SYS_PSSYSTEM>{
boolean update(SYS_PSSYSTEM et) ; boolean update(SYS_PSSYSTEM et) ;
void updateBatch(List<SYS_PSSYSTEM> list) ; void updateBatch(List<SYS_PSSYSTEM> list) ;
Page<SYS_PSSYSTEM> searchDefault(SYS_PSSYSTEMSearchContext context) ; Page<SYS_PSSYSTEM> searchDefault(SYS_PSSYSTEMSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_PSSYSUNIRESService extends IService<SYS_PSSYSUNIRES>{ ...@@ -36,11 +36,20 @@ public interface ISYS_PSSYSUNIRESService extends IService<SYS_PSSYSUNIRES>{
boolean create(SYS_PSSYSUNIRES et) ; boolean create(SYS_PSSYSUNIRES et) ;
void createBatch(List<SYS_PSSYSUNIRES> list) ; void createBatch(List<SYS_PSSYSUNIRES> list) ;
Page<SYS_PSSYSUNIRES> searchDefault(SYS_PSSYSUNIRESSearchContext context) ; Page<SYS_PSSYSUNIRES> searchDefault(SYS_PSSYSUNIRESSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_ROLEService extends IService<SYS_ROLE>{ ...@@ -36,11 +36,20 @@ public interface ISYS_ROLEService extends IService<SYS_ROLE>{
SYS_ROLE getDraft(SYS_ROLE et) ; SYS_ROLE getDraft(SYS_ROLE et) ;
boolean checkKey(SYS_ROLE et) ; boolean checkKey(SYS_ROLE et) ;
Page<SYS_ROLE> searchDefault(SYS_ROLESearchContext context) ; Page<SYS_ROLE> searchDefault(SYS_ROLESearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,19 +36,26 @@ public interface ISYS_ROLE_PERMISSIONService extends IService<SYS_ROLE_PERMISSIO ...@@ -36,19 +36,26 @@ public interface ISYS_ROLE_PERMISSIONService extends IService<SYS_ROLE_PERMISSIO
boolean update(SYS_ROLE_PERMISSION et) ; boolean update(SYS_ROLE_PERMISSION et) ;
void updateBatch(List<SYS_ROLE_PERMISSION> list) ; void updateBatch(List<SYS_ROLE_PERMISSION> list) ;
Page<SYS_ROLE_PERMISSION> searchDefault(SYS_ROLE_PERMISSIONSearchContext context) ; Page<SYS_ROLE_PERMISSION> searchDefault(SYS_ROLE_PERMISSIONSearchContext context) ;
List<SYS_ROLE_PERMISSION> selectByPermissionid(String permissionid) ; List<SYS_ROLE_PERMISSION> selectByPermissionid(String permissionid) ;
void removeByPermissionid(String permissionid) ; void removeByPermissionid(String permissionid) ;
void saveByPermissionid(String permissionid,List<SYS_ROLE_PERMISSION> list) ; void saveByPermissionid(String permissionid,List<SYS_ROLE_PERMISSION> list) ;
List<SYS_ROLE_PERMISSION> selectByRoleid(String roleid) ; List<SYS_ROLE_PERMISSION> selectByRoleid(String roleid) ;
void removeByRoleid(String roleid) ; void removeByRoleid(String roleid) ;
void saveByRoleid(String roleid,List<SYS_ROLE_PERMISSION> list) ; void saveByRoleid(String roleid,List<SYS_ROLE_PERMISSION> list) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,11 +36,20 @@ public interface ISYS_USERService extends IService<SYS_USER>{ ...@@ -36,11 +36,20 @@ public interface ISYS_USERService extends IService<SYS_USER>{
boolean create(SYS_USER et) ; boolean create(SYS_USER et) ;
void createBatch(List<SYS_USER> list) ; void createBatch(List<SYS_USER> list) ;
Page<SYS_USER> searchDefault(SYS_USERSearchContext context) ; Page<SYS_USER> searchDefault(SYS_USERSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -36,19 +36,26 @@ public interface ISYS_USER_ROLEService extends IService<SYS_USER_ROLE>{ ...@@ -36,19 +36,26 @@ public interface ISYS_USER_ROLEService extends IService<SYS_USER_ROLE>{
boolean save(SYS_USER_ROLE et) ; boolean save(SYS_USER_ROLE et) ;
void saveBatch(List<SYS_USER_ROLE> list) ; void saveBatch(List<SYS_USER_ROLE> list) ;
Page<SYS_USER_ROLE> searchDefault(SYS_USER_ROLESearchContext context) ; Page<SYS_USER_ROLE> searchDefault(SYS_USER_ROLESearchContext context) ;
List<SYS_USER_ROLE> selectByRoleid(String roleid) ; List<SYS_USER_ROLE> selectByRoleid(String roleid) ;
void removeByRoleid(String roleid) ; void removeByRoleid(String roleid) ;
void saveByRoleid(String roleid,List<SYS_USER_ROLE> list) ; void saveByRoleid(String roleid,List<SYS_USER_ROLE> list) ;
List<SYS_USER_ROLE> selectByUserid(String userid) ; List<SYS_USER_ROLE> selectByUserid(String userid) ;
void removeByUserid(String userid) ; void removeByUserid(String userid) ;
void saveByUserid(String userid,List<SYS_USER_ROLE> list) ; void saveByUserid(String userid,List<SYS_USER_ROLE> list) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
List<JSONObject> select(String sql); * @param param 参数列表 param.put("param","1");
boolean execute(String sql); * @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PERMISSIONMapper; import cn.ibizlab.core.uaa.mapper.SYS_PERMISSIONMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -47,6 +47,8 @@ public class SYS_PERMISSIONServiceImpl extends ServiceImpl<SYS_PERMISSIONMapper, ...@@ -47,6 +47,8 @@ public class SYS_PERMISSIONServiceImpl extends ServiceImpl<SYS_PERMISSIONMapper,
@Autowired @Autowired
@Lazy @Lazy
private cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService sysRolePermissionService; private cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService sysRolePermissionService;
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -154,25 +156,26 @@ public class SYS_PERMISSIONServiceImpl extends ServiceImpl<SYS_PERMISSIONMapper, ...@@ -154,25 +156,26 @@ public class SYS_PERMISSIONServiceImpl extends ServiceImpl<SYS_PERMISSIONMapper,
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PSAPPMENUITEMMapper; import cn.ibizlab.core.uaa.mapper.SYS_PSAPPMENUITEMMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils;
@Service("SYS_PSAPPMENUITEMServiceImpl") @Service("SYS_PSAPPMENUITEMServiceImpl")
public class SYS_PSAPPMENUITEMServiceImpl extends ServiceImpl<SYS_PSAPPMENUITEMMapper, SYS_PSAPPMENUITEM> implements ISYS_PSAPPMENUITEMService { public class SYS_PSAPPMENUITEMServiceImpl extends ServiceImpl<SYS_PSAPPMENUITEMMapper, SYS_PSAPPMENUITEM> implements ISYS_PSAPPMENUITEMService {
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -147,25 +149,26 @@ public class SYS_PSAPPMENUITEMServiceImpl extends ServiceImpl<SYS_PSAPPMENUITEMM ...@@ -147,25 +149,26 @@ public class SYS_PSAPPMENUITEMServiceImpl extends ServiceImpl<SYS_PSAPPMENUITEMM
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSDEOPPRIVService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSDEOPPRIVService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PSDEOPPRIVMapper; import cn.ibizlab.core.uaa.mapper.SYS_PSDEOPPRIVMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils;
@Service("SYS_PSDEOPPRIVServiceImpl") @Service("SYS_PSDEOPPRIVServiceImpl")
public class SYS_PSDEOPPRIVServiceImpl extends ServiceImpl<SYS_PSDEOPPRIVMapper, SYS_PSDEOPPRIV> implements ISYS_PSDEOPPRIVService { public class SYS_PSDEOPPRIVServiceImpl extends ServiceImpl<SYS_PSDEOPPRIVMapper, SYS_PSDEOPPRIV> implements ISYS_PSDEOPPRIVService {
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -147,25 +149,26 @@ public class SYS_PSDEOPPRIVServiceImpl extends ServiceImpl<SYS_PSDEOPPRIVMapper, ...@@ -147,25 +149,26 @@ public class SYS_PSDEOPPRIVServiceImpl extends ServiceImpl<SYS_PSDEOPPRIVMapper,
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSSYSTEMService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSSYSTEMService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PSSYSTEMMapper; import cn.ibizlab.core.uaa.mapper.SYS_PSSYSTEMMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils;
@Service("SYS_PSSYSTEMServiceImpl") @Service("SYS_PSSYSTEMServiceImpl")
public class SYS_PSSYSTEMServiceImpl extends ServiceImpl<SYS_PSSYSTEMMapper, SYS_PSSYSTEM> implements ISYS_PSSYSTEMService { public class SYS_PSSYSTEMServiceImpl extends ServiceImpl<SYS_PSSYSTEMMapper, SYS_PSSYSTEM> implements ISYS_PSSYSTEMService {
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -147,25 +149,26 @@ public class SYS_PSSYSTEMServiceImpl extends ServiceImpl<SYS_PSSYSTEMMapper, SYS ...@@ -147,25 +149,26 @@ public class SYS_PSSYSTEMServiceImpl extends ServiceImpl<SYS_PSSYSTEMMapper, SYS
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSSYSUNIRESService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_PSSYSUNIRESService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PSSYSUNIRESMapper; import cn.ibizlab.core.uaa.mapper.SYS_PSSYSUNIRESMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils;
@Service("SYS_PSSYSUNIRESServiceImpl") @Service("SYS_PSSYSUNIRESServiceImpl")
public class SYS_PSSYSUNIRESServiceImpl extends ServiceImpl<SYS_PSSYSUNIRESMapper, SYS_PSSYSUNIRES> implements ISYS_PSSYSUNIRESService { public class SYS_PSSYSUNIRESServiceImpl extends ServiceImpl<SYS_PSSYSUNIRESMapper, SYS_PSSYSUNIRES> implements ISYS_PSSYSUNIRESService {
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -147,25 +149,26 @@ public class SYS_PSSYSUNIRESServiceImpl extends ServiceImpl<SYS_PSSYSUNIRESMappe ...@@ -147,25 +149,26 @@ public class SYS_PSSYSUNIRESServiceImpl extends ServiceImpl<SYS_PSSYSUNIRESMappe
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_ROLEService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_ROLEService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_ROLEMapper; import cn.ibizlab.core.uaa.mapper.SYS_ROLEMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -50,6 +50,8 @@ public class SYS_ROLEServiceImpl extends ServiceImpl<SYS_ROLEMapper, SYS_ROLE> i ...@@ -50,6 +50,8 @@ public class SYS_ROLEServiceImpl extends ServiceImpl<SYS_ROLEMapper, SYS_ROLE> i
@Autowired @Autowired
@Lazy @Lazy
private cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService sysUserRoleService; private cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService sysUserRoleService;
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -161,25 +163,26 @@ public class SYS_ROLEServiceImpl extends ServiceImpl<SYS_ROLEMapper, SYS_ROLE> i ...@@ -161,25 +163,26 @@ public class SYS_ROLEServiceImpl extends ServiceImpl<SYS_ROLEMapper, SYS_ROLE> i
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_ROLE_PERMISSIONService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_ROLE_PERMISSIONMapper; import cn.ibizlab.core.uaa.mapper.SYS_ROLE_PERMISSIONMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,14 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,14 @@ import org.springframework.util.StringUtils;
@Service("SYS_ROLE_PERMISSIONServiceImpl") @Service("SYS_ROLE_PERMISSIONServiceImpl")
public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISSIONMapper, SYS_ROLE_PERMISSION> implements ISYS_ROLE_PERMISSIONService { public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISSIONMapper, SYS_ROLE_PERMISSION> implements ISYS_ROLE_PERMISSIONService {
@Autowired
@Lazy
private cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService sysPermissionService;
@Autowired
@Lazy
private cn.ibizlab.core.uaa.service.ISYS_ROLEService sysRoleService;
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -79,6 +87,7 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS ...@@ -79,6 +87,7 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS
@Override @Override
@Transactional @Transactional
public boolean create(SYS_ROLE_PERMISSION et) { public boolean create(SYS_ROLE_PERMISSION et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et); CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
...@@ -123,6 +132,7 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS ...@@ -123,6 +132,7 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS
@Override @Override
@Transactional @Transactional
public boolean update(SYS_ROLE_PERMISSION et) { public boolean update(SYS_ROLE_PERMISSION et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid())))
return false; return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et); CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
...@@ -225,25 +235,52 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS ...@@ -225,25 +235,52 @@ public class SYS_ROLE_PERMISSIONServiceImpl extends ServiceImpl<SYS_ROLE_PERMISS
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(SYS_ROLE_PERMISSION et){
//实体关系[DER1N_SYS_ROLE_PERMISSION_SYS_PERMISSION_SYS_PERMISSIONID]
if(!ObjectUtils.isEmpty(et.getPermissionid())){
cn.ibizlab.core.uaa.domain.SYS_PERMISSION permission=et.getPermission();
if(ObjectUtils.isEmpty(permission)){
cn.ibizlab.core.uaa.domain.SYS_PERMISSION majorEntity=sysPermissionService.get(et.getPermissionid());
et.setPermission(majorEntity);
permission=majorEntity;
}
et.setPermissionname(permission.getPermissionname());
}
//实体关系[DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID]
if(!ObjectUtils.isEmpty(et.getRoleid())){
cn.ibizlab.core.uaa.domain.SYS_ROLE role=et.getRole();
if(ObjectUtils.isEmpty(role)){
cn.ibizlab.core.uaa.domain.SYS_ROLE majorEntity=sysRoleService.get(et.getRoleid());
et.setRole(majorEntity);
role=majorEntity;
}
et.setRolename(role.getRolename());
}
}
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_USERService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_USERService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_USERMapper; import cn.ibizlab.core.uaa.mapper.SYS_USERMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -47,6 +47,8 @@ public class SYS_USERServiceImpl extends ServiceImpl<SYS_USERMapper, SYS_USER> i ...@@ -47,6 +47,8 @@ public class SYS_USERServiceImpl extends ServiceImpl<SYS_USERMapper, SYS_USER> i
@Autowired @Autowired
@Lazy @Lazy
private cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService sysUserRoleService; private cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService sysUserRoleService;
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -154,25 +156,26 @@ public class SYS_USERServiceImpl extends ServiceImpl<SYS_USERMapper, SYS_USER> i ...@@ -154,25 +156,26 @@ public class SYS_USERServiceImpl extends ServiceImpl<SYS_USERMapper, SYS_USER> i
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -4,6 +4,7 @@ import java.io.Serializable; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.HashSet; import java.util.HashSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Collection; import java.util.Collection;
...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService; ...@@ -29,7 +30,6 @@ import cn.ibizlab.core.uaa.service.ISYS_USER_ROLEService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_USER_ROLEMapper; import cn.ibizlab.core.uaa.mapper.SYS_USER_ROLEMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -44,6 +44,14 @@ import org.springframework.util.StringUtils; ...@@ -44,6 +44,14 @@ import org.springframework.util.StringUtils;
@Service("SYS_USER_ROLEServiceImpl") @Service("SYS_USER_ROLEServiceImpl")
public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, SYS_USER_ROLE> implements ISYS_USER_ROLEService { public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, SYS_USER_ROLE> implements ISYS_USER_ROLEService {
@Autowired
@Lazy
private cn.ibizlab.core.uaa.service.ISYS_ROLEService sysRoleService;
@Autowired
@Lazy
private cn.ibizlab.core.uaa.service.ISYS_USERService sysUserService;
private int batchSize = 500; private int batchSize = 500;
@Override @Override
...@@ -59,6 +67,7 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S ...@@ -59,6 +67,7 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S
@Override @Override
@Transactional @Transactional
public boolean update(SYS_USER_ROLE et) { public boolean update(SYS_USER_ROLE et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_user_roleid",et.getUserroleid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_user_roleid",et.getUserroleid())))
return false; return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et); CachedBeanCopier.copy(get(et.getUserroleid()),et);
...@@ -85,6 +94,7 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S ...@@ -85,6 +94,7 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S
@Override @Override
@Transactional @Transactional
public boolean create(SYS_USER_ROLE et) { public boolean create(SYS_USER_ROLE et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et); CachedBeanCopier.copy(get(et.getUserroleid()),et);
...@@ -225,25 +235,52 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S ...@@ -225,25 +235,52 @@ public class SYS_USER_ROLEServiceImpl extends ServiceImpl<SYS_USER_ROLEMapper, S
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(SYS_USER_ROLE et){
//实体关系[DER1N_SYS_USER_ROLE_SYS_ROLE_SYS_ROLEID]
if(!ObjectUtils.isEmpty(et.getRoleid())){
cn.ibizlab.core.uaa.domain.SYS_ROLE role=et.getRole();
if(ObjectUtils.isEmpty(role)){
cn.ibizlab.core.uaa.domain.SYS_ROLE majorEntity=sysRoleService.get(et.getRoleid());
et.setRole(majorEntity);
role=majorEntity;
}
et.setRolename(role.getRolename());
}
//实体关系[DER1N_SYS_USER_ROLE_SYS_USER_SYS_USERID]
if(!ObjectUtils.isEmpty(et.getUserid())){
cn.ibizlab.core.uaa.domain.SYS_USER user=et.getUser();
if(ObjectUtils.isEmpty(user)){
cn.ibizlab.core.uaa.domain.SYS_USER majorEntity=sysUserService.get(et.getUserid());
et.setUser(majorEntity);
user=majorEntity;
}
et.setPersonname(user.getPersonname());
}
}
@Override @Override
public List<JSONObject> select(String sql){ public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql); return this.baseMapper.selectBySQL(sql,param);
} }
@Override @Override
@Transactional @Transactional
public boolean execute(String sql){ public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) { if (sql == null || sql.isEmpty()) {
return false; return false;
} }
if (sql.toLowerCase().trim().startsWith("insert")) { if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql); return this.baseMapper.insertBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("update")) { if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql); return this.baseMapper.updateBySQL(sql,param);
} }
if (sql.toLowerCase().trim().startsWith("delete")) { if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql); return this.baseMapper.deleteBySQL(sql,param);
} }
log.warn("暂未支持的SQL语法"); log.warn("暂未支持的SQL语法");
return true; return true;
......
...@@ -21,7 +21,7 @@ import java.io.IOException; ...@@ -21,7 +21,7 @@ import java.io.IOException;
/** /**
* 权限:向uaa同步当前系统菜单、权限资源任务类 * 权限:向uaa同步当前系统菜单、权限资源任务类
*/ */
@Component //开启此类需要保证Main中开启了feign :EnableFeignClients //@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
public class PermissionSyncJob implements ApplicationRunner { public class PermissionSyncJob implements ApplicationRunner {
private Log log = LogFactory.getLog(PermissionSyncJob.class); private Log log = LogFactory.getLog(PermissionSyncJob.class);
...@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value("${ibiz.enablePermissionValid:false}") @Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验 boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:EB948A46-DF8C-4BE3-8020-0ADA23440D31}") @Value("${ibiz.systemid:2C40DFCD-0DF5-47BF-91A5-C45F810B0001}")
private String systemId; private String systemId;
@Override @Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册