⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 planbiz.java

📁 crm系统 有源码 及相关文档sql2005 数据库 客户反馈模块
💻 JAVA
字号:
package org.jb.y272.team0.biz;

import java.io.Serializable;

import org.jb.common.biz.BaseBiz;
import org.jb.common.util.PageResult;
import org.jb.y272.team0.entity.SalPlan;

/**
 *  管理业务逻辑类
 * @author hailong.liu
 */
public class PlanBiz extends BaseBiz {
	/*   复杂业务方法    */
	
	
	/*   简单业务方法    */
	/**
	 * 加载 
	 */
	public SalPlan get(Serializable id){
		SalPlan ret = (SalPlan)this.getCommonDAO().get(SalPlan.class, id);		
		return ret;
	}
	
	/**
	 * 添加 
	 */
	public boolean add(SalPlan item){
		this.getCommonDAO().add(item);		
		return true;
	}
	
	/**
	 * 删除 
	 */
	public boolean del(Serializable id){
		this.getCommonDAO().del(SalPlan.class, id);		
		return true;
	}
	
	/**
	 * 修改 
	 */
	public boolean update(SalPlan pla){
		Long id = pla.getPlaId();
		SalPlan item = this.get(id);
		item.setPlaTodo(pla.getPlaTodo());
		this.getCommonDAO().update(item);		
		return true;
	}
	public boolean exec(SalPlan pla){
		Long id = pla.getPlaId();
		SalPlan item = this.get(id);
		item.setPlaResult(pla.getPlaResult());
		this.getCommonDAO().update(item);		
		return true;
	}
	
	/**
	 * 查询  
	 */
	public void search(SalPlan condition, PageResult pageResult) {
		String hql = "select o from SalPlan o where 1=1 ";
		if (null!=condition){				
			
			
				if (isNotNullOrEmpty(condition.getPlaTodo())){
				hql += "and o.plaTodo like '%"
						+condition.getPlaTodo()+"%' ";
			}

				if (isNotNullOrEmpty(condition.getPlaResult())){
				hql += "and o.plaResult like '%"
						+condition.getPlaResult()+"%' ";
			}

		}
		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.plaId desc";
		}		
		this.getCommonDAO().listByPage(hql,pageResult);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -