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

📄 cstcustomerbiz.java

📁 实现用户关系管理系统
💻 JAVA
字号:
package org.jb.y2t308.team3.biz;

import java.util.List;

import org.jb.common.biz.BaseBiz;
import org.jb.common.util.PageResult;
import org.jb.y2t308.team3.entity.CstCustomer;

public class CstCustomerBiz extends BaseBiz {

	/***************************************************************************
	 * 查询用户列表
	 */
	public void getList(CstCustomer item, PageResult pageResult) {
		String hql = "select o from CstCustomer o where 1=1 ";
		if (null != item) {
			if (isNotNullOrEmpty(item.getCustName())) {
				hql += "and o.custName like '%" + item.getCustName() + "%' ";
			}
			if (item.getCustStatus() != null && item.getCustLevel() != -1) {
				hql += "and o.custLevel= " + item.getCustLevel() + " ";
			}
		}
		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.custNo desc,o.custName asc";
		}
		this.getCommonDAO().listByPage(hql, pageResult);
	}

	/***************************************************************************
	 * 客户修改更新
	 * 
	 * @param item
	 */

	public void update(CstCustomer item) {
		this.getCommonDAO().update(item);

	}

	/***************************************************************************
	 * 根据客户编号查询客户
	 * 
	 * @param item
	 */

	public CstCustomer get(String custNo) {

		Object object = this.getCommonDAO().get(CstCustomer.class, custNo);
		CstCustomer object2 = (CstCustomer) object;
		return object2;
	}

	/***************************************************************************
	 * 根据客户编号 删除客户户
	 * 
	 * @param item
	 */
	public void delete(String custNo) {
		this.getCommonDAO().del(CstCustomer.class, custNo);

	}

}

⌨️ 快捷键说明

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