📄 clienttypedao.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;
/**
* @author Administrator
*
*/
public class ClientTypeDAO extends BaseDAO
{
@SuppressWarnings("unchecked")
public ClientTypeDAO(Class ClientType) {
super(ClientType);
// TODO Auto-generated constructor stub
}
public void updates(ClientType clientType)
{
ClientType clientType1 = new ClientType();
clientType1=(ClientType) session.get(ClientType.class, clientType.getId());
clientType1.setName(clientType.getName());
session.update(clientType1);
}
@SuppressWarnings("unchecked")
public List<ClientType> lists(ClientType clientType){
List<ClientType> list=new ArrayList<ClientType>();
String sql="from ClientType t where 1=1 ";
if(clientType.getName()!=null&&clientType.getName().trim()!=""){
sql+=" and t.name like '%"+clientType.getName().trim()+"%' ";
}
Query query=session.createQuery(sql);
list=query.list();
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -