📄 productiontypedao.java
字号:
/**
*
*/
package com.qrsx.qrsxcrm.dao;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Query;
import com.qrsx.qrsxcrm.model.ClientType;
import com.qrsx.qrsxcrm.model.ProductionType;
import com.qrsx.qrsxcrm.model.ServiceType;
/**
* @author Administrator
*
*/
public class ProductionTypeDAO extends BaseDAO
{
@SuppressWarnings("unchecked")
public ProductionTypeDAO(Class ProductionType) {
super(ProductionType);
// TODO Auto-generated constructor stub
}
public void updates(ProductionType productionType)
{
ProductionType productionType1 = new ProductionType();
productionType1=(ProductionType) session.get(ProductionType.class, productionType.getId());
productionType1.setName(productionType.getName());
session.update(productionType1);
}
@SuppressWarnings("unchecked")
public List<ProductionType> lists(ProductionType productionType){
List<ProductionType> list=new ArrayList<ProductionType>();
String sql="from ProductionType t where 1=1 ";
if(productionType.getName()!=null&&productionType.getName().trim()!=""){
sql+=" and t.name like '%"+productionType.getName().trim()+"%' ";
}
Query query=session.createQuery(sql);
list=query.list();
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -