升级代码结构,采用Maven来管理jar包(10)

This commit is contained in:
季圣华
2017-02-15 22:55:46 +08:00
parent 11f18afad6
commit e85498f6f4
185 changed files with 19714 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package com.jsh.dao.materials;
import org.hibernate.Query;
import com.jsh.base.BaseDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.AccountHead;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
public class AccountHeadDAO extends BaseDAO<AccountHead> implements AccountHeadIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<AccountHead> getEntityClass()
{
return AccountHead.class;
}
@SuppressWarnings("unchecked")
@Override
public void find(PageUtil<AccountHead> pageUtil,String maxid) throws JshException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from AccountHead accountHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
}

View File

@@ -0,0 +1,15 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.AccountHead;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.PageUtil;
public interface AccountHeadIDAO extends BaseIDAO<AccountHead>
{
/*
* 获取MaxId
*/
void find(PageUtil<AccountHead> pageUtil,String maxid) throws JshException;
}

View File

@@ -0,0 +1,22 @@
package com.jsh.dao.materials;
import org.hibernate.Query;
import com.jsh.base.BaseDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.AccountItem;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
public class AccountItemDAO extends BaseDAO<AccountItem> implements AccountItemIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<AccountItem> getEntityClass()
{
return AccountItem.class;
}
}

View File

@@ -0,0 +1,12 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.AccountItem;
import com.jsh.util.PageUtil;
public interface AccountItemIDAO extends BaseIDAO<AccountItem>
{
}

View File

@@ -0,0 +1,32 @@
package com.jsh.dao.materials;
import org.hibernate.Query;
import com.jsh.base.BaseDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<DepotHead> getEntityClass()
{
return DepotHead.class;
}
@SuppressWarnings("unchecked")
@Override
public void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException
{
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
}

View File

@@ -0,0 +1,15 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.PageUtil;
public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
{
/*
* 获取MaxId
*/
void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException;
}

View File

@@ -0,0 +1,58 @@
package com.jsh.dao.materials;
import org.hibernate.Query;
import com.jsh.base.BaseDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem;
import com.jsh.util.PageUtil;
import com.jsh.util.SearchConditionUtil;
public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<DepotItem> getEntityClass()
{
return DepotItem.class;
}
@SuppressWarnings("unchecked")
@Override
public void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId,String MonthTime,Boolean isPrev) throws JshException
{
//多表联查,多表连查此处用到了createSQLQuery可以随便写sql语句很方便
Query query;
if(isPrev) {
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime <'"+ MonthTime +"-01 00:00:00' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
}
else {
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime >='"+ MonthTime +"-01 00:00:00' and jsh_depothead.OperTime <='"+ MonthTime +"-31 00:00:00' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
}
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
@SuppressWarnings("unchecked")
@Override
public void buyOrSale(PageUtil<DepotItem> pageUtil,String type, String subType,Long MId,String MonthTime, String sumType) throws JshException
{
//多表联查,多表连查此处用到了createSQLQuery可以随便写sql语句很方便
Query query;
if(sumType.equals("Number")) {
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and subType='" + subType +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime >='"+ MonthTime +"-01 00:00:00' and jsh_depothead.OperTime <='"+ MonthTime +"-31 00:00:00' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
}
else {
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='" + type +"' and subType='" + subType +"' and MaterialId ="+ MId + " and jsh_depothead.OperTime >='"+ MonthTime +"-01 00:00:00' and jsh_depothead.OperTime <='"+ MonthTime +"-31 00:00:00' " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
}
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
}

View File

@@ -0,0 +1,14 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem;
import com.jsh.util.PageUtil;
public interface DepotItemIDAO extends BaseIDAO<DepotItem>
{
void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId, String MonthTime,Boolean isPrev) throws JshException;
void buyOrSale(PageUtil<DepotItem> pageUtil,String type, String subType,Long MId, String MonthTime, String sumType) throws JshException;
}

View File

@@ -0,0 +1,17 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.MaterialCategory;
public class MaterialCategoryDAO extends BaseDAO<MaterialCategory> implements MaterialCategoryIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<MaterialCategory> getEntityClass()
{
return MaterialCategory.class;
}
}

View File

@@ -0,0 +1,9 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.MaterialCategory;
public interface MaterialCategoryIDAO extends BaseIDAO<MaterialCategory>
{
}

View File

@@ -0,0 +1,17 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.Material;
public class MaterialDAO extends BaseDAO<Material> implements MaterialIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<Material> getEntityClass()
{
return Material.class;
}
}

View File

@@ -0,0 +1,9 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.Material;
public interface MaterialIDAO extends BaseIDAO<Material>
{
}

View File

@@ -0,0 +1,17 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseDAO;
import com.jsh.model.po.Person;
public class PersonDAO extends BaseDAO<Person> implements PersonIDAO
{
/**
* 设置dao映射基类
* @return
*/
@Override
public Class<Person> getEntityClass()
{
return Person.class;
}
}

View File

@@ -0,0 +1,9 @@
package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO;
import com.jsh.model.po.Person;
public interface PersonIDAO extends BaseIDAO<Person>
{
}