Commit 77317cca by java-温文海

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

parent 63f75b58
...@@ -179,9 +179,9 @@ ...@@ -179,9 +179,9 @@
DATE_FORMAT(favt.last_airline_time,'%Y/%m/%d') AS lastAirlineTime, DATE_FORMAT(favt.last_airline_time,'%Y/%m/%d') AS lastAirlineTime,
CASE CASE
WHEN WHEN
DATE_SUB( #{benchmarkingTime}, INTERVAL 180 DAY ) <![CDATA[<=]]> favt.last_airline_time DATE_SUB( #{bean.benchmarkingTime}, INTERVAL 180 DAY ) <![CDATA[<=]]> favt.last_airline_time
AND AND
favt.last_airline_time <![CDATA[<=]]> DATE_SUB( #{benchmarkingTime}, INTERVAL - 180 DAY ) favt.last_airline_time <![CDATA[<=]]> DATE_SUB( #{bean.benchmarkingTime}, INTERVAL - 180 DAY )
THEN THEN
1 1
ELSE ELSE
...@@ -192,39 +192,39 @@ ...@@ -192,39 +192,39 @@
FROM FROM
foc_airline_sta favt foc_airline_sta favt
WHERE WHERE
favt.del_flag = #{DEL_FLAG_NORMAL} favt.del_flag = #{bean.DEL_FLAG_NORMAL}
<!--当出发地不为空,目的地为空 --> <!--当出发地不为空,目的地为空 -->
<if test="(depIata != null and depIata != '') "> <if test="(bean.depIata != null and bean.depIata != '') ">
AND ( favt.dep_iata LIKE AND ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if> <if test="dbName == 'oracle'">'%'||#{bean.depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if> <if test="dbName == 'mssql'">'%'+#{bean.depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{bean.depIata}, '%')</if>
or favt.arr_iata LIKE or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if> <if test="dbName == 'oracle'">'%'||#{bean.depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if> <if test="dbName == 'mssql'">'%'+#{bean.depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{bean.depIata}, '%')</if>
) )
</if> </if>
<!--当出发地为空,目的地不为空 --> <!--当出发地为空,目的地不为空 -->
<if test=" (arrIata != null and arrIata != '')"> <if test=" (bean.arrIata != null and bean.arrIata != '')">
and ( favt.dep_iata LIKE and ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if> <if test="dbName == 'oracle'">'%'||#{bean.arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if> <if test="dbName == 'mssql'">'%'+#{bean.arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{bean.arrIata}, '%')</if>
or favt.arr_iata LIKE or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if> <if test="dbName == 'oracle'">'%'||#{bean.arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if> <if test="dbName == 'mssql'">'%'+#{bean.arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{bean.arrIata}, '%')</if>
) )
</if> </if>
<if test="beginTime != null and beginTime != '' and endTime !=null and endTime != ''"> <if test="bean.beginTime != null and bean.beginTime != '' and bean.endTime !=null and bean.endTime != ''">
and ( and
<foreach item="list" collection="item" index="index" separator="or" open="(" close=")"> <foreach collection="list" item="item" index="index" separator="or" open="(" close=")">
favt.dep_iata = #{item.dspStn} (favt.dep_iata = #{item.depStn}
and favt.arr_iata = #{item.arrStn} and favt.arr_iata = #{item.arrStn})
</foreach> </foreach>
)
</if> </if>
ORDER BY favt.last_airline_time DESC ORDER BY favt.last_airline_time DESC
...@@ -232,15 +232,15 @@ ...@@ -232,15 +232,15 @@
<select id="getAirporStnList" resultType="com.ejweb.modules.airport.entity.AirportInfoEntity"> <select id="getAirporStnList" resultType="com.ejweb.modules.airport.entity.AirportInfoEntity">
SELECT SELECT
ffd.dep_stn, dep_stn,
ffd.arr_stn arr_stn
FROM FROM
foc_flight_dynamics ffd foc_flight_dynamics
WHERE WHERE
ffd.std_chn BETWEEN #{beginTime} std_chn BETWEEN #{beginTime}
AND #{endTime} AND #{endTime}
GROUP BY GROUP BY
ffd.dep_stn, dep_stn,
ffd.arr_stn; arr_stn;
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,7 +27,7 @@ public interface StatisticalDao extends BaseDao { ...@@ -27,7 +27,7 @@ public interface StatisticalDao extends BaseDao {
Integer getDay(StatisticalEntity entity); Integer getDay(StatisticalEntity entity);
List<StatisticalListEntity> getList(StatisticalListBean statisticalListBean, List<AirportInfoEntity> airportInfoEntities); List<StatisticalListEntity> getList(@Param("bean") StatisticalListBean statisticalListBean,@Param("list") List<AirportInfoEntity> airportInfoEntities);
List<AirportInfoEntity> getAirporStnList(@Param("beginTime") String beginTime, @Param("endTime") String endTime); List<AirportInfoEntity> getAirporStnList(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
} }
...@@ -9,7 +9,7 @@ public class AirportInfoEntity extends BaseEntity { ...@@ -9,7 +9,7 @@ public class AirportInfoEntity extends BaseEntity {
private String arrStn; private String arrStn;
private String dspStn; private String depStn;
public String getArrStn() { public String getArrStn() {
...@@ -20,11 +20,11 @@ public class AirportInfoEntity extends BaseEntity { ...@@ -20,11 +20,11 @@ public class AirportInfoEntity extends BaseEntity {
this.arrStn = arrStn; this.arrStn = arrStn;
} }
public String getDspStn() { public String getDepStn() {
return dspStn; return depStn;
} }
public void setDspStn(String dspStn) { public void setDepStn(String depStn) {
this.dspStn = dspStn; this.depStn = depStn;
} }
} }
...@@ -148,7 +148,7 @@ public class StatisticalService extends BaseService<StatisticalDao> { ...@@ -148,7 +148,7 @@ public class StatisticalService extends BaseService<StatisticalDao> {
public PageEntity<StatisticalListEntity> getList(StatisticalListBean statisticalListBean) { public PageEntity<StatisticalListEntity> getList(StatisticalListBean statisticalListBean) {
//通过开始时间和结束时间查询航班 //通过开始时间和结束时间查询航班
List<AirportInfoEntity> airportInfoEntities = null; List<AirportInfoEntity> airportInfoEntities = null;
if (statisticalListBean.getBeginTime().equals(' ') && statisticalListBean.getEndTime().equals(" ")) { if (!(statisticalListBean.getBeginTime().equals(' ') && statisticalListBean.getEndTime().equals(" "))) {
airportInfoEntities = statisticalDao.getAirporStnList(statisticalListBean.getBeginTime(), statisticalListBean.getEndTime()); airportInfoEntities = statisticalDao.getAirporStnList(statisticalListBean.getBeginTime(), statisticalListBean.getEndTime());
} }
......
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