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

ibizdev提交

上级 24ba8005
......@@ -1204,7 +1204,7 @@ export default class SYS_PERMISSIONEditViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1230,7 +1230,7 @@ export default class SYS_PERMISSIONEditViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1236,7 +1236,7 @@ export default class SYS_PERMISSIONEditView2Base extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1262,7 +1262,7 @@ export default class SYS_PERMISSIONEditView2Base extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1153,7 +1153,7 @@ export default class SYS_PERMISSIONGridViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1231,7 +1231,7 @@ export default class SYS_PERMISSIONGridViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1204,7 +1204,7 @@ export default class SYS_ROLE_PERMISSIONEditViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1230,7 +1230,7 @@ export default class SYS_ROLE_PERMISSIONEditViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1236,7 +1236,7 @@ export default class SYS_ROLE_PERMISSIONEditView2Base extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1262,7 +1262,7 @@ export default class SYS_ROLE_PERMISSIONEditView2Base extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1163,7 +1163,7 @@ export default class SYS_ROLE_PERMISSIONGridViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1241,7 +1241,7 @@ export default class SYS_ROLE_PERMISSIONGridViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1204,7 +1204,7 @@ export default class SYS_ROLEEditViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1230,7 +1230,7 @@ export default class SYS_ROLEEditViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1236,7 +1236,7 @@ export default class SYS_ROLEEditView2Base extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1262,7 +1262,7 @@ export default class SYS_ROLEEditView2Base extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1153,7 +1153,7 @@ export default class SYS_ROLEGridViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1231,7 +1231,7 @@ export default class SYS_ROLEGridViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1204,7 +1204,7 @@ export default class SYS_USER_ROLEEditViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1230,7 +1230,7 @@ export default class SYS_USER_ROLEEditViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1236,7 +1236,7 @@ export default class SYS_USER_ROLEEditView2Base extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1262,7 +1262,7 @@ export default class SYS_USER_ROLEEditView2Base extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1163,7 +1163,7 @@ export default class SYS_USER_ROLEGridViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1241,7 +1241,7 @@ export default class SYS_USER_ROLEGridViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1204,7 +1204,7 @@ export default class SYS_USEREditViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1230,7 +1230,7 @@ export default class SYS_USEREditViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1236,7 +1236,7 @@ export default class SYS_USEREditView2Base extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1262,7 +1262,7 @@ export default class SYS_USEREditView2Base extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -1153,7 +1153,7 @@ export default class SYS_USERGridViewBase extends Vue {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
......@@ -1231,7 +1231,7 @@ export default class SYS_USERGridViewBase extends Vue {
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
}
_this.newdata([{ ...data }], params, $event, xData);
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
......
......@@ -587,12 +587,12 @@ export default class EntityService {
* createBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async createBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async createBatch(context: any = {},data: any, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/${this.APPDENAME}/batch`,data,isloading);
}
......@@ -600,12 +600,12 @@ export default class EntityService {
* updateBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async updateBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async updateBatch(context: any = {},data: any, isloading?: boolean): Promise<any> {
return Http.getInstance().put(`/${this.APPDENAME}/batch`,data,isloading);
}
......@@ -613,12 +613,12 @@ export default class EntityService {
* removeBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async removeBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async removeBatch(context: any = {},data: any, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/${this.APPDENAME}/batch`,isloading,data);
}
......
......@@ -78,7 +78,7 @@ export class Http {
axios({
method: 'post',
url: url,
data: { ...params },
data: params,
headers: { 'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json' },
// transformResponse: [(data: any) => {
// let _data: any = null;
......
package cn.ibizlab.core.uaa.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[统一资源]
*/
@Data
@TableName(value = "IBZPSSYSUNIRES",resultMap = "IBZPSSYSUNIRESResultMap")
public class IBZPSSYSUNIRES extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 统一资源标识
*/
@DEField(isKeyField=true)
@TableId(value= "ibzpssysuniresid",type=IdType.UUID)
@JSONField(name = "ibzpssysuniresid")
@JsonProperty("ibzpssysuniresid")
private String ibzpssysuniresid;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 统一资源名称
*/
@TableField(value = "ibzpssysuniresname")
@JSONField(name = "ibzpssysuniresname")
@JsonProperty("ibzpssysuniresname")
private String ibzpssysuniresname;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [统一资源名称]
*/
public void setIbzpssysuniresname(String ibzpssysuniresname){
this.ibzpssysuniresname = ibzpssysuniresname ;
this.modify("ibzpssysuniresname",ibzpssysuniresname);
}
}
package cn.ibizlab.core.uaa.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.uaa.domain.IBZPSSYSUNIRES;
/**
* 关系型数据实体[IBZPSSYSUNIRES] 查询条件对象
*/
@Slf4j
@Data
public class IBZPSSYSUNIRESSearchContext extends QueryWrapperContext<IBZPSSYSUNIRES> {
private String n_ibzpssysuniresname_like;//[统一资源名称]
public void setN_ibzpssysuniresname_like(String n_ibzpssysuniresname_like) {
this.n_ibzpssysuniresname_like = n_ibzpssysuniresname_like;
if(!ObjectUtils.isEmpty(this.n_ibzpssysuniresname_like)){
this.getSelectCond().like("ibzpssysuniresname", n_ibzpssysuniresname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("ibzpssysuniresname",query);
}
}
}
package cn.ibizlab.core.uaa.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.uaa.domain.IBZPSSYSUNIRES;
import cn.ibizlab.core.uaa.filter.IBZPSSYSUNIRESSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface IBZPSSYSUNIRESMapper extends BaseMapper<IBZPSSYSUNIRES>{
Page<IBZPSSYSUNIRES> searchDefault(IPage page, @Param("srf") IBZPSSYSUNIRESSearchContext context, @Param("ew") Wrapper<IBZPSSYSUNIRES> wrapper) ;
@Override
IBZPSSYSUNIRES selectById(Serializable id);
@Override
int insert(IBZPSSYSUNIRES entity);
@Override
int updateById(@Param(Constants.ENTITY) IBZPSSYSUNIRES entity);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql);
}
package cn.ibizlab.core.uaa.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import cn.ibizlab.core.uaa.domain.IBZPSSYSUNIRES;
import cn.ibizlab.core.uaa.filter.IBZPSSYSUNIRESSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBZPSSYSUNIRES] 服务对象接口
*/
public interface IIBZPSSYSUNIRESService extends IService<IBZPSSYSUNIRES>{
boolean save(IBZPSSYSUNIRES et) ;
void saveBatch(List<IBZPSSYSUNIRES> list) ;
boolean update(IBZPSSYSUNIRES et) ;
void updateBatch(List<IBZPSSYSUNIRES> list) ;
boolean checkKey(IBZPSSYSUNIRES et) ;
IBZPSSYSUNIRES get(String key) ;
boolean create(IBZPSSYSUNIRES et) ;
void createBatch(List<IBZPSSYSUNIRES> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
IBZPSSYSUNIRES getDraft(IBZPSSYSUNIRES et) ;
Page<IBZPSSYSUNIRES> searchDefault(IBZPSSYSUNIRESSearchContext context) ;
List<JSONObject> select(String sql);
boolean execute(String sql);
}
package cn.ibizlab.core.uaa.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.uaa.domain.IBZPSSYSUNIRES;
import cn.ibizlab.core.uaa.filter.IBZPSSYSUNIRESSearchContext;
import cn.ibizlab.core.uaa.service.IIBZPSSYSUNIRESService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.IBZPSSYSUNIRESMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[统一资源] 服务对象接口实现
*/
@Slf4j
@Service("IBZPSSYSUNIRESServiceImpl")
public class IBZPSSYSUNIRESServiceImpl extends ServiceImpl<IBZPSSYSUNIRESMapper, IBZPSSYSUNIRES> implements IIBZPSSYSUNIRESService {
private int batchSize = 500;
@Override
@Transactional
public boolean save(IBZPSSYSUNIRES et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IBZPSSYSUNIRES et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public void saveBatch(List<IBZPSSYSUNIRES> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(IBZPSSYSUNIRES et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("ibzpssysuniresid",et.getIbzpssysuniresid())))
return false;
CachedBeanCopier.copy(get(et.getIbzpssysuniresid()),et);
return true;
}
@Override
public void updateBatch(List<IBZPSSYSUNIRES> list) {
updateBatchById(list,batchSize);
}
@Override
public boolean checkKey(IBZPSSYSUNIRES et) {
return (!ObjectUtils.isEmpty(et.getIbzpssysuniresid()))&&(!Objects.isNull(this.getById(et.getIbzpssysuniresid())));
}
@Override
@Transactional
public IBZPSSYSUNIRES get(String key) {
IBZPSSYSUNIRES et = getById(key);
if(et==null){
et=new IBZPSSYSUNIRES();
et.setIbzpssysuniresid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(IBZPSSYSUNIRES et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getIbzpssysuniresid()),et);
return true;
}
@Override
public void createBatch(List<IBZPSSYSUNIRES> list) {
saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
if(!removeById(key)) return false;
return true ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
public IBZPSSYSUNIRES getDraft(IBZPSSYSUNIRES et) {
return et;
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<IBZPSSYSUNIRES> searchDefault(IBZPSSYSUNIRESSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZPSSYSUNIRES> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBZPSSYSUNIRES>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql){
return this.baseMapper.selectBySQL(sql);
}
@Override
@Transactional
public boolean execute(String sql){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
......@@ -73,13 +73,15 @@
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PSSYSUNIRES]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssysunires-79-4">
<createTable tableName="T_SYS_PSSYSUNIRES">
<column name="SYS_PSSYSUNIRESID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSUNIRES_SYS_PSSYSUN"/>
<!--输出实体[IBZPSSYSUNIRES]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzpssysunires-52-4">
<createTable tableName="IBZPSSYSUNIRES">
<column name="IBZPSSYSUNIRESID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZPSSYSUNIRES_IBZPSSYSUNIR"/>
</column>
<column name="SYS_PSSYSUNIRESNAME" remarks="" type="VARCHAR(200)">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="IBZPSSYSUNIRESNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -87,10 +89,6 @@
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UNIRESCODE" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
......@@ -198,7 +196,7 @@
<addForeignKeyConstraint baseColumnNames="SYS_PERMISSIONID" baseTableName="IBZROLE_PERMISSION" constraintName="DER1N_SYS_ROLE_PERMISSION_SYS_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_PERMISSIONID" referencedTableName="IBZPERMISSION" validate="true"/>
</changeSet>
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_PSSYSUNIRES]外键关系 -->
<!--输出实体[IBZPSSYSUNIRES]外键关系 -->
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-12">
<addForeignKeyConstraint baseColumnNames="SYS_ROLEID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_ROLE_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
......
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<!--输出实体[SYS_PSSYSUNIRES]视图结构信息 runOnChange="true" 当视图发生变更时,通过liquibase强刷prod的视图,实现视图的同步-->
<changeSet author="a_A_5d9d78509" id="view-sys_pssysunires-79-1" runOnChange="true">
<createView fullDefinition="false" replaceIfExists="true" viewName="V_SYS_PSSYSUNIRES">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`SYS_PSSYSUNIRESID`, t1.`SYS_PSSYSUNIRESNAME`, t1.`UNIRESCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_SYS_PSSYSUNIRES` t1 ]]>
</createView>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.uaa.mapper.IBZPSSYSUNIRESMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IBZPSSYSUNIRESResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBZPSSYSUNIRESID`, t1.`IBZPSSYSUNIRESNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZPSSYSUNIRES` t1 ) t1 where ibzpssysuniresid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IBZPSSYSUNIRESResultMap" type="cn.ibizlab.core.uaa.domain.IBZPSSYSUNIRES" autoMapping="true">
<id property="ibzpssysuniresid" column="ibzpssysuniresid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.uaa.filter.IBZPSSYSUNIRESSearchContext" resultMap="IBZPSSYSUNIRESResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBZPSSYSUNIRESID`, t1.`IBZPSSYSUNIRESNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZPSSYSUNIRES` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBZPSSYSUNIRESID`, t1.`IBZPSSYSUNIRESNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZPSSYSUNIRES` t1
]]>
</sql>
</mapper>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册