Hibernate多表联合查询,下面是一个多表颁查询的方法示例:
多表查询
publicList<AccountNewVO> getProvinceAccountNewVOAlarmList(AccountVO account,intpageNo, int pageSize){
StringBuffer sb = newStringBuffer();
List params = newArrayList();
sb.append(" selectd.event_add ,( case u.cert_type when 1then '身份证' when 2 then'军官证' when 3 then'护照' end)cert_type ,u.age ,b.name ,d.event_owner,");
sb.append(" d.event_code,to_char(d.event_time,'yyyy-mm-ddHH24:mi:ss'),d.event_contactor,d.fund_identify ,d.fund_identify_code ");
sb.append(",l.type_code,l.notified,l.id ");
sb.append(" fromt_exception_detail d ,t_user u,t_branch b,t_exception_log l ");
sb.append(" whered.event_usercode = u.user_code ");
sb.append(" andu.province_code = b.code ");
sb.append(" andd.exc