📄 storehousedao.java
字号:
package com.dao;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.common.resources.Resources;
import java.io.Reader;
import java.io.IOException;
import java.util.List;
import java.sql.SQLException;
import com.tool.pagetool.*;
import com.bean.*;
public class StorehouseDAO extends PageDAO{
public static List selectAllStorehouse() throws SQLException {
return sqlMapper.queryForList("selectAllStorehouse");
}
public static Storehouse selectStorehouseByshId(int id) throws SQLException {
return (Storehouse) sqlMapper.queryForObject("selectStorehouseByshId", new Integer(id));
}
public static boolean selectIsHasStorehouse(String whereStr)throws SQLException{
boolean flag = false;
Object obj = sqlMapper.queryForObject("selectIsHasStorehouse",whereStr);
if(obj!=null) return true;
return flag;
}
public static void insertStorehouse(Storehouse storehouse) throws SQLException {
sqlMapper.insert("insertStorehouse", storehouse);
}
public static boolean selectStorehouseIsHasRefer(Storehouse storehouse)throws SQLException{
boolean flag = false;
Storehouse tmp = StorehouseDAO.selectStorehouseByshId(storehouse.getShId());
if(tmp.getIsUsed()>0) flag=true;
return flag;
}
public static void updateStorehouse(Storehouse storehouse) throws SQLException {
sqlMapper.update("updateStorehouse", storehouse);
}
public static void updateStorehouseSI(Storehouse storehouse) throws SQLException {
sqlMapper.update("updateStorehouseSI", storehouse);
}
public static void deleteStorehouseByshId(int id) throws SQLException {
sqlMapper.delete("deleteStorehouseByshId", new Integer(id));
}
public int selectCount(Page page) throws SQLException{
return ((Integer)sqlMapper.queryForObject("selectStorehouseCount",page)).intValue();
}
public int selectCount() throws SQLException{
return ((Integer)sqlMapper.queryForObject("selectStorehouseCountNotP")).intValue();
}
public List selectForPage(Page page) throws SQLException{
List pageList = sqlMapper.queryForList("selectStorehouseForPage",page);
return pageList;
}
public static void startTransation()throws SQLException{
sqlMapper.startTransaction();
}
public static void startTransation(int i)throws SQLException{
sqlMapper.startTransaction(i);
}
public static void rollback() throws SQLException{
sqlMapper.endTransaction();
}
public static void commit()throws SQLException{
sqlMapper.commitTransaction();
}
public static int getLastId() throws SQLException{
Object obj = sqlMapper.queryForObject("selectStorehouseLastId");
if(obj==null) return 0;
else
return ((Integer)obj).intValue();
}
public static List selectAllStorehouseNameID() throws SQLException {
return sqlMapper.queryForList("selectStorehouseNameID");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -