作者 朱兆平

进港统计改为以理货信息为主统计

... ... @@ -35,7 +35,7 @@ public class NmmsAnalysisController {
map.put("startdate",startdate);
map.put("enddate",enddate);
map.put("flightno",flightno);
List<ORIGINMANIFESTMASTER> list = mapper.analysis(map);
List<ORIGINMANIFESTMASTER> list = mapper.analysis_with_tally(map);
return new ResultJson("200","success",list);
}
... ...
... ... @@ -8,8 +8,20 @@ import java.util.Map;
public interface ORIGINMANIFESTMASTERMapper {
/**
* 原始舱单主分单统计分析
* @param map
* @return
*/
List<ORIGINMANIFESTMASTER> analysis(Map map);
/**
* 理货主分单/舱单连表统计分析
* @param map
* @return
*/
List<ORIGINMANIFESTMASTER> analysis_with_tally(Map map);
int insert(ORIGINMANIFESTMASTER record);
int insertSelective(ORIGINMANIFESTMASTER record);
... ...
... ... @@ -106,7 +106,7 @@ FROM
awbh.WAYBILLNOSECONDARY AS WAYBILLNOSECONDARY,
awbh.PIECE AS TOTALPIECE,
awbh.WEIGHT AS TOTALWEIGHT,
awbh.MANIFESTPIECE AS MANIFESTTOTALPIECE,
awbh.MANIFESTTOTALWEIGHT AS MANIFESTTOTALPIECE,
awbh.MANIFESTWEIGHT AS MANIFESTTOTALWEIGHT,
awbh.AWBHPRODUCTNAME AS PRODUCTNAME,
awbh.ORIGINATINGSTATION AS ORIGINATINGSTATION,
... ... @@ -150,6 +150,101 @@ LEFT JOIN
ORDER BY T.FLIGHT_DATE,T.FLIGHTNO,WAYBILLNOMASTER,WAYBILLNOSECONDARY DESC
</select>
<select id="analysis_with_tally" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT
T.FLIGHTNO,
T.FLIGHT_DATE,
T.SEGMENT,
T.WAYBILLNOMASTER,
T.WAYBILLNOSECONDARY,
T.TOTALPIECE,
T.TOTALWEIGHT,
T.MANIFESTTOTALPIECE,
T.MANIFESTTOTALWEIGHT,
T.PRODUCTNAME,
T.ORIGINATINGSTATION,
C.CHINESEDESCRIPTION as ORIGINATINGSTATIONCN,
T.DESTINATIONSTATION,
C1.CHINESEDESCRIPTION AS DESTINATIONSTATIONCN,
T.ORIGINATINGSTATION_BILL,
CB1.CHINESEDESCRIPTION as ORIGINATINGSTATIONBILLCN,
T.DESTINATIONSTATION_BILL,
CB2.CHINESEDESCRIPTION AS DESTINATIONSTATIONBILLCN,
T.SHIPPER_COUNTRYCODE,
COUNTRY.COUNTRYDESCCHN,
AREA.AREADESCCHN
FROM
(
SELECT
M.FLIGHTNO AS FLIGHTNO,
M.FLIGHT_DATE AS FLIGHT_DATE,
M.SEGMENT AS SEGMENT,
M.WAYBILLNOMASTER AS WAYBILLNOMASTER,
'' AS WAYBILLNOSECONDARY,
M.TOTALPIECE AS TOTALPIECE,
M.TOTALWEIGHT AS TOTALWEIGHT,
M.MANIFESTTOTALPIECE AS MANIFESTTOTALPIECE,
M.MANIFESTTOTALWEIGHT AS MANIFESTTOTALWEIGHT,
M.PRODUCTNAME AS PRODUCTNAME,
M.ORIGINATINGSTATION AS ORIGINATINGSTATION,
M.DESTINATIONSTATION AS DESTINATIONSTATION,
M.ORIGINATINGSTATION_BILL AS ORIGINATINGSTATION_BILL,
M.DESTINATIONSTATION_BILL AS DESTINATIONSTATION_BILL,
M.SHIPPER_COUNTRYCODE AS SHIPPER_COUNTRYCODE
FROM
V_TALLY_ORIGIN M UNION
SELECT
awbh.FLIGHTNO AS FLIGHTNO,
awbh.FLIGHT_DATE AS FLIGHT_DATE,
awbh.SEGMENT AS SEGMENT,
awbh.WAYBILLNOMASTER AS WAYBILLNOMASTER,
awbh.WAYBILLNOSECONDARY AS WAYBILLNOSECONDARY,
awbh.PIECE AS TOTALPIECE,
awbh.WEIGHT AS TOTALWEIGHT,
awbh.TALLYPIECE AS MANIFESTTOTALPIECE,
awbh.TALLYWEIGHT AS MANIFESTTOTALWEIGHT,
awbh.AWBHPRODUCTNAME AS PRODUCTNAME,
awbh.ORIGINATINGSTATION AS ORIGINATINGSTATION,
awbh.DESTINATIONSTATION AS DESTINATIONSTATION,
awbh.ORIGINATINGSTATION_BILL AS ORIGINATINGSTATION_BILL,
awbh.DESTINATIONSTATION_BILL AS DESTINATIONSTATION_BILL,
awbh.AWBHSHIPPER_COUNTRYCODE AS SHIPPER_COUNTRYCODE
FROM
V_TALLY_AWBA_AWBH awbh
) T
LEFT JOIN
TB_AIRPORTCODE C
ON
C.CITYCODE = T.ORIGINATINGSTATION
LEFT JOIN
TB_AIRPORTCODE C1
ON
C1.CITYCODE = T.DESTINATIONSTATION
LEFT JOIN
TB_AIRPORTCODE CB1
ON
CB1.CITYCODE = T.ORIGINATINGSTATION_BILL
LEFT JOIN
TB_AIRPORTCODE CB2
ON
CB2.CITYCODE = T.DESTINATIONSTATION_BILL
LEFT JOIN
T_BAS_COUNTRY COUNTRY
ON
COUNTRY.COUNTRYID = T.SHIPPER_COUNTRYCODE
LEFT JOIN
T_BAS_AREA AREA
ON
CB1.AREA = AREA.AREAID
WHERE
trunc( T.FLIGHT_DATE ) BETWEEN to_date( #{startdate,jdbcType=VARCHAR}, 'yyyy-mm-dd' )
AND to_date(#{enddate,jdbcType=VARCHAR},'yyyy-mm-dd')
<if test="flightno != null and flightno !=''" >
AND T.FLIGHTNO = #{flightno,jdbcType=VARCHAR}
</if>
ORDER BY T.FLIGHT_DATE,T.FLIGHTNO,WAYBILLNOMASTER,WAYBILLNOSECONDARY DESC
</select>
<insert id="insert" parameterType="com.tianbo.imfClient.model.ORIGINMANIFESTMASTER" >
insert into ORIGINMANIFESTMASTER (AUTOID, WAYBILLNOMASTER, SEGMENT,
ORIGINATINGSTATION, DESTINATIONSTATION,
... ...