更正分页sql,

web_backend_develope
chenlw 8 years ago
parent 8793a2bda0
commit b3360987b4

@ -65,7 +65,7 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
</if>
<if test="array !=null and array.size() != 0">
<foreach collection="array" item="item" index="index">
AND CONCAT(regionalism_code,system_code,city_name,district_name,system_name,data_year) LIKE CONCAT('%',CONCAT(${item},'%'))
AND CONCAT(regionalism_code,system_code,city_name,district_name,system_name,data_year) LIKE CONCAT('%',CONCAT('${item}','%'))
</foreach>
</if>
</sql>

@ -121,7 +121,7 @@ public class PagerOptions extends Page{
* @param keyQuery the keyQuery to set
*/
public void setKeyQuery(String keyQuery) {
this.keyQuery = keyQuery;
this.keyQuery = keyQuery == null ? null: keyQuery.trim();
}
/**

@ -48,7 +48,7 @@ public class DataInfoServiceImp implements DataInfoService {
//去掉版本字段
Pattern pattern = Pattern.compile("^版本\\d+$");
if (null != querystr && !"".equals(querystr)) {
querys = querystr.split(" ");
querys = querystr.trim().split(" ");
list = Arrays.asList(querys);
}
//遍历 list
@ -69,7 +69,7 @@ public class DataInfoServiceImp implements DataInfoService {
int length = strs.length;
List<String> arrays = new ArrayList<String>();
for (int i = 0; i < length; i++) {
arrays.add(strs[i].toString());
arrays.add(strs[i].toString().trim());
}
for (String version : removelist) {
pagerOptions.setDataVersion(Integer.valueOf(version.replace("版本", "")));

@ -73,7 +73,7 @@ public class PageInterceptor implements Interceptor {
String sql = boundSql.getSql();
Page co=(Page)(boundSql.getParameterObject());
// 重写 Sql语句
log.info(sql.replaceAll("\n", "").replaceAll("\t", ""));
log.info(sql.replaceAll("\n", "").replaceAll("\t\t", "\t"));
String countSql=concatCountSql(sql);
Connection connection = (Connection) invocation.getArgs()[0];

Loading…
Cancel
Save