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

ibiz4j 发布系统代码

上级 d50e5ca2
......@@ -21,38 +21,33 @@ import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[系统]
* ServiceApi [系统] 对象
*/
@Data
@TableName(value = "IBZPSSYSTEM",resultMap = "WFSystemResultMap")
public class WFSystem extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
public class WFSystem extends EntityClient implements Serializable {
/**
* 系统标识
*/
@DEField(isKeyField=true)
@TableId(value= "pssystemid",type=IdType.UUID)
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
@JSONField(name = "pSSystemId")
@JsonProperty("pSSystemId")
private String pssystemid;
/**
* 系统名称
*/
@TableField(value = "pssystemname")
@JSONField(name = "pssystemname")
@JsonProperty("pssystemname")
@JSONField(name = "pSSystemName")
@JsonProperty("pSSystemName")
private String pssystemname;
/**
* 设置 [系统名称]
*/
......
......@@ -17,36 +17,17 @@ 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.workflow.domain.WFSystem;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[WFSystem] 查询条件对象
* ServiceApi数据实体[WFSystem] 查询条件对象
*/
@Slf4j
@Data
public class WFSystemSearchContext extends QueryWrapperContext<WFSystem> {
public class WFSystemSearchContext extends SearchContextBase {
private String n_pssystemname_like;//[系统名称]
public void setN_pssystemname_like(String n_pssystemname_like) {
this.n_pssystemname_like = n_pssystemname_like;
if(!ObjectUtils.isEmpty(this.n_pssystemname_like)){
this.getSelectCond().like("pssystemname", n_pssystemname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("pssystemname",query);
}
}
}
}
......@@ -18,12 +18,10 @@ import cn.ibizlab.core.workflow.domain.WFSystem;
import cn.ibizlab.core.workflow.filter.WFSystemSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WFSystem] 服务对象接口
*/
public interface IWFSystemService extends IService<WFSystem>{
public interface IWFSystemService{
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
......@@ -37,21 +35,8 @@ public interface IWFSystemService extends IService<WFSystem>{
boolean checkKey(WFSystem et) ;
WFSystem get(String key) ;
Page<WFSystem> searchDefault(WFSystemSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @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);
}
......@@ -30,47 +30,31 @@ import cn.ibizlab.core.workflow.service.IWFSystemService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.workflow.mapper.WFSystemMapper;
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("WFSystemServiceImpl")
public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> implements IWFSystemService {
@Service
public class WFSystemServiceImpl implements IWFSystemService {
private int batchSize = 500;
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
return true;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void removeBatch(Collection<String> idList){
}
@Override
@Transactional
public boolean update(WFSystem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
//代码实现
return true;
}
@Override
public void updateBatch(List<WFSystem> list) {
updateBatchById(list,batchSize);
public void updateBatch(List<WFSystem> list){
}
@Override
......@@ -81,98 +65,48 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
@Override
@Transactional
public boolean save(WFSystem et) {
if(!saveOrUpdate(et))
return false;
//代码实现
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFSystem et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public void saveBatch(List<WFSystem> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean create(WFSystem et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
//代码实现
return true;
}
@Override
public void createBatch(List<WFSystem> list) {
this.saveBatch(list,batchSize);
public void createBatch(List<WFSystem> list){
}
@Override
public boolean checkKey(WFSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
return false;
}
@Override
@Transactional
public WFSystem get(String key) {
WFSystem et = getById(key);
if(et==null){
et=new WFSystem();
et.setPssystemid(key);
}
else{
}
WFSystem et = new WFSystem();
et.setPssystemid(key);
return et;
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WFSystem> searchDefault(WFSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
return new PageImpl<WFSystem>(new ArrayList(),context.getPageable(),0);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return 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">
<!--输出实体[WF_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_pssystem-15-1">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_PSSYSTEM_PSSYSTEMID"/>
</column>
<column name="PSSYSTEMNAME" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_GROUP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group-24-2">
<changeSet author="a_A_5d9d78509" id="tab-wf_group-24-1">
<createTable tableName="IBZWFGROUP">
<column name="GROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_GROUPID"/>
......@@ -24,7 +14,7 @@
</createTable>
</changeSet>
<!--输出实体[WF_DEFINITION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_definition-51-3">
<changeSet author="a_A_5d9d78509" id="tab-wf_definition-51-2">
<createTable tableName="IBZWFDEFINITION">
<column name="DEFINITIONKEY" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_DEFINITION_DEFINITIONKEY"/>
......@@ -48,7 +38,7 @@
</createTable>
</changeSet>
<!--输出实体[WF_GROUP_MEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group_member-39-4">
<changeSet author="a_A_5d9d78509" id="tab-wf_group_member-39-3">
<createTable tableName="IBZWFMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_MEMBER_MEMBERID"/>
......@@ -62,14 +52,13 @@
</createTable>
</changeSet>
<!--输出实体[WF_PSSYSTEM]外键关系 -->
<!--输出实体[WF_GROUP]外键关系 -->
<!--输出实体[WF_DEFINITION]外键关系 -->
<!--输出实体[WF_GROUP_MEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-39-5">
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-39-4">
<addForeignKeyConstraint baseColumnNames="GROUPID" baseTableName="IBZWFMEMBER" constraintName="DER1N_WF_GROUP_MEMBER_WF_GROUP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GROUPID" referencedTableName="IBZWFGROUP" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-39-6">
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-39-5">
<addForeignKeyConstraint baseColumnNames="USERID" baseTableName="IBZWFMEMBER" constraintName="DER1N_WF_GROUP_MEMBER_WF_USER_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="USERID" referencedTableName="IBZUSER" validate="true"/>
</changeSet>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册