📄 bmmanager.java
字号:
package com.gs.db.dbimp;
import com.gs.db.*;
import com.gs.util.Cacheable;
import com.gs.util.CacheSizes;
import java.sql.*;
import java.util.Iterator;
import java.util.ArrayList;
import java.lang.*;
import java.util.*;
public class BmManager {
public BmManager() {
}
/**
消费类型的查询条件:start
*/
private static ArrayList spDL_list = null;
private static HashMap spZL_map = new HashMap();
private static HashMap spXL_map_ByDl = new HashMap();
private static HashMap spXL_map_ByZl = new HashMap();
private static ArrayList spZL_list = null;
private static ArrayList spXL_list_ByDl = null;
private static ArrayList spXL_list_ByZl = null;
private static final String GET_DL =
"SELECT code_dl, code_dl_content FROM bm_tssplb group by code_dl,code_dl_content "
+ "having(count(code_dl))>=1";
private static final String GET_ZL =
"SELECT code_zl, code_zl_content FROM bm_tssplb where code_zl like ''+?+'%'"
+ " group by code_zl,code_zl_content"
+ " having(count(code_zl))>=1";
private static final String GET_XL =
"SELECT code_xl, code_xl_content FROM bm_tssplb where code_xl like ''+?+'%'"
+ " group by code_xl,code_xl_content"
+ " having(count(code_xl))>=1";
/**
* bm_ssnrb 申诉类型
* bm_ssrfl 申诉人分类
* bm_jzfl 申诉人分类2
* bm_qylx 被申诉方性质
*/
public static ArrayList getBmList(String s_tabelName){
String bm_public = "select bm,nr from table";
ArrayList list = new ArrayList();
if(s_tabelName==null)
return list;
bm_public = bm_public.replaceAll("table",s_tabelName);
// System.out.println("bm_public="+bm_public);
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(bm_public);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String bm = rs.getString("bm");
String nr = rs.getString("nr");
Properties p = new Properties();
p.setProperty("bm",bm);
p.setProperty("nr",nr);
list.add(p);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
/**
*大类
* @return ArrayList
*/
public static ArrayList getSplbDl() {
if (spDL_list != null)
return spDL_list;
spDL_list = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_DL);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code_dl = rs.getString("code_dl");
String s_code_dl_content = rs.getString("code_dl_content");
String[] strs = {
s_code_dl, s_code_dl_content};
spDL_list.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return spDL_list;
}
public static ArrayList getSplbZl(String dl) {
dl = dl.trim();
Object obj = spZL_map.get(dl);
if(obj!=null)
return (ArrayList)obj;
spZL_list = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_ZL);
pstmt.setString(1, dl);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code_zl = rs.getString("code_zl");
String s_code_zl_content = rs.getString("code_zl_content");
String[] strs = {
s_code_zl, s_code_zl_content};
spZL_list.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
spZL_map.put(dl,spZL_list);
return spZL_list;
}
public static ArrayList getSplbXl_byDL(String dl) {
dl = dl.trim();
Object obj = spXL_map_ByDl.get(dl);
if(obj!=null)
return (ArrayList)obj;
spXL_list_ByDl = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_XL);
pstmt.setString(1, dl);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code_xl = rs.getString("code_xl");
String s_code_xl_content = rs.getString("code_xl_content");
String[] strs = {
s_code_xl, s_code_xl_content};
spXL_list_ByDl.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
spXL_map_ByDl.put(dl,spXL_list_ByDl);
return spXL_list_ByDl;
}
public static ArrayList getSplbXl_byZl(String zl) {
zl = zl.trim();
Object obj = spXL_map_ByZl.get(zl);
if(obj!=null)
return (ArrayList)obj;
spXL_list_ByZl = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_XL);
pstmt.setString(1, zl);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code_xl = rs.getString("code_xl");
String s_code_xl_content = rs.getString("code_xl_content");
String[] strs = {
s_code_xl, s_code_xl_content};
spXL_list_ByZl.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
spXL_map_ByZl.put(zl,spXL_list_ByZl);
return spXL_list_ByZl;
}
/**
消费类型的查询条件:end
*/
/**
伪劣物资的查询条件:start
*/
private static ArrayList spWLWZ_list = null;
private static final String GET_WLWZ =
"SELECT bm,mc,sldw FROM bm_wlwz";
public static ArrayList getWLWZ() {
if (spWLWZ_list != null)
return spWLWZ_list;
spWLWZ_list = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_WLWZ);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_bm = rs.getString("bm");
if (s_bm != null)
s_bm = s_bm.trim();
String s_mc = rs.getString("mc");
if (s_mc != null)
s_mc = s_mc.trim();
String s_sldw = rs.getString("sldw");
if (s_sldw != null)
s_sldw = s_sldw.trim();
String[] strs = {
s_bm, s_mc, s_sldw};
spWLWZ_list.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return spWLWZ_list;
}
/**
伪劣物资的查询条件:end
*/
/**
投诉方式的查询条件:start
*/
private static ArrayList tsFS_list = null;
private static final String GET_TSFS =
"SELECT code,content FROM bm_tsfs";
public static ArrayList getTsFs() {
if (tsFS_list != null)
return tsFS_list;
tsFS_list = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_TSFS);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code = rs.getString("code");
if (s_code != null)
s_code = s_code.trim();
String s_content = rs.getString("content");
if (s_content != null)
s_content = s_content.trim();
String[] strs = {
s_code, s_content};
tsFS_list.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return tsFS_list;
}
/**
投诉方式的查询条件:end
*/
/**
咨询方式的查询条件:start
*/
private static ArrayList zxFS_list = null;
private static final String GET_ZXFS =
"SELECT code,content FROM bm_zxwt";
public static ArrayList getZxFs() {
if (zxFS_list != null)
return zxFS_list;
zxFS_list = new ArrayList();
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(GET_ZXFS);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
String s_code = rs.getString("code");
if (s_code != null)
s_code = s_code.trim();
String s_content = rs.getString("content");
if (s_content != null)
s_content = s_content.trim();
String[] strs = {
s_code, s_content};
tsFS_list.add(strs);
}
}
catch (SQLException sqle) {
System.err.println("SQLException in DbMenu.java:" +
"loadFromDb():reading unit data " + sqle);
}
finally {
try {
pstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
try {
con.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
return zxFS_list;
}
/**
咨询方式的查询条件:end
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -