YxyUserAddressDaoImpl.java 6.4 KB
package com.espeed.dao.impl;

import java.util.List;

import com.espeed.dao.YxyUserAddressDao;
import com.espeed.pojo.YxyUserAddress;
import com.espeed.vo.PageBean;

/**
 * 程序名称:    	EspeedMail_时速邮箱
 * 程序版本:    	V1.0
 * 作    者:    	深圳市科飞时速网络技术有限公司(0755-88843776)
 * 版权所有:    	深圳市科飞时速网络技术有限公司
 * 技术支持:    	Tech@21gmail.com
 * 单元名称:     用户地址库dao实现类(营销游)
 * 开始时间:    	2013.12.09
 * 程 序 员:    	谢勇
 * 最后修改:    
 * 备    注:		如需修改请通知程序员    
 */
public class YxyUserAddressDaoImpl extends HibernateBaseDAOImpl<YxyUserAddress, Long> implements YxyUserAddressDao{

	/**实体插入*/
	public int addPojo(YxyUserAddress o)throws Exception{
		return super.add(o);
	}
	/**实体编辑*/
	public void updatePojo(YxyUserAddress o)throws Exception{
		super.update(o);
	}
	/**HQL查询*/
	public List<YxyUserAddress> findByHql(String hql)throws Exception{
		return super.getAll(hql);
	}
	/**指定条记录*/
	public List<YxyUserAddress> findByHqlSet(String hql,int num)throws Exception{
		return super.findBySet(hql, num);
	}
	/**HQL查询分页*/
	public List<YxyUserAddress> findByHqlPage(String hql,String hqlcount,PageBean pb)throws Exception{
		return super.findByPage(hql, hqlcount, pb);
	}
	/**SQL查询*/
	public List<Object> findBySqlQuery(String sql)throws Exception{
		return super.findBySql(sql);
	}
	/**HQL更新*/
	public void updateByHql(String hql)throws Exception{
		super.updateorDelByHql(hql);
	}
	/**实体批量插入*/
	public void addPojoPi(List<YxyUserAddress> o) throws Exception {
		super.addPi(o);
	}
	/**HQL数量查询*/
	public int findByHqlCount(String hql)throws Exception{
		return super.count(hql);
	}
//	/**批量添加地址库*/
//	public void addAddress(List<YxyUserAddress> o) throws Exception {
//		super.addPi(o);
//	}
//	
//	/**批量更新地址*/
//	public void updateAddress(List<YxyUserAddress> o) throws Exception {
//		super.updatePiAddress(o);
//	}
//	
//	/**查询用户地址库*/
//	public List<YxyUserAddress> findAddress(String loginid,String domain) throws Exception {
//		String hql="from YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"'";
//		return super.getAll(hql);
//	}
//	/**用户查询地址库*/
//	public List<YxyUserAddress> findAddressAll(String loginid, String domain)throws Exception{
//		String hql="from YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"'";
//		return super.getAll(hql);
//	}
//	/**分页查询用户地址库*/
//	public List<YxyUserAddress> findAddressPage(String loginid,String domain, PageBean pb,int addrTypeID)
//			throws Exception {
//		String hql="from YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"' and user_addr_type_id="+addrTypeID+" order by user_addr_add_date desc";
//		String hqlCount="select count(user_addr_id) from YxyUserAddress  where user_loginid='"+loginid+"' and user_domain='"+domain+"' and user_addr_type_id="+addrTypeID+" order by user_addr_add_date desc";
//		return super.findByPage(hql, hqlCount,pb);
//	}
//	
//	/**分类查询用户地址库*/
//	public List<YxyUserAddress> findAddressByType(String loginid,
//			String domain, int addrTypeID) throws Exception {
//		String hql="from YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"' and user_addr_type_id="+addrTypeID;
//		return super.getAll(hql);
//	}
//	
//	/**单个添加地址库*/
//	public void addAddressSign(YxyUserAddress o) throws Exception {
//		super.saveOrUpdate(o);
//		
//	}
//	/**删除类别下的所有地址*/
//	public void delYxyAddressByType(String loginID, String domain, int typeID)throws Exception {
//		String sql="delete YxyUserAddress where user_loginid='"+loginID+"' and user_domain='"+domain+"' and user_addr_type_id="+typeID;
//		super.updateorDelBySql(sql);
//	}
//	/**删除地址*/
//	public void delYxyAddress(String loginID, String domain, String addressID)
//			throws Exception {
//		String sql="delete YxyUserAddress where user_loginid='"+loginID+"' and user_domain='"+domain+"' and user_addr_id in ("+addressID+")";
//		super.updateorDelBySql(sql);
//		
//	}
//	/**根据用户与时间删除*/
//	public void delYxyAddByTimer(String loginID, String domain, String date)
//			throws Exception {
//		String sql="delete YxyUserAddress where user_loginid='"+loginID+"' and user_domain='"+domain+"' and user_addr_add_date<'"+date+"'";
//		super.updateorDelBySql(sql);
//		
//	}
//	/**更新地址所属类别*/
//	public void updateYxyAddressType(String addressID, int typeID)
//			throws Exception {
//		String sql="update YxyUserAddress set user_addr_type_id="+typeID+" where user_addr_id in ("+addressID+")";
//		super.updateorDelBySql(sql);
//		
//	}
//	/**模糊查询地址*/
//	public List<YxyUserAddress> findAddressLike(String loginid, String domain,
//			String likeValue) throws Exception {
//		String hql="from YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"' and (user_addr_name like '%"+likeValue+"%' or user_addr_email like '%"+likeValue+"%')";
//		return super.getAll(hql);
//	}
//	
//	/**查询地址所属类别的数量*/
//	public List findAddrTypeNum(String loginid, String domain) throws Exception {
//		String sql="SELECT user_addr_type_id, COUNT(user_addr_id) FROM yxy_user_address WHERE user_loginid='"+loginid+"' AND user_domain='"+domain+"' GROUP BY user_addr_type_id";
//		return super.findBySql(sql);
//	}
//	
//	/**查询地址统计数据根据用户与时间*/
//	public List findAddressCountByDate(String loginid, String domain,
//			String date) throws Exception {		
//		String sql="";
//		if(date.equals("all")){
//			sql="SELECT COUNT(*)  FROM yxy_user_address WHERE user_domain='"+domain+"' AND user_loginid='"+loginid+"'";
//		}else{
//			sql="SELECT COUNT(*)  FROM yxy_user_address WHERE user_domain='"+domain+"' AND user_loginid='"+loginid+"' and user_addr_add_date like '%"+date+"%'";
//		}
//		return super.findBySql(sql);
//	}
//	/**判断该地址是否存在*/
//	public List findAddressIsexits(String loginid, String domain, String address)
//			throws Exception {
//		String sql="SELECT COUNT(*) FROM yxy_user_address WHERE user_loginid='"+loginid+"' AND user_domain='"+domain+"' and user_addr_email='"+address+"'";
//		return super.findBySql(sql);
//	}
//
//	/**HQL查询*/
//	public List<YxyUserAddress> findByHQL(String hql) throws Exception {
//		
//		return super.getAll(hql);
//	}

	
	
	
	
	

}