package org.ccpit.business.taxableGoods;

import javax.transaction.Transactional;

import org.ccpit.base.controller.Page;
import org.ccpit.base.controller.PageRequest;
import org.ccpit.base.logManage.LogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Transactional
@Service
public class TaxableGoodsService {
	@Autowired
	private TaxableGoodsDao taxableGoodsDao;
	@Autowired
	private LogInfoService logInfoService;

	public Page<TaxableGoods> queryTaxableGoodsList(PageRequest pageRequest,
                                                    String taxNumber) {
		StringBuffer hql = new StringBuffer("from TaxableGoods where 1=1");
		if (taxNumber != null && !"".equals(taxNumber)) {
			hql.append(" and taxNumber like '%" + taxNumber + "%'");
		}
		hql.append("  order by taxNumber");
		Page<TaxableGoods> pageInformation = taxableGoodsDao.findPage(
				pageRequest, hql.toString(), null);
		return pageInformation;
	}
}
