| | |
| | | package com.ld.igds.m.service; |
| | | |
| | | import com.bstek.bdf2.core.orm.hibernate.HibernateDao; |
| | | import com.ld.igds.models.Credit; |
| | | import com.ld.igds.models.InoutCredit; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.Session; |
| | |
| | | @Component |
| | | public class HCreditService extends HibernateDao { |
| | | |
| | | public List<Credit> listCredit(Map<String, Object> param) { |
| | | String hql = " from " + Credit.class.getName() + " where companyId=:companyId and deptId =:deptId "; |
| | | public List<InoutCredit> listCredit(Map<String, Object> param) { |
| | | String hql = " from " + InoutCredit.class.getName() + " where companyId=:companyId and deptId =:deptId "; |
| | | |
| | | Map<String, Object> args = new HashMap<String, Object>(); |
| | | args.put("companyId", ContextUtil.getCompanyId()); |
| | |
| | | return this.query(hql,args); |
| | | } |
| | | |
| | | public String saveCredit(Credit data) { |
| | | public String saveCredit(InoutCredit data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | if(StringUtils.isEmpty(data.getCompanyId())){ |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String delCredit(Credit data) { |
| | | public String delCredit(InoutCredit data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | if(null == data.getCompanyId()) data.setCompanyId(ContextUtil.getCompanyId()); |