# DB模型運用實體查詢
模型查詢須創建模型使用WhereData賦值 即可查詢出想要的數據集合;一般單表查詢適用。創建模型方法參考([模型創建](創建模型.md))
條件查詢方法
查詢一個數據使用.使用whereData賦值
```javascript
//傳模型類(好處不需要總是查看數據表名)
WhereData where_data = new WhereData();
where_data.put("id",1);
Map<Integer, DtrecordModel> byId = Dao.selectForMap(where_data, DtrecordModel.class);
```
查詢集合List使用,返回實體類
```java
WhereData where_data = new WhereData();
where_data.put("status","1");
List<Dtp> select = Dao.select(where_data, Dtp.class);
```
查詢一條數據
```java
WhereData whereData = new WhereData();
whereData.put("id",3);
Dtp dtp_info = dao_dtp.find(whereData);
```