diff --git a/build/classes/.gitignore b/build/classes/.gitignore index 8fe2033..d36383e 100644 --- a/build/classes/.gitignore +++ b/build/classes/.gitignore @@ -1 +1,3 @@ +/app.properties /cn/ +/jdbc.properties diff --git a/build/classes/cn/tsy/cas/idsse/dsds/control/search/SearchControl.class b/build/classes/cn/tsy/cas/idsse/dsds/control/search/SearchControl.class index 6c14a81..a50678c 100644 Binary files a/build/classes/cn/tsy/cas/idsse/dsds/control/search/SearchControl.class and b/build/classes/cn/tsy/cas/idsse/dsds/control/search/SearchControl.class differ diff --git a/src/main/java/cn/tsy/cas/idsse/dsds/control/search/SearchControl.java b/src/main/java/cn/tsy/cas/idsse/dsds/control/search/SearchControl.java index 2297123..9d5a934 100644 --- a/src/main/java/cn/tsy/cas/idsse/dsds/control/search/SearchControl.java +++ b/src/main/java/cn/tsy/cas/idsse/dsds/control/search/SearchControl.java @@ -105,20 +105,27 @@ public class SearchControl extends HmeAjaxControl { where += " and equipment_type ='" + param.getEquipment_type() + "' "; if (HmeStringHelper.hasValue(param.getData_type())) where += " and data_type ='" + param.getData_type() + "' "; + + boolean dataset_search = false; if (HmeStringHelper.hasValue(search_value)) { if ("航次名称".equals(search_type)) { where += " and t.voyage_name like concat('%','" + search_value + "','%') "; } else if ("平台类型".equals(search_type)) { where += " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) "; + dataset_search = true; } else if ("平台名称".equals(search_type)) { where += " and platform_name like concat('%','" + search_value + "','%') "; + dataset_search = true; } else if ("设备类型".equals(search_type)) { where += " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) "; + dataset_search = true; } else if ("数据集名称".equals(search_type)) { where += " and (dataset_name like concat('%','" + search_value + "','%')) "; + dataset_search = true; } else if ("数据样品类型".equals(search_type)) { where += " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) "; + dataset_search = true; } else if ("航次首席".equals(search_type)) { where += " and voyage_officer like concat('%','" + search_value + "','%') "; } @@ -130,7 +137,11 @@ public class SearchControl extends HmeAjaxControl { return new HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql)); } else { // 航次 - String sql = "select t.* from voyage_reg t where tsy_id in (" + "select distinct t.voyage_id from sample_dataset t,voyage_reg y where y.tsy_id=t.voyage_id " + " " + where + ") order by t.create_time desc"; + + String sql = "select t.* from voyage_reg t where 1=1" + where +" order by t.create_time desc"; + if(dataset_search) + sql = "select t.* from voyage_reg t where tsy_id in (" + "select distinct t.voyage_id from sample_dataset t,voyage_reg y where y.tsy_id=t.voyage_id " + " " + where + ") order by t.create_time desc"; + return new HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql)); }