以下代码是否正确?我想检索给定DataNum的DataFiles列表,以及数据代码是2还是3.
public List<DataFileVO> getDataFileByDataNum(String dataNum) {
List<DataFileVO> DataFileList = new ArrayList<DataFileVO>();
String query = "select datafile from DataFileVO datafile "
+ "where datafile.dataNum = ?"
+ "and datafile.dataRetrievalTypeCode = 2 OR duadatafile.dataFileRetrievalTypeCode = 3";
DataFileList = this.getHibernateTemplate().find(query, dataNum);
return DataFileList;
答案 0 :(得分:0)
替换:
and datafile.dataRetrievalTypeCode = 2 OR duadatafile.dataFileRetrievalTypeCode = 3
人:
and datafile.dataRetrievalTypeCode in(2,3)
这是你想要做的。干杯!