📄 dictbiz.java
字号:
package org.jb.y272.team0.biz;
import java.io.Serializable;
import java.util.List;
import org.jb.common.biz.BaseBiz;
import org.jb.common.util.PageResult;
import org.jb.y272.team0.entity.BasDict;
/**
* 管理业务逻辑类
* @author hailong.liu
*/
public class DictBiz extends BaseBiz {
/* 复杂业务方法 */
/* 简单业务方法 */
/**
* 加载
*/
public BasDict get(Serializable id){
BasDict ret = (BasDict)this.getCommonDAO().get(BasDict.class, id);
return ret;
}
/**
* 添加
*/
public boolean add(BasDict item){
this.getCommonDAO().add(item);
return true;
}
/**
* 删除
*/
public boolean del(Serializable id){
this.getCommonDAO().del(BasDict.class, id);
return true;
}
/**
* 修改
*/
public boolean update(BasDict item){
this.getCommonDAO().update(item);
return true;
}
/**
* 查询
*/
public void search(BasDict condition, PageResult pageResult) {
String hql = "select o from BasDict o where 1=1 ";
if (null!=condition){
if (isNotNullOrEmpty(condition.getDictType())){
hql += "and o.dictType like '%"
+condition.getDictType()+"%' ";
}
if (isNotNullOrEmpty(condition.getDictItem())){
hql += "and o.dictItem like '%"
+condition.getDictItem()+"%' ";
}
if (isNotNullOrEmpty(condition.getDictValue())){
hql += "and o.dictValue like '%"
+condition.getDictValue()+"%' ";
}
}
if (isNotNullOrEmpty(pageResult.getOrderBy())){
String sort = pageResult.getSort();
hql += "order by " + pageResult.getOrderBy() + " " +sort;
if ("asc".equals(sort)){
pageResult.setSort("desc");
}else{
pageResult.setSort("asc");
}
}else{
hql += "order by o.dictId desc";
}
this.getCommonDAO().listByPage(hql,pageResult);
}
public List getList(String type) {
String hql = "select o from BasDict o where o.dictType='"+type+"' ";
return this.getCommonDAO().list(hql);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -