我有多个public int getNoOfRows(SalaryMigrateSearchParamDTO searchParam) {
MapSqlParameterSource param = new MapSqlParameterSource();
String query = "SELECT count(Distinct emp_code) "
+ " FROM Xxmpcd_Salary_Detail_Table ";
if (searchParam.getCircle() != null && !"".equals(searchParam.getCircle())) {
query += "WHERE Prayas_Erp_Org_Id LIKE '" + searchParam.getCircle() + "-%' ";
} else {
query += "WHERE Prayas_Erp_Org_Id LIKE '" + searchParam.getRegion() + "-%' ";
}
query += "AND Yyyymm='" + searchParam.getYearMonth() + "' "
+ "Order by Emp_Name ASC ;";
return getNamedParameterJdbcTemplate().queryForObject(query, param, Integer.class);
}
和单个tableViewCell
,当打开任何pickerview
时,PickerView dataSource方法调用tableViewCell总数。
请在下面查看我的代码。
pickerView
PickerView方法 该方法多次调用
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell : SingleLineText = tableView.dequeueReusableCell(withIdentifier: "SingleLineText", for: indexPath as IndexPath) as! SingleLineText
pickerView.delegate = self
cell.pickerViewFields.inputView = pickerView
return cell
}
答案 0 :(得分:0)
从您的评论部分中我能得到的是,您不想多次打电话给pickerview的代表(重复使用),对吗?
您可以设置此条件。
if cell.pickerViewFields.inputView == nil{
cell.pickerViewFields.inputView = pickerView
}