From 70ea95ea9864d05a4ab9cfeb99ea0ed4ac37e9ae Mon Sep 17 00:00:00 2001 From: revisit Date: Sat, 12 Oct 2024 18:26:43 +0800 Subject: [PATCH] update search fix bug --- .gitignore | 1 + .../control/search/DSDSSearchControl.class | Bin 7279 -> 6064 bytes .../control/search/DSDSSearchControl.java | 48 +++++++++--------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 552c5da..4505591 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /build /tmp /out-tsc +/src/main/webapp/WEB-INF/lib # Only exists if Bazel was run /bazel-out diff --git a/build/classes/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.class b/build/classes/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.class index b13617f09bd7fec5efcdb3dbfe89a7b19892c9c1..c9ce015f1fd0bb911a2a249d6ab8ad1ce35c7e47 100644 GIT binary patch delta 2395 zcmaKtdr(wW9LK+Bm)*VGy)JN7bWw9bWO*$pzCp@TDqm?nD73;0ToK$C%Yu^Hs+o_> zS0^pfd}UJR1H(YXw0u-kGfn^XNB`s>XwLMQX{MQ`n(B8h>ms$&Fr59~dp_s)`<>tU z{m%V)YI~vl#b1}M0GNo+&dW_^zYPyCB-LxpTA^3-*A|wALV=J37sKqO{*c}n@HXo; zuIhj)0)sc>Mm?ssM6m1g9-N?rQepk5u; zYh)Rtkf9(6WBAv~Fr}O!!Pn#sGhEB&=S`!yqMS>Ukj~E+ZHD zHstXm=AmW}3iwTBjMav54Cy?{oUSHv*@g}k=H@FH1cx09#PmY)ZkYR$$rcgQV7|BHhMXS{-{hE)g4$01$*MGW;!=XBVZHbIJthS+^ z&qyvv@uGl1TBS9XYu+ZZ>gV5@)5=8lg9;iz0ot0y%z~8+S=sj)TToR`=UWojz7H7^ zns_96IGw%^YZRzzPQA;HY(U8UMAB<7E;Bn41|1@ zB0&;fn}t+Zj?_n!m=SH#F4+eY!tvu&z?Ku=TQnox+wvwq|Kz zEox^ML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M`{bs~FM{r5sO`r*hCcMBUy-0_)ZHA&p{G?67+T9 z?kgJ3m2DD!O09Dnod$N}X9>K;HJC*j1o|NC$s}Z;&s}#H>#+ zCx&@*=APa%x5fW&zL1ppCLXC+l#lYFWXlOHIBx7n&Rwtvk8Q`?AW|Kvx`hi;^{Iwb zY(KV3B3{Yv$wW_0BKnR`)H9jrxk*IN`$RWQCVFWS(f2$euF77#x{LJl0zaRe0bEPZ z9tw9ag>?h2#C0_4gN5sH3vR%p*eHV2p>uTgNgs~b?)+S1ZOp8WxKRrKuZ0`4~XaHnv%OEvDn5BFj3b|2$@EUJy> zc#$0P(_T=$8KL^QPxWRQ)!PxOU-?vTmr)&wP`&F@9hpoeaT3-{aO@RubqK~M1hF2` z@xUtHCD@G0tOT2QnP4+2^B7P$PEZ(?SrH015EMpb9s~Y3ym{mvy#0&SkWCH|kS*%A6o1kF~gV>58%1Ry2V}vqu6o+BpkI3U+ zFj);<#mzy1wb9MeTG*_Q?vG5k>{b-nQy62fU<-STZg}3oZR~yA&OV^`hjg#gv?-$UIJ7Atv?-#ZIJC9+ z(Dq>fXrx0F+GZp13EBzTT3cH?I$P+EV6BFXC3*N0M@%BG#ryOwbsT@jUx5DtiZexk diff --git a/src/main/java/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.java b/src/main/java/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.java index 7e1a1ab..48292dc 100644 --- a/src/main/java/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.java +++ b/src/main/java/cn/tsy/idsse/dsds/control/search/DSDSSearchControl.java @@ -29,39 +29,39 @@ public class DSDSSearchControl extends AjaxControl { @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) { - // String where = "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id"; - String where = ""; + // String where += "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id"; + String where += ""; if ("航次名称".equals(search_type)) { 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 { - where = " and voyage_id in(" + CollectionHelper.join(ids, ",") + ") "; + where += " and voyage_id in(" + CollectionHelper.join(ids, ",") + ") "; } } else if ("平台类型".equals(search_type)) { 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 { - where = " and platform_id in(" + CollectionHelper.join(ids, ",") + ") "; + where += " and platform_id in(" + CollectionHelper.join(ids, ",") + ") "; } } 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)) { 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 { - where = " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") "; + where += " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") "; } } 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)) { 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 { - where = " and data_id in(" + CollectionHelper.join(ids, ",") + ") "; + where += " and data_id in(" + CollectionHelper.join(ids, ",") + ") "; } } 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)) { @@ -94,29 +94,29 @@ public class DSDSSearchControl extends AjaxControl { String where = ""; 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())) - where = " and platform_type ='" + param.getPlatform_type() + "' "; + where += " and platform_type ='" + param.getPlatform_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())) - where = " and data_type ='" + param.getData_type() + "' "; + where += " and data_type ='" + param.getData_type() + "' "; if (StringHelper.hasValue(search_value)) { 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)) { - 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)) { - where = " and platform_name like concat('%','" + search_value + "','%') "; + where += " and platform_name like concat('%','" + search_value + "','%') "; } 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)) { - where = " and (dataset_name like concat('%','" + search_value + "','%')) "; + where += " and (dataset_name like concat('%','" + search_value + "','%')) "; } 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)) { - where = " and voyage_officer like concat('%','" + search_value + "','%') "; + where += " and voyage_officer like concat('%','" + search_value + "','%') "; } }