update search fix bug

This commit is contained in:
revisit 2024-10-12 18:26:43 +08:00
parent 03b229693e
commit 70ea95ea98
3 changed files with 25 additions and 24 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
/build /build
/tmp /tmp
/out-tsc /out-tsc
/src/main/webapp/WEB-INF/lib
# Only exists if Bazel was run # Only exists if Bazel was run
/bazel-out /bazel-out

View File

@ -29,39 +29,39 @@ public class DSDSSearchControl extends AjaxControl {
@RequestMapping("page.htm") @RequestMapping("page.htm")
public Ajax page(Integer group, Integer limit, Integer start, String search_type, String order, String type, String return_type, String search_value, Integer[] ids) { public Ajax page(Integer group, Integer limit, Integer start, String search_type, String order, String type, String return_type, String search_value, Integer[] ids) {
// String where = "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id"; // String where += "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id";
String where = ""; String where += "";
if ("航次名称".equals(search_type)) { if ("航次名称".equals(search_type)) {
if (ids == null || ids.length < 1) { if (ids == null || ids.length < 1) {
where = " and t.voyage_name like concat('%','" + search_value + "','%') "; where += " and t.voyage_name like concat('%','" + search_value + "','%') ";
} else { } else {
where = " and voyage_id in(" + CollectionHelper.join(ids, ",") + ") "; where += " and voyage_id in(" + CollectionHelper.join(ids, ",") + ") ";
} }
} else if ("平台类型".equals(search_type)) { } else if ("平台类型".equals(search_type)) {
if (ids == null || ids.length < 1) { if (ids == null || ids.length < 1) {
where = " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) "; where += " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) ";
} else { } else {
where = " and platform_id in(" + CollectionHelper.join(ids, ",") + ") "; where += " and platform_id in(" + CollectionHelper.join(ids, ",") + ") ";
} }
} else if ("平台名称".equals(search_type)) { } else if ("平台名称".equals(search_type)) {
where = " and platform_name like concat('%','" + search_value + "','%') "; where += " and platform_name like concat('%','" + search_value + "','%') ";
} else if ("设备类型".equals(search_type)) { } else if ("设备类型".equals(search_type)) {
if (ids == null || ids.length < 1) { if (ids == null || ids.length < 1) {
where = " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) "; where += " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) ";
} else { } else {
where = " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") "; where += " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") ";
} }
} else if ("数据集名称".equals(search_type)) { } else if ("数据集名称".equals(search_type)) {
where = " and (dataset_name like concat('%','" + search_value + "','%')) "; where += " and (dataset_name like concat('%','" + search_value + "','%')) ";
} else if ("数据样品类型".equals(search_type)) { } else if ("数据样品类型".equals(search_type)) {
if (ids == null || ids.length < 1) { if (ids == null || ids.length < 1) {
where = " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) "; where += " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) ";
} else { } else {
where = " and data_id in(" + CollectionHelper.join(ids, ",") + ") "; where += " and data_id in(" + CollectionHelper.join(ids, ",") + ") ";
} }
} else if ("航次首席".equals(search_type)) { } else if ("航次首席".equals(search_type)) {
where = " and voyage_officer like concat('%'," + search_value + ",'%') "; where += " and voyage_officer like concat('%'," + search_value + ",'%') ";
} }
if ("数据样品集".equals(return_type)) { if ("数据样品集".equals(return_type)) {
@ -94,29 +94,29 @@ public class DSDSSearchControl extends AjaxControl {
String where = ""; String where = "";
if (StringHelper.hasValue(param.getVoyage_name())) if (StringHelper.hasValue(param.getVoyage_name()))
where = " and t.voyage_name ='" + param.getVoyage_name() + "' "; where += " and t.voyage_name ='" + param.getVoyage_name() + "' ";
if (StringHelper.hasValue(param.getPlatform_type())) if (StringHelper.hasValue(param.getPlatform_type()))
where = " and platform_type ='" + param.getPlatform_type() + "' "; where += " and platform_type ='" + param.getPlatform_type() + "' ";
if (StringHelper.hasValue(param.getEquipment_type())) if (StringHelper.hasValue(param.getEquipment_type()))
where = " and equipment_type ='" + param.getEquipment_type() + "' "; where += " and equipment_type ='" + param.getEquipment_type() + "' ";
if (StringHelper.hasValue(param.getData_type())) if (StringHelper.hasValue(param.getData_type()))
where = " and data_type ='" + param.getData_type() + "' "; where += " and data_type ='" + param.getData_type() + "' ";
if (StringHelper.hasValue(search_value)) { if (StringHelper.hasValue(search_value)) {
if ("航次名称".equals(search_type)) { if ("航次名称".equals(search_type)) {
where = " and t.voyage_name like concat('%','" + search_value + "','%') "; where += " and t.voyage_name like concat('%','" + search_value + "','%') ";
} else if ("平台类型".equals(search_type)) { } else if ("平台类型".equals(search_type)) {
where = " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) "; where += " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) ";
} else if ("平台名称".equals(search_type)) { } else if ("平台名称".equals(search_type)) {
where = " and platform_name like concat('%','" + search_value + "','%') "; where += " and platform_name like concat('%','" + search_value + "','%') ";
} else if ("设备类型".equals(search_type)) { } else if ("设备类型".equals(search_type)) {
where = " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) "; where += " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) ";
} else if ("数据集名称".equals(search_type)) { } else if ("数据集名称".equals(search_type)) {
where = " and (dataset_name like concat('%','" + search_value + "','%')) "; where += " and (dataset_name like concat('%','" + search_value + "','%')) ";
} else if ("数据样品类型".equals(search_type)) { } else if ("数据样品类型".equals(search_type)) {
where = " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) "; where += " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) ";
} else if ("航次首席".equals(search_type)) { } else if ("航次首席".equals(search_type)) {
where = " and voyage_officer like concat('%','" + search_value + "','%') "; where += " and voyage_officer like concat('%','" + search_value + "','%') ";
} }
} }