Commit 060577bf7f48a5e4120bcb9dc4a2546ba13732d8
Merge branch 'jiading' of http://192.168.168.201:8888/panzhaov5/bsth_control.git into jiading
Showing
1 changed file
with
15 additions
and
13 deletions
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
| @@ -231,25 +231,27 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | @@ -231,25 +231,27 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | ||
| 231 | fgs=map.get("fgsdm").toString(); | 231 | fgs=map.get("fgsdm").toString(); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | - String sql ="SELECT sp.xl as xl,MAX(sp.tt_info_names) as tt_info_name, " + | ||
| 235 | - "MAX(sp.schedule_from_time) as from_time ,MAX(sp.schedule_to_time) as to_time, " + | ||
| 236 | - "MAX(line.name) as name , MAX(us.user_name) as uname, " + | ||
| 237 | - "MAX(sp.update_date) as updata_date,max(bu.business_name) as business_name " + | ||
| 238 | - "from bsth_c_s_sp sp " + | ||
| 239 | - "LEFT JOIN bsth_c_line line on sp.xl = line.line_code " + | ||
| 240 | - "left join bsth_c_sys_user us on sp.update_by = us.id " + | ||
| 241 | - "LEFT JOIN bsth_c_business bu on line.branche_company = bu.business_code " + | ||
| 242 | - "where line.name not like '%测试线路%' and sfyy = '1' " + | ||
| 243 | - "and line.destroy = '0' " ; | 234 | + String sql ="" + |
| 235 | + "SELECT sp.xl as xl,sp.tt_info_names as tt_info_name, " + | ||
| 236 | + " sp.schedule_from_time as from_time ,sp.schedule_to_time as to_time, " + | ||
| 237 | + " line.name as name , us.user_name as uname, " + | ||
| 238 | + " sp.update_date as updata_date,bu.business_name as business_name " + | ||
| 239 | + " from bsth_c_s_sp sp " + | ||
| 240 | + " LEFT JOIN bsth_c_line line on sp.xl = line.line_code " + | ||
| 241 | + " left join bsth_c_sys_user us on sp.update_by = us.id " + | ||
| 242 | + " LEFT JOIN bsth_c_business bu on line.branche_company = bu.business_code " + | ||
| 243 | + " where sp.id in (select max(id) from bsth_c_s_sp spt where plan_result ='ok' GROUP BY spt.xl)" + | ||
| 244 | + " and line.name not like '%测试线路%' and sfyy = '1' " + | ||
| 245 | + " and line.destroy = '0' " ; | ||
| 244 | if(!fgs.equals(" ") && !fgs.equals("")){ | 246 | if(!fgs.equals(" ") && !fgs.equals("")){ |
| 245 | sql +=" and line.branche_company = '"+fgs+"'"; | 247 | sql +=" and line.branche_company = '"+fgs+"'"; |
| 246 | } | 248 | } |
| 247 | if(!line.equals(" ") && !line.equals("")){ | 249 | if(!line.equals(" ") && !line.equals("")){ |
| 248 | sql += "and sp.xl="+line; | 250 | sql += "and sp.xl="+line; |
| 249 | } | 251 | } |
| 250 | - | ||
| 251 | - sql += " GROUP BY sp.xl ORDER BY MAX(sp.schedule_from_time) desc,MAX(line.name) ;"; | ||
| 252 | - List<Map> list = null; | 252 | + |
| 253 | + sql += " ORDER BY sp.schedule_from_time desc,sp.tt_info_names ;"; | ||
| 254 | + List<Map> list = null; | ||
| 253 | try { | 255 | try { |
| 254 | list = jdbcTemplate.query(sql, new RowMapper<Map>() { | 256 | list = jdbcTemplate.query(sql, new RowMapper<Map>() { |
| 255 | @Override | 257 | @Override |