"> 步骤二 公用js文件 dictionary.js 代码如下: /** *↓↓↓↓↓↓↓↓↓↓ *作者:ZhuangZi *类名:公用方法初始化 *功能:公用方法初始化 *详细:公用方法初始">
时间:2021-07-01 10:21:17 帮助过:2人阅读
public int checkCodeOnly(DictionaryBean bean)throws DataAccessException,Exception {
Object[] sqlParams = new Object[4];
int index = 0;
String sql="";
/* 验证页面标志是否唯一*/
if (bean.getFlag().equals("1")) {
sql = "select count(1) from YHAO_PORTALS_PAGE where PAGE_FLAG = ? ";
sqlParams[index]=bean.getCode();
index++;
}
/* 验证类型志标识是否唯一*/
if (bean.getFlag().equals("2")) {
sql = "select count(1) from YHAO_PORTALS_DOWNTYPE where DOWNTYPE_FLAG = ? ";
sqlParams[index]=bean.getCode();
index++;
}
/* 验证下载志标识是否唯一*/
if (bean.getFlag().equals("3")) {
sql = "select count(1) from YHAO_PORTALS_DOWN where DOWN_FLAG = ? ";
sqlParams[index]=bean.getCode();
index++;
}
if (bean.getFlag().equals("4")) {
sql = "select count(1) from YHAO_PORTALS_KUAI where KUAI_FLAG = ? ";
sqlParams[index]=bean.getCode();
index++;
}
Object[] sqlParamsEnd = new Object[index];
System.arraycopy(sqlParams, 0, sqlParamsEnd, 0, index);
int count = this.queryForInt(sql,sqlParamsEnd);
return count;
}