PickUpCityDaoImpl.java 2.19 KB
package com.diligrp.website.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.diligrp.website.dao.PickUpCityDao;
import com.diligrp.website.domain.PickUpCity;
import com.diligrp.website.util.dao.impl.BaseDaoImpl;


/**
 * <B>Description</B> TODO <br />
 * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
 * <B>Company</B> 地利集团
 * @createTime 2014年8月15日 上午11:08:45
 * @author liujie
 */
@Repository
public class PickUpCityDaoImpl extends BaseDaoImpl<PickUpCity> implements PickUpCityDao{
    private static final String PREFIX = PickUpCityDaoImpl.class
            .getCanonicalName();
    /* (non-Javadoc)
     * @see com.diligrp.website.dao.PickUpAddressDao#savePickUpCity(com.diligrp.website.domain.PickUpCity)
     */
    @Override
    public boolean savePickUpCity(PickUpCity pickUpCity) {
        return getSqlSessionTemplate().insert(PREFIX + ".INSERT-PICKUP-CITY-INFO", pickUpCity)>0;

    }

    /* (non-Javadoc)
     * @see com.diligrp.website.dao.PickUpAddressDao#getPickUpCityById(java.lang.Long)
     */
    @Override
    public List<PickUpCity> getPickUpCityById(Long id) {
        return getSqlSessionTemplate().selectList(PREFIX + ".SELECT-PICK-UP-CITY-INFO", id);
    }

    /* (non-Javadoc)
     * @see com.diligrp.website.dao.PickUpCityDao#deletePickUpCityById(java.lang.Long)
     */
    @Override
    public boolean deletePickUpCityById(Long pickId) {
        return getSqlSessionTemplate().delete(PREFIX + ".DELETE-PICKUP-CITY-BY-PICKID", pickId)>0;
    }

    /* (non-Javadoc)
     * @see com.diligrp.website.dao.PickUpCityDao#getAllCity()
     */
    @Override
    public List<PickUpCity> getAllCity() {
        return getSqlSessionTemplate().selectList(PREFIX + ".SELECT-All-CITY-INFO");
    }

	@Override
	public PickUpCity getPickIdByCityId(Long cityId) {
		return getSqlSessionTemplate().selectOne(PREFIX + ".SELECT-PICKID-BY-CITYID",cityId);
	}

    @Override
    public List<PickUpCity> getPickUpIdListByCityId(Long cityId) {
        return getSqlSessionTemplate().selectList(PREFIX + ".SELECT-PICKID-BY-CITYID", cityId);
    }
}