コード例 #1
0
 public void saveJZs(String jzs, String kid) {
   String[] jzArray = jzs.split(",");
   for (int i = 0; i < jzArray.length; i++) {
     String[] oneItem = jzArray[i].split("_");
     if (oneItem.length == 2) {
       TjKndJZ jz = new TjKndJZ();
       jz.setKid(kid);
       jz.setJz(oneItem[1]);
       jz.setJzname(oneItem[0]);
       this.save(jz);
     }
   }
 }
コード例 #2
0
 public String getCheckJZsByKid(String kid) {
   StringBuffer result = new StringBuffer();
   String hql = "from TjKndJZ where kid='" + kid + "'";
   List<TjKndJZ> jzList = this.find(hql);
   if (jzList.size() > 0) {
     for (TjKndJZ jz : jzList) {
       result.append(jz.getJzname() + "_" + jz.getJz() + ",");
     }
     if (result.length() > 0) {
       result.deleteCharAt(result.length() - 1);
     }
   } else {
     return null;
   }
   return result.toString();
 }