| | |
| | | |
| | | private DataTable DoSearchData(DataBase_Setting setting, List<QueryData> datas) |
| | | { |
| | | string conditon = "WHERE 1=1 "; |
| | | string fields = string.Join(",", Datas?.Select(d => $"[{d.Key}]").ToList()); |
| | | if (datas != null && datas.Count > 0) |
| | | { |
| | | conditon = "WHERE " + string.Join(" AND ", datas.Select(d => $"[{d.Key}] {d.Condition} '{d.Value}'").ToList()); |
| | | } |
| | | |
| | | string conditon = string.Join(" AND ", datas.Select(d => $"[{d.Key}] {d.Condition} '{d.Value}'").ToList()); |
| | | string timeCol = setting.TimeCol; |
| | | if (string.IsNullOrEmpty(timeCol)) |
| | | { |
| | | timeCol = "time"; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(startTimeInput.Text)) |
| | | { |
| | | conditon += $" AND {timeCol} >= '{startTimeInput.Text}'"; |
| | |
| | | { |
| | | conditon += $" AND {timeCol} < '{endTimeInput.Text}'"; |
| | | } |
| | | conditon = string.IsNullOrEmpty(conditon) ? string.Empty : $" WHERE {conditon}"; |
| | | |
| | | SqliteHelper helper = null; |
| | | string sql = string.Empty; |
| | |
| | | } |
| | | |
| | | var datas = Datas?.Where(d => !string.IsNullOrEmpty(d.Value)).ToList(); |
| | | if (datas == null || datas.Count <= 0) |
| | | |
| | | if ((datas == null || datas.Count <= 0) && |
| | | (string.IsNullOrEmpty(startTimeInput.Text) || string.IsNullOrEmpty(endTimeInput.Text))) |
| | | { |
| | | ToastHelper.Warning(Window.GetWindow(this), this.lang("Dv.QueryCantBeEmpty")); |
| | | return; |
| | |
| | | workbook.CreateSheet("sheet1");////新建一个工作表 |
| | | XSSFSheet SheetOne = (XSSFSheet)workbook.GetSheet("Sheet1"); ////获取名称为Sheet1的工作表,创建标题头 |
| | | IRow row1 = SheetOne.CreateRow(0);////获取Sheet1工作表的首行,设置表头,获取列 |
| | | XSSFCell[] SheetCell = new XSSFCell[currentColumns.Count]; |
| | | //XSSFCell[] SheetCell = new XSSFCell[currentColumns.Count]; |
| | | for (int i = 0; i < currentColumns.Count; i++) |
| | | { |
| | | row1.CreateCell(i).SetCellValue(currentColumns[i].Header.ToString()); |