dictbiz.java
来自「crm系统 有源码 及相关文档sql2005 数据库 客户反馈模块」· Java 代码 · 共 93 行
JAVA
93 行
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 + =
减小字号Ctrl + -
显示快捷键?