1、执行单行查询
public String backLsh() { String sql = "select case" + " when to_number(substr(t.slid, 13, 8)) <" + " to_number(to_char(sysdate, 'yyyymmdd')) then" + " 'HLW-RK-CSDJ-' || to_char(sysdate, 'yyyymmdd') || '0001'" + " when to_number(substr(t.slid, 13, 8)) =" + " to_number(to_char(sysdate, 'yyyymmdd')) then" + " substr(t.slid," + " 1," + " length(t.slid) -" + " length(to_number(substr(t.slid, 21, 4)) + 1)) ||" + " to_char(to_number(substr(t.slid, 21, 4)) + 1)" + " end" + " from (select slbh slid" + " from slbh_list where ywbh = 'HLW-RK-CSDJ') t"; return this.getSession().createSQLQuery(sql).uniqueResult().toString(); }
?
?
2、执行更新
public boolean saveRkslbhzdz(String slbh){ String sql = "update slbh_list set slbh='" + slbh + "'where ywbh = 'HLW-RK-CSDJ'"; this.getSession().createSQLQuery(sql).executeUpdate(); return true;}
?