📄 bsbookinfo.java
字号:
"VALUES('"+nationName+"','"+sort+"')";
dbconn.execute(sql);
}
/**
* 修改国别信息
* @param id
* @param nationName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void modifyNation(String id,
String nationName,
String sort)throws SQLException,IOException
{
String sql = "";
sql = "update nation_manager set nationName = '"+nationName+"'," +
"nationSort='"+sort+"' where id='"+id+"' ";
dbconn.execute(sql);
}
/**
* 删除国别信息
* @param id
* @throws SQLException
* @throws IOException
*/
public void deleteNation(String id)throws SQLException,IOException
{
String sql = "";
sql = "delete from nation_manager where id = '"+id+"' ";
dbconn.execute(sql);
}
/**
* 列出所有国别
* @return
* @throws SQLException
* @throws IOException
*/
public Vector getAllNation()throws SQLException,IOException
{
Vector v = null;
String sql = "";
sql = "select * from nation_manager order by nationSort ";
v = dbconn.ListOfMapData(sql);
return v;
}
/**
* 取出国别信息的最大序号
* @return String
* @throws SQLException
* @throws IOException
*/
public String getMaxSortNation() throws SQLException,IOException
{
Vector v = null;
String sort = "";
String sql = "";
sql = "select max(nationSort) as classifySort from nation_manager ";
v = dbconn.ListOfMapData(sql);
Map map = (Map)v.get(0);
sort = (String)map.get("classifySort");
if(sort == null)sort="0";
return sort;
}
/**
* 根据ID找到相对应的国别名称
* @param id
* @return String
* @throws SQLException
* @throws IOException
*/
public String getNameByNationId(String id) throws SQLException,IOException
{
Vector v = null;
String classifyName = "";
String sql = "";
sql = "select nationName from nation_manager where id = '"+id+"' ";
v = dbconn.ListOfMapData(sql);
if(v.size()>0)
{
Map map = (Map)v.get(0);
classifyName = (String)map.get("nationName");
}
return classifyName;
}
/**
* 添加馆区信息
* @param libraryName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void addLibrary(String libraryName,
String sort) throws SQLException,IOException
{
String sql = "";
sql = "insert into library_manager(libraryName,librarySort) " +
"VALUES('"+libraryName+"','"+sort+"')";
dbconn.execute(sql);
}
/**
* 列出所有的馆区信息
* @return
* @throws SQLException
* @throws IOException
*/
public Vector getAllLibrary()throws SQLException,IOException
{
Vector v = null;
String sql = "";
sql = "select * from library_manager order by librarySort ";
v = dbconn.ListOfMapData(sql);
return v;
}
/**
* 根据ID找到相对应的馆区名称
* @param id
* @return String
* @throws SQLException
* @throws IOException
*/
public String getNameByLibraryId(String id) throws SQLException,IOException
{
Vector v = null;
String classifyName = "";
String sql = "";
sql = "select libraryName from library_manager where id = '"+id+"' ";
v = dbconn.ListOfMapData(sql);
if(v.size()>0)
{
Map map = (Map)v.get(0);
classifyName = (String)map.get("libraryName");
}
return classifyName;
}
/**
* 取出馆区信息的最大序号
* @return String
* @throws SQLException
* @throws IOException
*/
public String getMaxSortLibrary() throws SQLException,IOException
{
Vector v = null;
String sort = "";
String sql = "";
sql = "select max(librarySort) as classifySort from library_manager ";
v = dbconn.ListOfMapData(sql);
Map map = (Map)v.get(0);
sort = (String)map.get("classifySort");
if(sort == null)sort="0";
return sort;
}
/**
* 修改馆区信息
* @param id
* @param libraryName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void modifyLibrary(String id,
String libraryName,
String sort)throws SQLException,IOException
{
String sql = "";
sql = "update library_manager set libraryName = '"+libraryName+"'," +
"librarySort='"+sort+"' where id='"+id+"' ";
dbconn.execute(sql);
}
/**
* 删除馆区信息
* @param id
* @throws SQLException
* @throws IOException
*/
public void deleteLibrary(String id)throws SQLException,IOException
{
String sql = "";
sql = "delete from library_manager where id = '"+id+"' ";
dbconn.execute(sql);
}
/**
* 添加包装信息
* @param packageName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void addPackageing(String packageName,
String sort) throws SQLException,IOException
{
String sql = "";
sql = "insert into packaging_manager(packagingName,packagingSort) " +
"VALUES('"+packageName+"','"+sort+"')";
dbconn.execute(sql);
}
/**
* 列出所有包装信息
* @return Vector
* @throws SQLException
* @throws IOException
*/
public Vector getAllPackage()throws SQLException,IOException
{
Vector v = null;
String sql = "";
sql = "select * from packaging_manager order by packagingSort ";
v = dbconn.ListOfMapData(sql);
return v;
}
/**
* 列出包装的最大序号
* @return String
* @throws SQLException
* @throws IOException
*/
public String getMaxSortPackage() throws SQLException,IOException
{
Vector v = null;
String sort = "";
String sql = "";
sql = "select max(packagingSort) as classifySort from packaging_manager ";
v = dbconn.ListOfMapData(sql);
Map map = (Map)v.get(0);
sort = (String)map.get("classifySort");
if(sort == null)sort="0";
return sort;
}
/**
* 根据ID找到相对应的包装名称
* @param id
* @return String
* @throws SQLException
* @throws IOException
*/
public String getNameByPackageId(String id) throws SQLException,IOException
{
Vector v = null;
String classifyName = "";
String sql = "";
sql = "select packagingName from packaging_manager where id = '"+id+"' ";
v = dbconn.ListOfMapData(sql);
if(v.size()>0)
{
Map map = (Map)v.get(0);
classifyName = (String)map.get("packagingName");
}
return classifyName;
}
/**
* 修改包装信息
* @param id
* @param packagingName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void modifyPackage(String id,
String packagingName,
String sort)throws SQLException,IOException
{
String sql = "";
sql = "update packaging_manager set packagingName = '"+packagingName+"'," +
"packagingSort='"+sort+"' where id='"+id+"' ";
dbconn.execute(sql);
}
/**
* 删除包装信息
* @param id
* @throws SQLException
* @throws IOException
*/
public void deletePackage(String id)throws SQLException,IOException
{
String sql = "";
sql = "delete from packaging_manager where id = '"+id+"' ";
dbconn.execute(sql);
}
/**
* 添加开本信息
* @param formatName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void addFormat(String formatName,
String sort) throws SQLException,IOException
{
String sql = "";
sql = "insert into format_manager(formatName,formatSort) " +
"VALUES('"+formatName+"','"+sort+"')";
dbconn.execute(sql);
}
/**
* 列出所有的开本信息
* @return Vector
* @throws SQLException
* @throws IOException
*/
public Vector getAllFormat()throws SQLException,IOException
{
Vector v = null;
String sql = "";
sql = "select * from format_manager order by formatSort ";
v = dbconn.ListOfMapData(sql);
return v;
}
/**
* 列出开本的最大序号
* @return String
* @throws SQLException
* @throws IOException
*/
public String getMaxSortFormat() throws SQLException,IOException
{
Vector v = null;
String sort = "";
String sql = "";
sql = "select max(formatSort) as classifySort from format_manager ";
v = dbconn.ListOfMapData(sql);
Map map = (Map)v.get(0);
sort = (String)map.get("classifySort");
if(sort == null)sort="0";
return sort;
}
/**
* 根据ID找到相对应的开本名称
* @param id
* @return String
* @throws SQLException
* @throws IOException
*/
public String getNameByFormatId(String id) throws SQLException,IOException
{
Vector v = null;
String classifyName = "";
String sql = "";
sql = "select formatName from format_manager where id = '"+id+"' ";
v = dbconn.ListOfMapData(sql);
if(v.size()>0)
{
Map map = (Map)v.get(0);
classifyName = (String)map.get("formatName");
}
return classifyName;
}
/**
* 修改开本信息
* @param id
* @param formatName
* @param sort
* @throws SQLException
* @throws IOException
*/
public void modifyFormat(String id,
String formatName,
String sort)throws SQLException,IOException
{
String sql = "";
sql = "update format_manager set formatName = '"+formatName+"'," +
"formatSort='"+sort+"' where id='"+id+"' ";
dbconn.execute(sql);
}
/**
* 删除开本信息
* @param id
* @throws SQLException
* @throws IOException
*/
public void deleteFormat(String id)throws SQLException,IOException
{
String sql = "";
sql = "delete from format_manager where id = '"+id+"' ";
dbconn.execute(sql);
}
public void addBook(String userId,
String bookName,
String publishId,
String classifyBigId,
String classifyMidId,
String classifySmallId,
String author,
String translater,
String complier,
String bookNumber,
String pressDate,
String pageNumber,
String publishTime,
String packagingId,
String formatId,
String nationId,
String libraryId,
String marketPrice,
String seaPrice,
String stockNumber,
String saleNumber,
String smallPicPath,
String bigPicPath,
String recommend,
String summary,
String catalogue,
String comment,
String type) throws SQLException,IOException
{
String sql = "";
sql = "insert into book_info(userId,bookName,publishId,classifyBigId,classifyMidId,classifySmallId,author," +
"translater,complier,bookNumber,pressDate,pageNumber,publishTime,packagingId,formatId,nationId," +
"libraryId,marketPrice,seaPrice,stockNumber,saleNumber,smallPicPath,bigPicPath,recommend," +
"summary,catalogue,comment,type,createDate) " +
"VALUES('0','"+bookName+"','"+publishId+"','"+classifyBigId+"','"+classifyMidId+"','"+classifySmallId+"'," +
"'"+author+"','"+translater+"','"+complier+"','"+bookNumber+"','"+pressDate+"'," +
""+pageNumber+",'"+publishTime+"','"+packagingId+"','"+formatId+"','"+nationId+"'," +
"'"+libraryId+"','"+marketPrice+"','"+seaPrice+"','"+stockNumber+"'," +
"'"+saleNumber+"','"+smallPicPath+"','"+bigPicPath+"','"+recommend+"','"+summary+"'," +
"'"+catalogue+"','"+comment+"','"+type+"','"+StringUtil.genDateTimeString()+"')";
dbconn.execute(sql);
}
/**
* 列出会员所添加的图书
* @param userId
* @return Vector
* @throws SQLException
* @throws IOException
*/
public Vector getBookByUserId(String userId)throws SQLException,IOException
{
Vector v = null;
String sql = "";
sql = "select * from book_info where userId='"+userId+"' order by createDate ";
v = dbconn.ListOfMapData(sql);
return v;
}
/**
* 删除图书
* @param id
* @throws SQLException
* @throws IOException
*/
public void deleteBook(String id)throws SQLException,IOException
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -