升级代码结构,采用Maven来管理jar包(10)
This commit is contained in:
32
src/main/java/com/jsh/dao/materials/AccountHeadDAO.java
Normal file
32
src/main/java/com/jsh/dao/materials/AccountHeadDAO.java
Normal 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());
|
||||
}
|
||||
}
|
||||
15
src/main/java/com/jsh/dao/materials/AccountHeadIDAO.java
Normal file
15
src/main/java/com/jsh/dao/materials/AccountHeadIDAO.java
Normal 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;
|
||||
}
|
||||
22
src/main/java/com/jsh/dao/materials/AccountItemDAO.java
Normal file
22
src/main/java/com/jsh/dao/materials/AccountItemDAO.java
Normal 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;
|
||||
}
|
||||
}
|
||||
12
src/main/java/com/jsh/dao/materials/AccountItemIDAO.java
Normal file
12
src/main/java/com/jsh/dao/materials/AccountItemIDAO.java
Normal 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>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
32
src/main/java/com/jsh/dao/materials/DepotHeadDAO.java
Normal file
32
src/main/java/com/jsh/dao/materials/DepotHeadDAO.java
Normal 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());
|
||||
}
|
||||
}
|
||||
15
src/main/java/com/jsh/dao/materials/DepotHeadIDAO.java
Normal file
15
src/main/java/com/jsh/dao/materials/DepotHeadIDAO.java
Normal 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;
|
||||
}
|
||||
58
src/main/java/com/jsh/dao/materials/DepotItemDAO.java
Normal file
58
src/main/java/com/jsh/dao/materials/DepotItemDAO.java
Normal 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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
14
src/main/java/com/jsh/dao/materials/DepotItemIDAO.java
Normal file
14
src/main/java/com/jsh/dao/materials/DepotItemIDAO.java
Normal 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;
|
||||
}
|
||||
17
src/main/java/com/jsh/dao/materials/MaterialCategoryDAO.java
Normal file
17
src/main/java/com/jsh/dao/materials/MaterialCategoryDAO.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
{
|
||||
|
||||
}
|
||||
17
src/main/java/com/jsh/dao/materials/MaterialDAO.java
Normal file
17
src/main/java/com/jsh/dao/materials/MaterialDAO.java
Normal 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;
|
||||
}
|
||||
}
|
||||
9
src/main/java/com/jsh/dao/materials/MaterialIDAO.java
Normal file
9
src/main/java/com/jsh/dao/materials/MaterialIDAO.java
Normal 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>
|
||||
{
|
||||
|
||||
}
|
||||
17
src/main/java/com/jsh/dao/materials/PersonDAO.java
Normal file
17
src/main/java/com/jsh/dao/materials/PersonDAO.java
Normal 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;
|
||||
}
|
||||
}
|
||||
9
src/main/java/com/jsh/dao/materials/PersonIDAO.java
Normal file
9
src/main/java/com/jsh/dao/materials/PersonIDAO.java
Normal 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>
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user