List<ZxDXmpjjg> xmpjjglist = new ArrayList<ZxDXmpjjg>();
String hql1= " from ZxDXmpjjg where to_char(id.pjsj,'yyyy-mm-dd')=to_char(?,'yyyy-mm-dd') and id.pjsd=? and id.jclb=? and id.stcd in (:strs)";
Session session1 = template.getSessionFactory().getCurrentSession();
Query query1 = session1.createQuery(hql1);
query1.setTimestamp(0, evModel.getStarttime());
query1.setLong(1, evModel.getPjsd());
query1.setString(2, evModel.getJclb());
query1.setParameterList( "strs", params);
xmpjjglist = query1.list();
本文介绍了使用HQL进行复杂条件查询的方法,并展示了如何通过Java代码设置查询参数,包括时间戳、长整型及字符串参数等。
1189

被折叠的 条评论
为什么被折叠?



