|

楼主 |
发表于 2017-2-21 08:09:03
|
显示全部楼层
ublic static void updataSkdwPower(String fDWBH,String fDWMC,String fYHBH,String fYHMC,String fQY){
System.out.println("111111111111");
System.out.println(fDWMC);
System.out.println(fDWBH);
System.out.println(fYHBH);
System.out.println(fYHMC);
String version ="1";
JSONObject json = new JSONObject();
json.put("fDWBH", fDWBH);
if((fDWMC!=null )&&(!fDWMC.equals(""))){
String fullDCondition = "%"+fDWMC +"%";
String rang ="select jstkdwspower from GU_JTSKDWS_POWER jstkdwspower where jstkdwspower.fDWMC like '" + fullDCondition+"'";
//去旧(重复)标记
/*String delSql = "delete from GU_JTSKDWS_POWER jstkdwspower where jstkdwspower.fDWMC in ("+rang+")";
KSQL.executeUpdate(delSql, null, jtzjrbbModel, null);
// 插入新标记
String insertSql ="insert into GU_JTSKDWS_POWER jstkdwspower(jstkdwspower.fDWBH,jstkdwspower.fDWMC,jstkdwspower.fYHBH,jstkdwspower.fYHMC)"+
"(select jstkdwspower.* from GU_JTSKDWS_POWER jstkdwspower where jstkdwspower.fDWMC in ("+rang+"))";
Map<String, Object> param = new HashMap<String, Object>();
KSQL.executeUpdate(insertSql, param, jtzjrbbModel, null);*/
//去旧(重复)标记
String delSql = "delete from GU_JTSKDWS_POWER jstkdwspower where jstkdwspower.fDWMC like '"+fullDCondition+"'";
KSQL.executeUpdate(delSql, null, jtzjrbbModel, null);
// 插入新标记
String insertSql ="insert into GU_JTSKDWS_POWER jstkdwspower(jstkdwspower,jstkdwspower.version,jstkdwspower.fDWBH,jstkdwspower.fDWMC,jstkdwspower.fYHBH,jstkdwspower.fYHMC)"+
"values(guid(),'0','"+fDWBH+"','"+fDWMC+"','"+fYHBH+"','"+fYHMC+"')";
Map<String, Object> param = new HashMap<String, Object>();
KSQL.executeUpdate(insertSql, param, jtzjrbbModel, null);
}
}
后台可以输出结果了:
111111111111
永大电梯
01001
skj
孙总
111111111111
永大电梯
01001
zyh
周宇红
但数据库中存储还是最后一个人数据
且前台管理员显示的是 孙总数据
不明白前后台如何修改才行!!! |
|