sq語句l同時修改國地稅密碼

   String password;
    String nsrsbh;
    String username;
    String djxh;
    String gssql ="";
    String dssql ="";
    for (int i = 0; i < pwdList.size(); i++)
    {
     JSONObject pwdJo = JSONObject.fromObject(pwdList.get(i));
     password = PasswordUtil.encryptPasswordMD5(pwdJo.getString("password"));
     nsrsbh = pwdJo.getString("nsrsbh");
     username = pwdJo.getString("userName");
     djxh = pwdJo.getString("djxh");
String ds="10126";//國稅
     String gs="10116";//地稅
     logger.info(djxh.substring(0, 5));
    if(djxh.substring(0, 5).equals(ds)){
     gssql= "update nd_dj_wbzcxx set pwd='"+password+"' where djxh=(select t.djxh_gs from nd_dj_gdsnsrdz t where t.djxh_ds like '"+djxh+"') and username='"+username+"'";  

     dssql= "update nd_dj_wbzcxx set pwd='"+password+"' where djxh='"+djxh+"' and username='"+username+"'"; 
       }else {
        dssql= "update nd_dj_wbzcxx set pwd='"+password+"' where djxh=(select t.djxh_ds from nd_dj_gdsnsrdz t where t.djxh_gs like '"+djxh+"') and username='"+username+"'"; 
        gssql= "update nd_dj_wbzcxx set pwd='"+password+"' where djxh='"+djxh+"' and username='"+username+"'";
    }
     logger.info("========gssql000==========="+gssql);
     logger.info("========dssql001========="+dssql);
     pdao.execute(gssql, null, tx);
     pdao.execute(dssql, null, tx);
    
    }
    tx.commit();
    
    map.put("success", true);
發佈了41 篇原創文章 · 獲贊 13 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章