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

📄 financedaoimpl.java

📁 一个关于tlms的一个小程序 看看能否帮助到别人
💻 JAVA
字号:
/**
 * ============================================= 
 * Copyright 2006 szmx
 *
 * Change Revision
 * --------------------------------
 *   Date                Author         Remarks
 *   2006-4-24        hliu     Create com.szmx.tlms.finance.dao.impl.AccountAndVoucherDaoImpl
 * =============================================
 */
package com.szmx.tlms.finance.dao.impl;

import com.szmx.framework.base.dao.impl.BaseDaoImpl;
import com.szmx.framework.base.model.Pagination;
import com.szmx.framework.util.StringUtil;
import com.szmx.tlms.finance.dao.FinanceDao;
import com.szmx.tlms.finance.model.AccountDrCr;

import java.util.Map;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.hibernate.criterion.MatchMode;


/**
 * <desc>
 *
 * @author hliu
 * @since 2006-4-24
 */
public class FinanceDaoImpl  extends BaseDaoImpl implements FinanceDao {

//----------------This section is the  Account Dr & Cr  implement Start---------------

    /**
     * @see FinanceDao#getAccountDrCrs(com.szmx.framework.base.model.Pagination, java.util.Map)
     */
    public Pagination getAccountDrCrs(final Pagination paginationObj, final Map paraMap) {
          AccountDrCr accountDrCr = (AccountDrCr) paraMap.get("searchBean");
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(AccountDrCr.class);
        if (accountDrCr != null) {

            if (accountDrCr.getDr() != null) {
                detachedCriteria.add(Restrictions.eq("isDr",
                        accountDrCr.getDr()));
            }

            if (!StringUtil.isNull(accountDrCr.getAccountNo())) {
                detachedCriteria.add(Restrictions.like("accountNo",
                        accountDrCr.getAccountNo(),
                        MatchMode.ANYWHERE));
            }
        }

        return findPageByCriteria(detachedCriteria, paginationObj);
    }

     /**
     * @see FinanceDao#saveAccountDrCr(com.szmx.tlms.finance.model.AccountDrCr)
     */
    public void saveAccountDrCr(final AccountDrCr accountDrCr) {
        getHibernateTemplate().saveOrUpdate(accountDrCr);
    }

     /**
     * @see FinanceDao#getAccountDrCr(Long)
     */
     public AccountDrCr getAccountDrCr(final Long id) {
         return (AccountDrCr) getHibernateTemplate().get(AccountDrCr.class, id);
     }

     /**
     * @see FinanceDao#removeAccountDrCr(Long)
     */
    public void removeAccountDrCr(final Long id) {
       getHibernateTemplate().delete(getAccountDrCr(id));
    }

//----------------This section is the   Account Dr & Cr  implement End---------------


}

⌨️ 快捷键说明

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