cstcustomerbiz.java

来自「实现用户关系管理系统」· Java 代码 · 共 73 行

JAVA
73
字号
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 + =
减小字号Ctrl + -
显示快捷键?