Commit 63f75b58 by java-温文海

航线论证需求变更(传入开始和结束时间)

parent f36d1c62
......@@ -218,7 +218,29 @@
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
)
</if>
<if test="beginTime != null and beginTime != '' and endTime !=null and endTime != ''">
and (
<foreach item="list" collection="item" index="index" separator="or" open="(" close=")">
favt.dep_iata = #{item.dspStn}
and favt.arr_iata = #{item.arrStn}
</foreach>
)
</if>
ORDER BY favt.last_airline_time DESC
</select>
<select id="getAirporStnList" resultType="com.ejweb.modules.airport.entity.AirportInfoEntity">
SELECT
ffd.dep_stn,
ffd.arr_stn
FROM
foc_flight_dynamics ffd
WHERE
ffd.std_chn BETWEEN #{beginTime}
AND #{endTime}
GROUP BY
ffd.dep_stn,
ffd.arr_stn;
</select>
</mapper>
\ No newline at end of file
......@@ -19,8 +19,8 @@ public class StatisticalListBean extends GenericBean {
private int pageSize = GConstants.PAGE_SIZE;//每页条数
private String benchmarkingTime;
private Integer airlineStatus;
/* private String beginTime;
private String endTime;*/
private String beginTime;
private String endTime;
public String getDepIata() {
return depIata;
......@@ -78,7 +78,7 @@ public class StatisticalListBean extends GenericBean {
this.airlineStatus = airlineStatus;
}
/*public String getBeginTime() {
public String getBeginTime() {
return beginTime;
}
......@@ -92,5 +92,5 @@ public class StatisticalListBean extends GenericBean {
public void setEndTime(String endTime) {
this.endTime = endTime;
}*/
}
}
......@@ -6,22 +6,28 @@ package com.ejweb.modules.airport.dao;
import com.ejweb.core.base.BaseDao;
import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.bean.StatisticalListBean;
import com.ejweb.modules.airport.entity.AirportInfoEntity;
import com.ejweb.modules.airport.entity.StatisticalEntity;
import com.ejweb.modules.airport.entity.StatisticalListEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* @team suzhou
* @author huhy
* @version 1.0
* @team suzhou
* @time 2016年9月8日
*/
public interface StatisticalDao extends BaseDao{
public interface StatisticalDao extends BaseDao {
List<StatisticalEntity> getStatisticalList(StatisticalBean bean);
List<StatisticalEntity> getStatisticalArrIataList(StatisticalBean bean);
Integer getDay(StatisticalEntity entity);
List<StatisticalListEntity> getList(StatisticalListBean statisticalListBean);
List<StatisticalListEntity> getList(StatisticalListBean statisticalListBean, List<AirportInfoEntity> airportInfoEntities);
List<AirportInfoEntity> getAirporStnList(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
package com.ejweb.modules.airport.entity;
import com.ejweb.core.base.BaseEntity;
public class AirportInfoEntity extends BaseEntity {
private static final long serialVersionUID = -4211749532324022040L;
private String arrStn;
private String dspStn;
public String getArrStn() {
return arrStn;
}
public void setArrStn(String arrStn) {
this.arrStn = arrStn;
}
public String getDspStn() {
return dspStn;
}
public void setDspStn(String dspStn) {
this.dspStn = dspStn;
}
}
......@@ -3,8 +3,6 @@ package com.ejweb.modules.airport.entity;
import com.ejweb.core.base.BaseEntity;
import com.ejweb.core.utils.excel.annotation.ExcelField;
import java.util.List;
public class StatisticalListEntity extends BaseEntity {
private static final long serialVersionUID = -4211749532324022040L;
......
......@@ -8,7 +8,7 @@ import com.ejweb.core.base.PageEntity;
import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.bean.StatisticalListBean;
import com.ejweb.modules.airport.dao.StatisticalDao;
import com.ejweb.modules.airport.entity.AirPlaneEntity;
import com.ejweb.modules.airport.entity.AirportInfoEntity;
import com.ejweb.modules.airport.entity.StatisticalEntity;
import com.ejweb.modules.airport.entity.StatisticalListEntity;
import com.ejweb.modules.verify.bean.AirlineVerifiedAddBean;
......@@ -23,7 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
/**
* @author huhy
......@@ -142,9 +145,15 @@ public class StatisticalService extends BaseService<StatisticalDao> {
}
public PageEntity<StatisticalListEntity> getList(StatisticalListBean statisticalListBean){
public PageEntity<StatisticalListEntity> getList(StatisticalListBean statisticalListBean) {
//通过开始时间和结束时间查询航班
List<AirportInfoEntity> airportInfoEntities = null;
if (statisticalListBean.getBeginTime().equals(' ') && statisticalListBean.getEndTime().equals(" ")) {
airportInfoEntities = statisticalDao.getAirporStnList(statisticalListBean.getBeginTime(), statisticalListBean.getEndTime());
}
List<StatisticalListEntity> lists = null;
lists = statisticalDao.getList(statisticalListBean);
lists = statisticalDao.getList(statisticalListBean, airportInfoEntities);
if (Objects.nonNull(statisticalListBean.getAirlineStatus())) {
//使用迭代器进行筛选
Iterator<StatisticalListEntity> iter = lists.iterator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment