kucunbusiness.java
来自「企业进销存源码」· Java 代码 · 共 74 行
JAVA
74 行
package com.business;
import java.util.HashMap;
import java.util.List;
import com.business.vo.KuCun;
import com.dao.util.DaoImp;
/**
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class KuCunBusiness {
public void add(KuCun vo) throws Exception{
try{
String str = "insert into KuCun(goodsId,Num) values('"+vo.getGoodsId()+"','"+vo.getNum()+"')";
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void edit(KuCun vo) throws Exception{
try{
String str = "update kuCun set goodsId = '"+vo.getGoodsId()+"',Num = '"+vo.getNum()+"' where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void remove(KuCun vo) throws Exception{
try{
String str = "delete from KuCun where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public HashMap findByGoodsId(String key) throws Exception{
try{
String str = "select * from KuCun where goodsId = "+key+"";
DaoImp dao = new DaoImp();
return dao.find(str);
}catch(Exception e){
return null;
}
}
public HashMap find(String key) throws Exception{
try{
String str = "select * from KuCun where Id = "+key+"";
DaoImp dao = new DaoImp();
return dao.find(str);
}catch(Exception e){
return null;
}
}
public List select()throws Exception {
try {
String str = "select a.*,b.* from KuCun a,goods b where a.goodsId=b.Id";
DaoImp dao = new DaoImp();
return dao.select(str);
} catch (Exception e) {
return null;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?