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

Miracle 部署微服务应用

上级 88df5b2e
......@@ -174,6 +174,37 @@
}
]
},
{
"srfkey": "CL_HR_0024",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "BORROW",
"label": "借阅中",
"text": "借阅中",
"data":"",
"codename":"Borrow",
"color": "rgba(255, 0, 17, 1)",
"value": "BORROW",
"disabled": false,
"default": false
}
, {
"id": "HAVERETURN",
"label": "已归还",
"text": "已归还",
"data":"",
"codename":"Havereturn",
"color": "rgba(0, 89, 255, 1)",
"value": "HAVERETURN",
"disabled": false,
"default": false
}
]
},
{
"srfkey": "CL_HR_0007",
"emptytext": "未定义",
......
......@@ -22,6 +22,11 @@ export default {
"FAX": "传真",
"empty": ""
},
CL_HR_0024: {
"BORROW": "借阅中",
"HAVERETURN": "已归还",
"empty": ""
},
CL_HR_0007: {
"A": "A",
"B": "B",
......
......@@ -22,6 +22,11 @@ export default {
"FAX": "传真",
"empty": "",
},
CL_HR_0024: {
"BORROW": "借阅中",
"HAVERETURN": "已归还",
"empty": "",
},
CL_HR_0007: {
"A": "A",
"B": "B",
......
......@@ -114,6 +114,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......@@ -149,6 +150,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......@@ -184,6 +186,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......
......@@ -113,6 +113,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......@@ -148,6 +149,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......@@ -183,6 +185,7 @@ export default {
wfstate: "工作流状态",
wfversion: "工作流版本",
wfstep: "工作流步骤",
createman: "建立人",
hrtransferapplyid: "调动申请标识",
},
uiactions: {
......
......@@ -168,6 +168,35 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: "CL_HR_0024",
emptytext: "未定义",
"codelisttype":"static",
items: [
{
id: "BORROW",
label: "借阅中",
text: "借阅中",
"data":"",
"codename":"Borrow",
"color": "rgba(255, 0, 17, 1)",
value: "BORROW",
disabled: false,
},
{
id: "HAVERETURN",
label: "已归还",
text: "已归还",
"data":"",
"codename":"Havereturn",
"color": "rgba(0, 89, 255, 1)",
value: "HAVERETURN",
disabled: false,
},
]
},
{
srfkey: "CL_HR_0007",
emptytext: "未定义",
......
......@@ -213,6 +213,14 @@ export class GRID_001GridBase extends GridControlBase {
textSeparator: '、',
valueSeparator: ',',
},
{
name: 'borrowstate',
srfkey: 'CL_HR_0024',
codelistType : 'STATIC',
renderMode: 'other',
textSeparator: '、',
valueSeparator: ',',
},
]);
}
......
......@@ -93,7 +93,9 @@
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.borrowstate}}</span>
<template >
<codelist :value="row.borrowstate" tag='CL_HR_0024' codelistType='STATIC' ></codelist>
</template>
</template>
</el-table-column>
</template>
......
......@@ -257,6 +257,14 @@ export class MainGridBase extends GridControlBase {
textSeparator: '、',
valueSeparator: ',',
},
{
name: 'borrowstate',
srfkey: 'CL_HR_0024',
codelistType : 'STATIC',
renderMode: 'other',
textSeparator: '、',
valueSeparator: ',',
},
]);
}
......
......@@ -143,7 +143,9 @@
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.borrowstate}}</span>
<template >
<codelist :value="row.borrowstate" tag='CL_HR_0024' codelistType='STATIC' ></codelist>
</template>
</template>
</el-table-column>
</template>
......
......@@ -100,6 +100,7 @@ export class EF_001EditFormBase extends EditFormControlBase {
wfstate: null,
wfversion: null,
wfstep: null,
createman: null,
hrtransferapplyid: null,
hrtransferapply:null,
};
......@@ -185,6 +186,8 @@ export class EF_001EditFormBase extends EditFormControlBase {
wfstep: new FormItemModel({ caption: '工作流步骤', detailType: 'FORMITEM', name: 'wfstep', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
hrtransferapplyid: new FormItemModel({ caption: '调动申请标识', detailType: 'FORMITEM', name: 'hrtransferapplyid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
......
......@@ -145,6 +145,11 @@ export default class EF_001Model {
prop: 'wfstep',
dataType: 'SSCODELIST',
},
{
name: 'createman',
prop: 'createman',
dataType: 'TEXT',
},
{
name: 'hrtransferapplyid',
prop: 'hrtransferapplyid',
......
......@@ -100,6 +100,7 @@ export class IF_001EditFormBase extends EditFormControlBase {
wfstate: null,
wfversion: null,
wfstep: null,
createman: null,
hrtransferapplyid: null,
hrtransferapply:null,
};
......@@ -185,6 +186,8 @@ export class IF_001EditFormBase extends EditFormControlBase {
wfstep: new FormItemModel({ caption: '工作流步骤', detailType: 'FORMITEM', name: 'wfstep', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
hrtransferapplyid: new FormItemModel({ caption: '调动申请标识', detailType: 'FORMITEM', name: 'hrtransferapplyid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
......
......@@ -145,6 +145,11 @@ export default class IF_001Model {
prop: 'wfstep',
dataType: 'SSCODELIST',
},
{
name: 'createman',
prop: 'createman',
dataType: 'TEXT',
},
{
name: 'hrtransferapplyid',
prop: 'hrtransferapplyid',
......
......@@ -100,6 +100,7 @@ export class MainEditFormBase extends EditFormControlBase {
wfstate: null,
wfversion: null,
wfstep: null,
createman: null,
hrtransferapplyid: null,
hrtransferapply:null,
};
......@@ -185,6 +186,8 @@ export class MainEditFormBase extends EditFormControlBase {
wfstep: new FormItemModel({ caption: '工作流步骤', detailType: 'FORMITEM', name: 'wfstep', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
hrtransferapplyid: new FormItemModel({ caption: '调动申请标识', detailType: 'FORMITEM', name: 'hrtransferapplyid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
......
......@@ -145,6 +145,11 @@ export default class MainModel {
prop: 'wfstep',
dataType: 'SSCODELIST',
},
{
name: 'createman',
prop: 'createman',
dataType: 'TEXT',
},
{
name: 'hrtransferapplyid',
prop: 'hrtransferapplyid',
......
......@@ -136,16 +136,6 @@
<app-file-upload :formState="formState" :ignorefieldvaluechange="ignorefieldvaluechange" @formitemvaluechange="onFormItemValueChange($event)" :data="JSON.stringify(this.data)" name='attachment' :value="data.attachment" :disabled="detailsModel.attachment.disabled" :uploadparams='{}' :exportparams='{}' style="overflow: auto;"></app-file-upload>
</app-form-item>
</i-col>
<i-col class="form-layout-container" v-show="detailsModel.organizationid.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='organizationid' :itemRules="this.rules.organizationid" class='' :caption="$t('entities.hrtransferapply.main_form.details.organizationid')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.organizationid.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='organizationid' :value="data.organizationid" dataType="PICKUPDATA" :precision="0"
:data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style="">
</app-span>
</app-form-item>
</i-col>
</row>
......
package cn.ibizlab.humanresource.core.humanresource.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 java.text.SimpleDateFormat;
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 org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;
/**
* 实体[档案借阅]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRARCHIVESBORROW",resultMap = "HRArchivesBorrowResultMap")
public class HRArchivesBorrow extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@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(isKeyField=true)
@TableId(value= "hrarchivesborrowid",type=IdType.ASSIGN_UUID)
@JSONField(name = "hrarchivesborrowid")
@JsonProperty("hrarchivesborrowid")
private String hrarchivesborrowid;
/**
* 档案借阅名称
*/
@TableField(value = "hrarchivesborrowname")
@JSONField(name = "hrarchivesborrowname")
@JsonProperty("hrarchivesborrowname")
private String hrarchivesborrowname;
/**
* 更新时间
*/
@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;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 设置 [档案借阅名称]
*/
public void setHrarchivesborrowname(String hrarchivesborrowname){
this.hrarchivesborrowname = hrarchivesborrowname ;
this.modify("hrarchivesborrowname",hrarchivesborrowname);
}
}
package cn.ibizlab.humanresource.core.humanresource.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.*;
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.humanresource.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.humanresource.core.humanresource.domain.HRArchivesBorrow;
/**
* 关系型数据实体[HRArchivesBorrow] 查询条件对象
*/
@Slf4j
@Data
public class HRArchivesBorrowSearchContext extends QueryWrapperContext<HRArchivesBorrow> {
private String n_hrarchivesborrowname_like;//[档案借阅名称]
public void setN_hrarchivesborrowname_like(String n_hrarchivesborrowname_like) {
this.n_hrarchivesborrowname_like = n_hrarchivesborrowname_like;
if(!ObjectUtils.isEmpty(this.n_hrarchivesborrowname_like)){
this.getSearchCond().like("hrarchivesborrowname", n_hrarchivesborrowname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("hrarchivesborrowname", query)
);
}
}
}
package cn.ibizlab.humanresource.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
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.humanresource.core.humanresource.domain.HRArchivesBorrow;
import cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesBorrowSearchContext;
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 HRArchivesBorrowMapper extends BaseMapper<HRArchivesBorrow>{
Page<HRArchivesBorrow> searchDefault(IPage page, @Param("srf") HRArchivesBorrowSearchContext context, @Param("ew") Wrapper<HRArchivesBorrow> wrapper) ;
@Override
HRArchivesBorrow selectById(Serializable id);
@Override
int insert(HRArchivesBorrow entity);
@Override
int updateById(@Param(Constants.ENTITY) HRArchivesBorrow entity);
@Override
int update(@Param(Constants.ENTITY) HRArchivesBorrow entity, @Param("ew") Wrapper<HRArchivesBorrow> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.humanresource.core.humanresource.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 org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.humanresource.core.humanresource.domain.HRArchivesBorrow;
import cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesBorrowSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[HRArchivesBorrow] 服务对象接口
*/
public interface IHRArchivesBorrowService extends IService<HRArchivesBorrow>{
boolean create(HRArchivesBorrow et) ;
void createBatch(List<HRArchivesBorrow> list) ;
boolean update(HRArchivesBorrow et) ;
void updateBatch(List<HRArchivesBorrow> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
HRArchivesBorrow get(String key) ;
HRArchivesBorrow getDraft(HRArchivesBorrow et) ;
boolean checkKey(HRArchivesBorrow et) ;
boolean save(HRArchivesBorrow et) ;
void saveBatch(List<HRArchivesBorrow> list) ;
Page<HRArchivesBorrow> searchDefault(HRArchivesBorrowSearchContext 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);
List<HRArchivesBorrow> getHrarchivesborrowByIds(List<String> ids) ;
List<HRArchivesBorrow> getHrarchivesborrowByEntities(List<HRArchivesBorrow> entities) ;
}
package cn.ibizlab.humanresource.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
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.humanresource.core.humanresource.domain.HRArchivesBorrow;
import cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesBorrowSearchContext;
import cn.ibizlab.humanresource.core.humanresource.service.IHRArchivesBorrowService;
import cn.ibizlab.humanresource.util.helper.CachedBeanCopier;
import cn.ibizlab.humanresource.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.humanresource.core.humanresource.mapper.HRArchivesBorrowMapper;
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("HRArchivesBorrowServiceImpl")
public class HRArchivesBorrowServiceImpl extends ServiceImpl<HRArchivesBorrowMapper, HRArchivesBorrow> implements IHRArchivesBorrowService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(HRArchivesBorrow et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getHrarchivesborrowid()),et);
return true;
}
@Override
public void createBatch(List<HRArchivesBorrow> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(HRArchivesBorrow et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("hrarchivesborrowid",et.getHrarchivesborrowid())))
return false;
CachedBeanCopier.copy(get(et.getHrarchivesborrowid()),et);
return true;
}
@Override
public void updateBatch(List<HRArchivesBorrow> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public HRArchivesBorrow get(String key) {
HRArchivesBorrow et = getById(key);
if(et==null){
et=new HRArchivesBorrow();
et.setHrarchivesborrowid(key);
}
else{
}
return et;
}
@Override
public HRArchivesBorrow getDraft(HRArchivesBorrow et) {
return et;
}
@Override
public boolean checkKey(HRArchivesBorrow et) {
return (!ObjectUtils.isEmpty(et.getHrarchivesborrowid()))&&(!Objects.isNull(this.getById(et.getHrarchivesborrowid())));
}
@Override
@Transactional
public boolean save(HRArchivesBorrow et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(HRArchivesBorrow et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<HRArchivesBorrow> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<HRArchivesBorrow> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<HRArchivesBorrow> searchDefault(HRArchivesBorrowSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HRArchivesBorrow> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<HRArchivesBorrow>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@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;
}
@Override
public List<HRArchivesBorrow> getHrarchivesborrowByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<HRArchivesBorrow> getHrarchivesborrowByEntities(List<HRArchivesBorrow> entities) {
List ids =new ArrayList();
for(HRArchivesBorrow entity : entities){
Serializable id=entity.getHrarchivesborrowid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
<?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.humanresource.core.humanresource.mapper.HRArchivesBorrowMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HRArchivesBorrowResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRARCHIVESBORROWID`, t1.`HRARCHIVESBORROWNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRARCHIVESBORROW` t1 ) t1 where hrarchivesborrowid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HRArchivesBorrowResultMap" type="cn.ibizlab.humanresource.core.humanresource.domain.HRArchivesBorrow" autoMapping="true">
<id property="hrarchivesborrowid" column="hrarchivesborrowid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.humanresource.filter.HRArchivesBorrowSearchContext" resultMap="HRArchivesBorrowResultMap">
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.`HRARCHIVESBORROWID`, t1.`HRARCHIVESBORROWNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRARCHIVESBORROW` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRARCHIVESBORROWID`, t1.`HRARCHIVESBORROWNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRARCHIVESBORROW` t1
]]>
</sql>
</mapper>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册