Commit 63f75b58 by java-温文海

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

parent f36d1c62
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ejweb.modules.airport.dao.StatisticalDao"> <mapper namespace="com.ejweb.modules.airport.dao.StatisticalDao">
<select id="getStatisticalList" resultType="com.ejweb.modules.airport.entity.StatisticalEntity"> <select id="getStatisticalList" resultType="com.ejweb.modules.airport.entity.StatisticalEntity">
SELECT a.verif_no as verifNo, SELECT a.verif_no as verifNo,
a.id as verifId, a.id as verifId,
CASE WHEN a.verif_type='01' OR a.verif_type='02' CASE WHEN a.verif_type='01' OR a.verif_type='02'
...@@ -218,7 +218,29 @@ ...@@ -218,7 +218,29 @@
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
) )
</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 ORDER BY favt.last_airline_time DESC
</select> </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> </mapper>
\ No newline at end of file
...@@ -19,8 +19,8 @@ public class StatisticalListBean extends GenericBean { ...@@ -19,8 +19,8 @@ public class StatisticalListBean extends GenericBean {
private int pageSize = GConstants.PAGE_SIZE;//每页条数 private int pageSize = GConstants.PAGE_SIZE;//每页条数
private String benchmarkingTime; private String benchmarkingTime;
private Integer airlineStatus; private Integer airlineStatus;
/* private String beginTime; private String beginTime;
private String endTime;*/ private String endTime;
public String getDepIata() { public String getDepIata() {
return depIata; return depIata;
...@@ -78,7 +78,7 @@ public class StatisticalListBean extends GenericBean { ...@@ -78,7 +78,7 @@ public class StatisticalListBean extends GenericBean {
this.airlineStatus = airlineStatus; this.airlineStatus = airlineStatus;
} }
/*public String getBeginTime() { public String getBeginTime() {
return beginTime; return beginTime;
} }
...@@ -92,5 +92,5 @@ public class StatisticalListBean extends GenericBean { ...@@ -92,5 +92,5 @@ public class StatisticalListBean extends GenericBean {
public void setEndTime(String endTime) { public void setEndTime(String endTime) {
this.endTime = endTime; this.endTime = endTime;
}*/ }
} }
...@@ -6,22 +6,28 @@ package com.ejweb.modules.airport.dao; ...@@ -6,22 +6,28 @@ package com.ejweb.modules.airport.dao;
import com.ejweb.core.base.BaseDao; import com.ejweb.core.base.BaseDao;
import com.ejweb.modules.airport.bean.StatisticalBean; import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.bean.StatisticalListBean; 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.StatisticalEntity;
import com.ejweb.modules.airport.entity.StatisticalListEntity; import com.ejweb.modules.airport.entity.StatisticalListEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
*
* @team suzhou
* @author huhy * @author huhy
* @version 1.0 * @version 1.0
* @time 2016年9月8日 * @team suzhou
* @time 2016年9月8日
*/ */
public interface StatisticalDao extends BaseDao{ public interface StatisticalDao extends BaseDao {
List<StatisticalEntity> getStatisticalList(StatisticalBean bean); List<StatisticalEntity> getStatisticalList(StatisticalBean bean);
List<StatisticalEntity> getStatisticalArrIataList(StatisticalBean bean); List<StatisticalEntity> getStatisticalArrIataList(StatisticalBean bean);
Integer getDay(StatisticalEntity entity); 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; ...@@ -3,8 +3,6 @@ package com.ejweb.modules.airport.entity;
import com.ejweb.core.base.BaseEntity; import com.ejweb.core.base.BaseEntity;
import com.ejweb.core.utils.excel.annotation.ExcelField; import com.ejweb.core.utils.excel.annotation.ExcelField;
import java.util.List;
public class StatisticalListEntity extends BaseEntity { public class StatisticalListEntity extends BaseEntity {
private static final long serialVersionUID = -4211749532324022040L; private static final long serialVersionUID = -4211749532324022040L;
......
...@@ -8,7 +8,7 @@ import com.ejweb.core.base.PageEntity; ...@@ -8,7 +8,7 @@ import com.ejweb.core.base.PageEntity;
import com.ejweb.modules.airport.bean.StatisticalBean; import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.bean.StatisticalListBean; import com.ejweb.modules.airport.bean.StatisticalListBean;
import com.ejweb.modules.airport.dao.StatisticalDao; 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.StatisticalEntity;
import com.ejweb.modules.airport.entity.StatisticalListEntity; import com.ejweb.modules.airport.entity.StatisticalListEntity;
import com.ejweb.modules.verify.bean.AirlineVerifiedAddBean; import com.ejweb.modules.verify.bean.AirlineVerifiedAddBean;
...@@ -23,7 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -23,7 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat; 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 * @author huhy
...@@ -142,9 +145,15 @@ public class StatisticalService extends BaseService<StatisticalDao> { ...@@ -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; List<StatisticalListEntity> lists = null;
lists = statisticalDao.getList(statisticalListBean); lists = statisticalDao.getList(statisticalListBean, airportInfoEntities);
if (Objects.nonNull(statisticalListBean.getAirlineStatus())) { if (Objects.nonNull(statisticalListBean.getAirlineStatus())) {
//使用迭代器进行筛选 //使用迭代器进行筛选
Iterator<StatisticalListEntity> iter = lists.iterator(); 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