Commit dcdeceffb8dd408b3feb94024b98ae28ef92255c

Authored by 娄高锋
1 parent 1a4bf80a

首末班次查询中,跨天时间查询方式修正

src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -1270,8 +1270,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1270 1270  
1271 1271 try {
1272 1272 String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1273   - + " a.xl_bm, a.fgs_bm, a.cc_service, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line"
1274   - + " where schedule_date_str = '"+date+"'"
  1273 + + " a.xl_bm, a.fgs_bm, a.cc_service, (select start_opt from bsth_c_line_config where id ="
  1274 + + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt"
  1275 + + " from bsth_c_s_sp_info_real a where schedule_date_str = '"+date+"'"
1275 1276 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1276 1277 if(line.trim().length() != 0)
1277 1278 sql += " and xl_bm = '"+line+"'";
... ... @@ -1302,7 +1303,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1302 1303 schedule.setFgsBm(rs.getString("fgs_bm"));
1303 1304 schedule.setCcService(rs.getBoolean("cc_service"));
1304 1305  
1305   - int startOpt = 0;
  1306 + int startOpt = 120;
1306 1307 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){
1307 1308 String[] split = rs.getString("start_opt").split(":");
1308 1309 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
... ... @@ -1541,9 +1542,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1541 1542  
1542 1543 try {
1543 1544 String sql = "select a.schedule_date_str, a.real_exec_date, a.xl_bm, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name,"
1544   - + " a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b "
1545   - + " on a.xl_bm = b.line"
1546   - + " where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
  1545 + + " a.fgs_bm, a.cc_service, a.remarks, a.adjust_exps, (select start_opt from bsth_c_line_config where id = "
  1546 + + " (select max(id) from bsth_c_line_config where line = (select id from bsth_c_line where line_code = a.xl_bm))) start_opt"
  1547 + + " from bsth_c_s_sp_info_real a where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'"
1547 1548 + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'";
1548 1549 if(line.length() != 0)
1549 1550 sql += " and xl_bm = '"+line+"'";
... ... @@ -1575,8 +1576,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1575 1576 schedule.setCcService(rs.getBoolean("cc_service"));
1576 1577 schedule.setRemarks(rs.getString("remarks")!=null?rs.getString("remarks"):"");
1577 1578 schedule.setAdjustExps(rs.getString("adjust_exps")!=null?rs.getString("adjust_exps"):"");
1578   -
1579   - int startOpt = 0;
  1579 +
  1580 + int startOpt = 120;
1580 1581 if(rs.getString("start_opt") != null && rs.getString("start_opt").trim().length() != 0){
1581 1582 String[] split = rs.getString("start_opt").split(":");
1582 1583 startOpt = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
... ...