作者 朱兆平

运单查询

package com.tianbo.analysis.controller;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.dao.COMPANYUSERMapper;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.OriginService;
import com.tianbo.analysis.service.PREPARMASTERService;
import com.tianbo.util.Date.DateUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Slf4j
@RestController
@RequestMapping("/nmms/exp")
public class NmmsExportController {
@Autowired
OriginService originService;
@Autowired
PREPARMASTERService preparmasterService;
@GetMapping("search")
public ResultJson<PageInfo> searh(@RequestParam(value = "awba",required = false) String awba,
@RequestParam(value = "flightDate",required = false) String flightDate,
@RequestParam(value = "flightNo",required = false) String flightNo,
@RequestParam(value = "dom",required = false) String dom,
@RequestParam(value = "pageNum",defaultValue = "1") int pageNum,
@RequestParam(value = "pageSize",defaultValue = "10") int pageSize
){
if ("imp".equals(dom)){
PageInfo<ORIGINMANIFESTMASTER> result = originService.search(awba,flightDate,flightNo,pageNum,pageSize);
return new ResultJson<>("200", "success", result);
}else{
PageInfo<PREPAREMASTER> result = preparmasterService.search_exp(awba,flightDate,flightNo,pageNum,pageSize);
return new ResultJson<>("200", "success", result);
}
}
}
... ...
... ... @@ -50,4 +50,6 @@ public class PREPAREMASTERController {
PageInfo<PREPAREMASTER> pageInfo= preparmasterService.search(preparemaster,page,limit);
return new ResultJson("200","OK",pageInfo);
}
}
... ...
... ... @@ -17,4 +17,11 @@ public interface ORIGINMANIFESTMASTERMapper {
ORIGINMANIFESTMASTER selectByAHBA(ORIGINMANIFESTMASTER record);
List<Map> statics(@Param("startDate") String var1, @Param("endDate")String var2);
List<ORIGINMANIFESTMASTER> search(@Param("waybillnomaster") String var1,
@Param("flightNo")String var2,
@Param("flightDate")String var3
);
List<ORIGINMANIFESTMASTER> searchSec(String autoid);
}
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.PREPAREMASTER;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -27,4 +28,12 @@ public interface PREPAREMASTERMapper {
int updateByPrimaryKey(PREPAREMASTER record);
int updatePreArrivedBill(PREPAREMASTER record);
List<PREPAREMASTER> searchTree(@Param("waybillnomaster") String var1,
@Param("flightNo")String var2,
@Param("flightDate")String var3,
@Param("carrier")String var4
);
List<PREPAREMASTER> searchSec(String autoid);
}
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.SENDPLAN;
public interface SENDPLANMapper {
int deleteByPrimaryKey(String carrier);
int insert(SENDPLAN record);
int insertSelective(SENDPLAN record);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.model;
import lombok.Data;
public class ManifestBase {
public String messagetype;
}
... ...
package com.tianbo.analysis.model;
import java.util.Date;
import java.util.List;
public class ORIGINMANIFESTMASTER {
public class ORIGINMANIFESTMASTER extends ManifestBase{
private String autoid;
private String waybillnomaster;
... ... @@ -91,6 +92,8 @@ public class ORIGINMANIFESTMASTER {
private String consigneePhone;
public List<ORIGINMANIFESTMASTER> chidren;
public String getAutoid() {
return autoid;
}
... ... @@ -452,4 +455,4 @@ public class ORIGINMANIFESTMASTER {
this.flightno = flightno;
this.flightDate = flightDate;
}
}
\ No newline at end of file
}
... ...
package com.tianbo.analysis.model;
import java.util.Date;
import java.util.List;
public class PREPAREMASTER {
private String autoid;
... ... @@ -9,6 +10,8 @@ public class PREPAREMASTER {
private Date flightdate;
private Date flightDate;
private String originatingstation;
private String destinationstation;
... ... @@ -81,6 +84,10 @@ public class PREPAREMASTER {
private String arrivedAhead;
public String messagetype;
public List<PREPAREMASTER> chidren;
public String getAutoid() {
return autoid;
}
... ... @@ -392,4 +399,13 @@ public class PREPAREMASTER {
public void setArrivedAhead(String arrivedAhead) {
this.arrivedAhead = arrivedAhead == null ? null : arrivedAhead.trim();
}
}
\ No newline at end of file
public Date getFlightDate() {
return flightdate;
}
public void setFlightDate(Date flightDate) {
this.flightDate = flightDate;
this.flightdate = flightDate;
}
}
... ...
package com.tianbo.analysis.model;
public class SENDPLAN {
private String carrier;
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.service;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.model.Originmanifestsecondary;
import org.springframework.web.bind.annotation.RequestParam;
public interface OriginService {
... ... @@ -10,4 +12,11 @@ public interface OriginService {
* @return
*/
int deleteAwbh(String awbhAutoId);
PageInfo search( String awba,
String flightDate,
String flightNo,
int page,
int limit);
}
... ...
... ... @@ -5,4 +5,19 @@ import com.tianbo.analysis.model.PREPAREMASTER;
public interface PREPARMASTERService {
PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize);
/**
* 出港查询
* @param awba
* @param flightDate
* @param flightNo
* @param page
* @param limit
* @return
*/
PageInfo<PREPAREMASTER> search_exp( String awba,
String flightDate,
String flightNo,
int page,
int limit);
}
... ...
package com.tianbo.analysis.service.imp;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.service.OriginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class OriginServiceImp implements OriginService {
... ... @@ -22,4 +28,13 @@ public class OriginServiceImp implements OriginService {
public int deleteAwbh(String awbhAutoId){
return originmanifestsecondaryMapper.deleteAwbh(awbhAutoId);
}
@Override
public PageInfo<ORIGINMANIFESTMASTER> search(String awba, String flightDate, String flightNo, int pageNum, int pageSize) {
Page<ORIGINMANIFESTMASTER> page = PageHelper.startPage(pageNum,pageSize);
List<ORIGINMANIFESTMASTER> list = originmanifestmasterMapper.search(awba,flightNo,flightDate);
PageInfo<ORIGINMANIFESTMASTER> result = new PageInfo<ORIGINMANIFESTMASTER>(list);
return result;
}
}
... ...
... ... @@ -8,6 +8,7 @@ import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.service.PREPARMASTERService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
... ... @@ -25,4 +26,14 @@ public class PREPARMASTERServiceImpl implements PREPARMASTERService {
PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
return result;
}
@Override
public PageInfo search_exp(String awba, String flightDate, String flightNo, int pageNum, int pageSize) {
Page<PREPAREMASTER> page = PageHelper.startPage(pageNum,pageSize);
String carrier = StringUtils.isEmpty(flightNo) ? "" : flightNo.substring(0,2);
String flight = StringUtils.isEmpty(flightNo) ? "" : flightNo.substring(2);
List<PREPAREMASTER> list = preparemasterMapper.searchTree(awba,flight,flightDate,carrier);
PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
return result;
}
}
... ...
... ... @@ -47,6 +47,6 @@
<property name="enableSubPackages" value="false"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table schema="CGONMS" tableName="FFM_INFO" domainObjectName="FFM_INFO" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table schema="CGONMS" tableName="SENDPLAN" domainObjectName="SENDPLAN" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
... ...
<?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" >
<mapper namespace="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="SEGMENT" property="segment" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR" />
<result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR" />
<result column="CARRIER1" property="carrier1" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR" />
<result column="CARRIER2" property="carrier2" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR" />
<result column="CARRIER3" property="carrier3" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR" />
<result column="PAYMODE" property="paymode" jdbcType="VARCHAR" />
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" />
<result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR" />
<result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR" />
<result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR" />
<result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR" />
<result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="ISBATCH" property="isbatch" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />
<result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR" />
<result column="ISLAST" property="islast" jdbcType="VARCHAR" />
<result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR" />
<result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR" />
<result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR" />
<result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR" />
<result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR" />
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
<mapper namespace="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper">
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
<result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
<result column="SEGMENT" property="segment" jdbcType="VARCHAR"/>
<result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR"/>
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR"/>
<result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR"/>
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR"/>
<result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR"/>
<result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR"/>
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
<result column="CARRIER1" property="carrier1" jdbcType="VARCHAR"/>
<result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR"/>
<result column="CARRIER2" property="carrier2" jdbcType="VARCHAR"/>
<result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR"/>
<result column="CARRIER3" property="carrier3" jdbcType="VARCHAR"/>
<result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR"/>
<result column="PAYMODE" property="paymode" jdbcType="VARCHAR"/>
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR"/>
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
<result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR"/>
<result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR"/>
<result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR"/>
<result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR"/>
<result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
<result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE"/>
<result column="STATUS" property="status" jdbcType="VARCHAR"/>
<result column="ISBATCH" property="isbatch" jdbcType="VARCHAR"/>
<result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR"/>
<result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR"/>
<result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR"/>
<result column="ISLAST" property="islast" jdbcType="VARCHAR"/>
<result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR"/>
<result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR"/>
<result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR"/>
<result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR"/>
<result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR"/>
<result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR"/>
<result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR"/>
<result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR"/>
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR"/>
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR"/>
<result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE
</sql>
<insert id="insert" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
<resultMap id="TreeMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
<result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
<result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR"/>
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR"/>
<result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR"/>
<result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR"/>
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
<result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
<result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE"/>
<result column="STATUS" property="status" jdbcType="VARCHAR"/>
<result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
<collection property="chidren"
column="AUTOID"
ofType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER"
select="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper.searchSec">
</collection>
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
insert into ORIGINMANIFESTMASTER (AUTOID, WAYBILLNOMASTER, SEGMENT,
ORIGINATINGSTATION, DESTINATIONSTATION,
TOTALWEIGHT, TOTALPIECE, MANIFESTTOTALPIECE,
... ... @@ -84,278 +107,278 @@
#{specificConsigneename,jdbcType=VARCHAR}, #{specificConsigneePhone,jdbcType=VARCHAR},
#{consigneePhone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
insert into ORIGINMANIFESTMASTER
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="segment != null" >
SEGMENT,
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION,
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION,
</if>
<if test="totalweight != null" >
TOTALWEIGHT,
</if>
<if test="totalpiece != null" >
TOTALPIECE,
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE,
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT,
</if>
<if test="flightno != null" >
FLIGHTNO,
</if>
<if test="productname != null" >
PRODUCTNAME,
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS,
</if>
<if test="carrier1 != null" >
CARRIER1,
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1,
</if>
<if test="carrier2 != null" >
CARRIER2,
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2,
</if>
<if test="carrier3 != null" >
CARRIER3,
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3,
</if>
<if test="paymode != null" >
PAYMODE,
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE,
</if>
<if test="customscode != null" >
CUSTOMSCODE,
</if>
<if test="shippername != null" >
SHIPPERNAME,
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS,
</if>
<if test="consigneename != null" >
CONSIGNEENAME,
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS,
</if>
<if test="receiptinformation != null" >
RECEIPTINFORMATION,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="flightDate != null" >
FLIGHT_DATE,
</if>
<if test="status != null" >
STATUS,
</if>
<if test="isbatch != null" >
ISBATCH,
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL,
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL,
</if>
<if test="reportorder != null" >
REPORTORDER,
</if>
<if test="islast != null" >
ISLAST,
</if>
<if test="shipperCode != null" >
SHIPPER_CODE,
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE,
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE,
</if>
<if test="shipperFax != null" >
SHIPPER_FAX,
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE,
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE,
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX,
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME,
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE,
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="segment != null" >
#{segment,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
#{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
#{destinationstation,jdbcType=VARCHAR},
</if>
<if test="totalweight != null" >
#{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
#{totalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
#{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
#{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="flightno != null" >
#{flightno,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
#{productname,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
#{customsstatus,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
#{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
#{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
#{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
#{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
#{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
#{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
#{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
#{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
#{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
#{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
#{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
#{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="receiptinformation != null" >
#{receiptinformation,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightDate != null" >
#{flightDate,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
#{isbatch,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
#{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
#{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
#{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
#{islast,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
#{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
#{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
#{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
#{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
#{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
#{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
#{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
#{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
#{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
#{consigneePhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="changeFlightDate" parameterType="hashmap">
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
insert into ORIGINMANIFESTMASTER
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="autoid != null">
AUTOID,
</if>
<if test="waybillnomaster != null">
WAYBILLNOMASTER,
</if>
<if test="segment != null">
SEGMENT,
</if>
<if test="originatingstation != null">
ORIGINATINGSTATION,
</if>
<if test="destinationstation != null">
DESTINATIONSTATION,
</if>
<if test="totalweight != null">
TOTALWEIGHT,
</if>
<if test="totalpiece != null">
TOTALPIECE,
</if>
<if test="manifesttotalpiece != null">
MANIFESTTOTALPIECE,
</if>
<if test="manifesttotalweight != null">
MANIFESTTOTALWEIGHT,
</if>
<if test="flightno != null">
FLIGHTNO,
</if>
<if test="productname != null">
PRODUCTNAME,
</if>
<if test="customsstatus != null">
CUSTOMSSTATUS,
</if>
<if test="carrier1 != null">
CARRIER1,
</if>
<if test="arrivalstation1 != null">
ARRIVALSTATION1,
</if>
<if test="carrier2 != null">
CARRIER2,
</if>
<if test="arrivalstation2 != null">
ARRIVALSTATION2,
</if>
<if test="carrier3 != null">
CARRIER3,
</if>
<if test="arrivalstation3 != null">
ARRIVALSTATION3,
</if>
<if test="paymode != null">
PAYMODE,
</if>
<if test="specialgoodscode != null">
SPECIALGOODSCODE,
</if>
<if test="customscode != null">
CUSTOMSCODE,
</if>
<if test="shippername != null">
SHIPPERNAME,
</if>
<if test="shipperaddress != null">
SHIPPERADDRESS,
</if>
<if test="consigneename != null">
CONSIGNEENAME,
</if>
<if test="consigneeaddress != null">
CONSIGNEEADDRESS,
</if>
<if test="receiptinformation != null">
RECEIPTINFORMATION,
</if>
<if test="createdate != null">
CREATEDATE,
</if>
<if test="flightDate != null">
FLIGHT_DATE,
</if>
<if test="status != null">
STATUS,
</if>
<if test="isbatch != null">
ISBATCH,
</if>
<if test="originatingstationBill != null">
ORIGINATINGSTATION_BILL,
</if>
<if test="destinationstationBill != null">
DESTINATIONSTATION_BILL,
</if>
<if test="reportorder != null">
REPORTORDER,
</if>
<if test="islast != null">
ISLAST,
</if>
<if test="shipperCode != null">
SHIPPER_CODE,
</if>
<if test="shipperCountrycode != null">
SHIPPER_COUNTRYCODE,
</if>
<if test="shipperPhone != null">
SHIPPER_PHONE,
</if>
<if test="shipperFax != null">
SHIPPER_FAX,
</if>
<if test="consigneeCode != null">
CONSIGNEE_CODE,
</if>
<if test="consigneeCountrycode != null">
CONSIGNEE_COUNTRYCODE,
</if>
<if test="consigneeFax != null">
CONSIGNEE_FAX,
</if>
<if test="specificConsigneename != null">
SPECIFIC_CONSIGNEENAME,
</if>
<if test="specificConsigneePhone != null">
SPECIFIC_CONSIGNEE_PHONE,
</if>
<if test="consigneePhone != null">
CONSIGNEE_PHONE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="autoid != null">
#{autoid,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null">
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="segment != null">
#{segment,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null">
#{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null">
#{destinationstation,jdbcType=VARCHAR},
</if>
<if test="totalweight != null">
#{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null">
#{totalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null">
#{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null">
#{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="flightno != null">
#{flightno,jdbcType=VARCHAR},
</if>
<if test="productname != null">
#{productname,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null">
#{customsstatus,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null">
#{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null">
#{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null">
#{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null">
#{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null">
#{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null">
#{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null">
#{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null">
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null">
#{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null">
#{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null">
#{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null">
#{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null">
#{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="receiptinformation != null">
#{receiptinformation,jdbcType=VARCHAR},
</if>
<if test="createdate != null">
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightDate != null">
#{flightDate,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="isbatch != null">
#{isbatch,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null">
#{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null">
#{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="reportorder != null">
#{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null">
#{islast,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null">
#{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null">
#{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null">
#{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null">
#{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null">
#{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null">
#{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null">
#{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null">
#{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null">
#{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null">
#{consigneePhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="changeFlightDate" parameterType="hashmap">
UPDATE ORIGINMANIFESTMASTER
set FLIGHT_DATE = "TO_DATE"(#{setDate},'yyyy-mm-dd')
WHERE
... ... @@ -363,20 +386,20 @@
AND FLIGHTNO=#{flightNo}
</update>
<select id="selectByAHBA" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
<select id="selectByAHBA" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
ORIGINMANIFESTMASTER
where
where
FLIGHT_DATE = #{flightDate ,jdbcType=DATE}
AND
AND
FLIGHTNO= #{flightNo,jdbcType=VARCHAR}
AND
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
</select>
<select id="statics" resultType="map">
<select id="statics" resultType="map">
SELECT
FLIGHTNO,
ORIGINATINGSTATION,
... ... @@ -407,4 +430,85 @@ GROUP BY
ORIGINATINGSTATION,
DESTINATIONSTATION
</select>
<select id="search" resultMap="TreeMap">
SELECT
* FROM (
SELECT
autoid,
flightno,
flight_date,
originatingstation,
destinationstation,
waybillnomaster,
manifesttotalpiece AS totalpiece,
manifesttotalweight AS totalweight,
customscode,
createdate,
status AS status,
receiptinformation,
'MT1201' AS messagetype
FROM
originmanifestmaster UNION ALL
SELECT
autoid,
flightno,
flightdate as flight_date,
originatingstation,
destinationstation,
waybillnomaster,
tallytotalpiece AS totalpiece,
tallytotalweight AS totalweight,
customscode,
createdate,
status,
receiptinformation,
talltype AS messagetype
FROM
tallymaster
WHERE
talltype = 'MT5201'
) T
WHERE
totalpiece>=0 and destinationstation='CGO'
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
</if>
<if test="flightNo != null and flightNo != ''">
AND flightno = #{flightNo,jdbcType=VARCHAR}
</if>
<if test="flightDate != null and flightDate != ''">
AND flight_date = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
</if>
ORDER BY
flightno,
waybillnomaster DESC,
messagetype ASC
</select>
<select id="searchSec" parameterType="string" resultMap="BaseResultMap">
select autoid,
waybillnosecondary as waybillnomaster,
manifestpiece as totalpiece,
manifestweight as totalweight,
customscode,
createdate,
status,
receiption as receiptinformation,
'MT1201-1' as messagetype
from originmanifestsecondary
where originmanifestmasterautoid= #{autoid}
UNION ALL
select autoid,
waybillnosecondary as waybillnomaster,
tallypiece as totalpiece,
tallyweight as totalweight,
customscode,
createdate,
status,
receiptinformation,
'MT5201-1' as messagetype
from tallysecondary
where tallymasterid= #{autoid}
</select>
</mapper>
... ...
... ... @@ -51,6 +51,42 @@
CONSIGNEE_CODE, CONSIGNEE_COUNTRYCODE, CONSIGNEE_FAX, CONSIGNEE_PHONE, SHIPPER_AEO,
CONSIGNEE_AEO, UNLOADINGSTATION, ARRIVED_AHEAD
</sql>
<resultMap id="TreeMap" type="com.tianbo.analysis.model.PREPAREMASTER">
<result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
<result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
<result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
<result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" />
<result column="STATUS" property="status" jdbcType="VARCHAR"/>
<result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
<collection property="chidren"
column="AUTOID"
ofType="com.tianbo.analysis.model.PREPAREMASTER"
select="com.tianbo.analysis.dao.PREPAREMASTERMapper.searchSec">
</collection>
</resultMap>
<sql id="TreeCondition">
<where>
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
</if>
<if test="carrier != null and carrier != ''">
AND CARRIER = #{carrier,jdbcType=VARCHAR}
</if>
<if test="flightNo != null and flightNo != ''">
AND flightno = #{flightNo,jdbcType=VARCHAR}
</if>
<if test="flightDate != null and flightDate != ''">
AND flightdate = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
</if>
</where>
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
... ... @@ -538,4 +574,157 @@
where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</update>
<select id="searchTree" resultMap="TreeMap">
select * from(
SELECT
autoid,
concat( carrier, flightno )AS flightno,
flightdate,
originatingstation,
destinationstation,
waybillnomaster,
preparetotalpiece AS totalpiece,
preparetotalweight AS totalweight,
customscode,
createdate,
status AS status,
concat( receiptinformation, arrived_ahead ) AS receiptinformation,
'MT2201' AS messagetype,
customsstatus
FROM
preparemaster
<include refid="TreeCondition" />
UNION ALL
SELECT
autoid,
concat( carrier, flightno ) AS flightno,
flightdate,
originatingstation,
destinationstation,
waybillnomaster,
arrivedtotalpiece AS totalpiece,
arrivedtotalweight AS totalweight,
customscode,
createdate,
status,
receiptinformation,
'MT3201' AS messagetype,
arrived_ahead AS customsstatus
FROM
arrivedmaster
<include refid="TreeCondition" />
UNION ALL
SELECT
id AS autoid,
flightno,
flightdate,
originatingstation,
destinationstation,
waybillno AS waybillnomaster,
stowagepieces AS totalpiece,
stowageweight AS totalweight,
customs AS customscode,
createdate,
status,
receiption AS receiptinformation,
'MT4201' AS messagetype,
'' AS customsstatus
FROM
departuresloading
<where>
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillno= #{waybillnomaster,jdbcType=VARCHAR}
</if>
<if test="carrier != null and carrier != ''">
AND substr(flightno,0,2) = #{carrier,jdbcType=VARCHAR}
</if>
<if test="flightNo != null and flightNo != ''">
AND substr(flightno,3) = #{flightNo,jdbcType=VARCHAR}
</if>
<if test="flightDate != null and flightDate != ''">
AND FLIGHTDATE = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
</if>
</where>
UNION ALL
SELECT
autoid,
flightno,
flightdate,
originatingstation,
destinationstation,
waybillnomaster,
tallytotalpiece AS totalpiece,
tallytotalweight AS totalweight,
customscode,
createdate,
status,
receiptinformation,
talltype AS messagetype,
'' AS customsstatus
FROM
tallymaster
<where>
talltype = 'MT5202'
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
</if>
<if test="carrier != null and carrier != ''">
AND substr(flightno,0,2) = #{carrier,jdbcType=VARCHAR}
</if>
<if test="flightNo != null and flightNo != ''">
AND substr(flightno,3) = #{flightNo,jdbcType=VARCHAR}
</if>
<if test="flightDate != null and flightDate != ''">
AND FLIGHTDATE = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
</if>
</where>
) t
ORDER BY flightno,waybillnomaster DESC,messagetype asc
</select>
<select id="searchSec" parameterType="string" resultMap="BaseResultMap">
select
autoid,
waybillnosecondary as waybillnomaster,
preparepiece as totalpiece,
prepareweight as totalweight,
customscode,
createdate,
status,
receiptinformation,
'MT2201-1' as messagetype,
customsstatus
from preparesecondary
where PREPAREMASTERID= #{autoid}
UNION ALL
select
autoid,
waybillnosecondary as waybillnomaster,
arrivedtotalpiece as totalpiece,
arrivedtotalweight as totalweight,
customscode,
createdate,
status,
receiption as receiptinformation,
'MT3201-1' as messagetype,
'' as customsstatus
from arrivedsecondary
where ARRIVEDMASTERID= #{autoid}
UNION ALL
select
autoid,
waybillnosecondary as waybillnomaster,
tallypiece as totalpiece,
tallyweight as totalweight,
customscode,
createdate,
status,
receiptinformation,
'MT5202-1' as messagetype,
'' as customsstatus
from tallysecondary
where tallymasterID= #{autoid}
</select>
</mapper>
... ...
<?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" >
<mapper namespace="com.tianbo.analysis.dao.SENDPLANMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.SENDPLAN" >
<id column="CARRIER" property="carrier" jdbcType="VARCHAR" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from CGONMS.SENDPLAN
where CARRIER = #{carrier,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.tianbo.analysis.model.SENDPLAN" >
insert into CGONMS.SENDPLAN (CARRIER)
values (#{carrier,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.SENDPLAN" >
insert into CGONMS.SENDPLAN
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="carrier != null" >
CARRIER,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="carrier != null" >
#{carrier,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...