防止SQL注入问题,出入的SQL语句参数全部用?代替的,模糊查询的SQL语句的参数要用单引号引起来
sql.append("(select distinct(a.stcd) , c.sums from dt_rain a , (select SUM(b.rain) as sums from dt_rain b where stcd='"+stcd+"' and convert(varchar,tm,120) like '%"+tm+"%') c where stcd='"+stcd+"' and convert(varchar,tm,120) like '%"+tm+"%')");
JdbcTemplate history1=allJDBCTemplate.getJdbcTemplate();