作者 朱兆平

运单查询

  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.tianbo.analysis.dao.COMPANYUSERMapper;
  5 +import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
  6 +import com.tianbo.analysis.model.*;
  7 +import com.tianbo.analysis.service.OriginService;
  8 +import com.tianbo.analysis.service.PREPARMASTERService;
  9 +import com.tianbo.util.Date.DateUtil;
  10 +import io.swagger.annotations.ApiOperation;
  11 +import lombok.extern.slf4j.Slf4j;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.beans.factory.annotation.Value;
  14 +import org.springframework.web.bind.annotation.*;
  15 +
  16 +import javax.annotation.Resource;
  17 +import javax.servlet.http.HttpServletRequest;
  18 +import java.util.Arrays;
  19 +import java.util.Date;
  20 +import java.util.List;
  21 +import java.util.UUID;
  22 +
  23 +@Slf4j
  24 +@RestController
  25 +@RequestMapping("/nmms/exp")
  26 +public class NmmsExportController {
  27 +
  28 + @Autowired
  29 + OriginService originService;
  30 +
  31 + @Autowired
  32 + PREPARMASTERService preparmasterService;
  33 +
  34 + @GetMapping("search")
  35 + public ResultJson<PageInfo> searh(@RequestParam(value = "awba",required = false) String awba,
  36 + @RequestParam(value = "flightDate",required = false) String flightDate,
  37 + @RequestParam(value = "flightNo",required = false) String flightNo,
  38 + @RequestParam(value = "dom",required = false) String dom,
  39 + @RequestParam(value = "pageNum",defaultValue = "1") int pageNum,
  40 + @RequestParam(value = "pageSize",defaultValue = "10") int pageSize
  41 + ){
  42 + if ("imp".equals(dom)){
  43 + PageInfo<ORIGINMANIFESTMASTER> result = originService.search(awba,flightDate,flightNo,pageNum,pageSize);
  44 + return new ResultJson<>("200", "success", result);
  45 + }else{
  46 + PageInfo<PREPAREMASTER> result = preparmasterService.search_exp(awba,flightDate,flightNo,pageNum,pageSize);
  47 + return new ResultJson<>("200", "success", result);
  48 + }
  49 +
  50 + }
  51 +
  52 +
  53 +
  54 +}
@@ -50,4 +50,6 @@ public class PREPAREMASTERController { @@ -50,4 +50,6 @@ public class PREPAREMASTERController {
50 PageInfo<PREPAREMASTER> pageInfo= preparmasterService.search(preparemaster,page,limit); 50 PageInfo<PREPAREMASTER> pageInfo= preparmasterService.search(preparemaster,page,limit);
51 return new ResultJson("200","OK",pageInfo); 51 return new ResultJson("200","OK",pageInfo);
52 } 52 }
  53 +
  54 +
53 } 55 }
@@ -17,4 +17,11 @@ public interface ORIGINMANIFESTMASTERMapper { @@ -17,4 +17,11 @@ public interface ORIGINMANIFESTMASTERMapper {
17 ORIGINMANIFESTMASTER selectByAHBA(ORIGINMANIFESTMASTER record); 17 ORIGINMANIFESTMASTER selectByAHBA(ORIGINMANIFESTMASTER record);
18 18
19 List<Map> statics(@Param("startDate") String var1, @Param("endDate")String var2); 19 List<Map> statics(@Param("startDate") String var1, @Param("endDate")String var2);
  20 +
  21 + List<ORIGINMANIFESTMASTER> search(@Param("waybillnomaster") String var1,
  22 + @Param("flightNo")String var2,
  23 + @Param("flightDate")String var3
  24 + );
  25 +
  26 + List<ORIGINMANIFESTMASTER> searchSec(String autoid);
20 } 27 }
1 package com.tianbo.analysis.dao; 1 package com.tianbo.analysis.dao;
2 2
3 import com.tianbo.analysis.model.PREPAREMASTER; 3 import com.tianbo.analysis.model.PREPAREMASTER;
  4 +import org.apache.ibatis.annotations.Param;
4 5
5 import java.util.List; 6 import java.util.List;
6 7
@@ -27,4 +28,12 @@ public interface PREPAREMASTERMapper { @@ -27,4 +28,12 @@ public interface PREPAREMASTERMapper {
27 int updateByPrimaryKey(PREPAREMASTER record); 28 int updateByPrimaryKey(PREPAREMASTER record);
28 29
29 int updatePreArrivedBill(PREPAREMASTER record); 30 int updatePreArrivedBill(PREPAREMASTER record);
  31 +
  32 + List<PREPAREMASTER> searchTree(@Param("waybillnomaster") String var1,
  33 + @Param("flightNo")String var2,
  34 + @Param("flightDate")String var3,
  35 + @Param("carrier")String var4
  36 + );
  37 +
  38 + List<PREPAREMASTER> searchSec(String autoid);
30 } 39 }
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.SENDPLAN;
  4 +
  5 +public interface SENDPLANMapper {
  6 + int deleteByPrimaryKey(String carrier);
  7 +
  8 + int insert(SENDPLAN record);
  9 +
  10 + int insertSelective(SENDPLAN record);
  11 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +public class ManifestBase {
  6 + public String messagetype;
  7 +}
1 package com.tianbo.analysis.model; 1 package com.tianbo.analysis.model;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
4 5
5 -public class ORIGINMANIFESTMASTER { 6 +public class ORIGINMANIFESTMASTER extends ManifestBase{
6 private String autoid; 7 private String autoid;
7 8
8 private String waybillnomaster; 9 private String waybillnomaster;
@@ -91,6 +92,8 @@ public class ORIGINMANIFESTMASTER { @@ -91,6 +92,8 @@ public class ORIGINMANIFESTMASTER {
91 92
92 private String consigneePhone; 93 private String consigneePhone;
93 94
  95 + public List<ORIGINMANIFESTMASTER> chidren;
  96 +
94 public String getAutoid() { 97 public String getAutoid() {
95 return autoid; 98 return autoid;
96 } 99 }
1 package com.tianbo.analysis.model; 1 package com.tianbo.analysis.model;
2 2
3 import java.util.Date; 3 import java.util.Date;
  4 +import java.util.List;
4 5
5 public class PREPAREMASTER { 6 public class PREPAREMASTER {
6 private String autoid; 7 private String autoid;
@@ -9,6 +10,8 @@ public class PREPAREMASTER { @@ -9,6 +10,8 @@ public class PREPAREMASTER {
9 10
10 private Date flightdate; 11 private Date flightdate;
11 12
  13 + private Date flightDate;
  14 +
12 private String originatingstation; 15 private String originatingstation;
13 16
14 private String destinationstation; 17 private String destinationstation;
@@ -81,6 +84,10 @@ public class PREPAREMASTER { @@ -81,6 +84,10 @@ public class PREPAREMASTER {
81 84
82 private String arrivedAhead; 85 private String arrivedAhead;
83 86
  87 + public String messagetype;
  88 +
  89 + public List<PREPAREMASTER> chidren;
  90 +
84 public String getAutoid() { 91 public String getAutoid() {
85 return autoid; 92 return autoid;
86 } 93 }
@@ -392,4 +399,13 @@ public class PREPAREMASTER { @@ -392,4 +399,13 @@ public class PREPAREMASTER {
392 public void setArrivedAhead(String arrivedAhead) { 399 public void setArrivedAhead(String arrivedAhead) {
393 this.arrivedAhead = arrivedAhead == null ? null : arrivedAhead.trim(); 400 this.arrivedAhead = arrivedAhead == null ? null : arrivedAhead.trim();
394 } 401 }
  402 +
  403 + public Date getFlightDate() {
  404 + return flightdate;
  405 + }
  406 +
  407 + public void setFlightDate(Date flightDate) {
  408 + this.flightDate = flightDate;
  409 + this.flightdate = flightDate;
  410 + }
395 } 411 }
  1 +package com.tianbo.analysis.model;
  2 +
  3 +public class SENDPLAN {
  4 + private String carrier;
  5 +
  6 + public String getCarrier() {
  7 + return carrier;
  8 + }
  9 +
  10 + public void setCarrier(String carrier) {
  11 + this.carrier = carrier == null ? null : carrier.trim();
  12 + }
  13 +}
1 package com.tianbo.analysis.service; 1 package com.tianbo.analysis.service;
2 2
  3 +import com.github.pagehelper.PageInfo;
3 import com.tianbo.analysis.model.Originmanifestsecondary; 4 import com.tianbo.analysis.model.Originmanifestsecondary;
  5 +import org.springframework.web.bind.annotation.RequestParam;
4 6
5 public interface OriginService { 7 public interface OriginService {
6 8
@@ -10,4 +12,11 @@ public interface OriginService { @@ -10,4 +12,11 @@ public interface OriginService {
10 * @return 12 * @return
11 */ 13 */
12 int deleteAwbh(String awbhAutoId); 14 int deleteAwbh(String awbhAutoId);
  15 +
  16 + PageInfo search( String awba,
  17 + String flightDate,
  18 + String flightNo,
  19 + int page,
  20 + int limit);
  21 +
13 } 22 }
@@ -5,4 +5,19 @@ import com.tianbo.analysis.model.PREPAREMASTER; @@ -5,4 +5,19 @@ import com.tianbo.analysis.model.PREPAREMASTER;
5 5
6 public interface PREPARMASTERService { 6 public interface PREPARMASTERService {
7 PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize); 7 PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize);
  8 +
  9 + /**
  10 + * 出港查询
  11 + * @param awba
  12 + * @param flightDate
  13 + * @param flightNo
  14 + * @param page
  15 + * @param limit
  16 + * @return
  17 + */
  18 + PageInfo<PREPAREMASTER> search_exp( String awba,
  19 + String flightDate,
  20 + String flightNo,
  21 + int page,
  22 + int limit);
8 } 23 }
1 package com.tianbo.analysis.service.imp; 1 package com.tianbo.analysis.service.imp;
2 2
  3 +import com.github.pagehelper.Page;
  4 +import com.github.pagehelper.PageHelper;
  5 +import com.github.pagehelper.PageInfo;
3 import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper; 6 import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
4 import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper; 7 import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
  8 +import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
  9 +import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
5 import com.tianbo.analysis.service.OriginService; 10 import com.tianbo.analysis.service.OriginService;
6 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
8 13
9 import javax.annotation.Resource; 14 import javax.annotation.Resource;
  15 +import java.util.List;
10 16
11 @Service 17 @Service
12 public class OriginServiceImp implements OriginService { 18 public class OriginServiceImp implements OriginService {
@@ -22,4 +28,13 @@ public class OriginServiceImp implements OriginService { @@ -22,4 +28,13 @@ public class OriginServiceImp implements OriginService {
22 public int deleteAwbh(String awbhAutoId){ 28 public int deleteAwbh(String awbhAutoId){
23 return originmanifestsecondaryMapper.deleteAwbh(awbhAutoId); 29 return originmanifestsecondaryMapper.deleteAwbh(awbhAutoId);
24 } 30 }
  31 +
  32 + @Override
  33 + public PageInfo<ORIGINMANIFESTMASTER> search(String awba, String flightDate, String flightNo, int pageNum, int pageSize) {
  34 + Page<ORIGINMANIFESTMASTER> page = PageHelper.startPage(pageNum,pageSize);
  35 + List<ORIGINMANIFESTMASTER> list = originmanifestmasterMapper.search(awba,flightNo,flightDate);
  36 + PageInfo<ORIGINMANIFESTMASTER> result = new PageInfo<ORIGINMANIFESTMASTER>(list);
  37 + return result;
  38 + }
  39 +
25 } 40 }
@@ -8,6 +8,7 @@ import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE; @@ -8,6 +8,7 @@ import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
8 import com.tianbo.analysis.model.PREPAREMASTER; 8 import com.tianbo.analysis.model.PREPAREMASTER;
9 import com.tianbo.analysis.service.PREPARMASTERService; 9 import com.tianbo.analysis.service.PREPARMASTERService;
10 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
  11 +import org.springframework.util.StringUtils;
11 12
12 import javax.annotation.Resource; 13 import javax.annotation.Resource;
13 import java.util.List; 14 import java.util.List;
@@ -25,4 +26,14 @@ public class PREPARMASTERServiceImpl implements PREPARMASTERService { @@ -25,4 +26,14 @@ public class PREPARMASTERServiceImpl implements PREPARMASTERService {
25 PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list); 26 PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
26 return result; 27 return result;
27 } 28 }
  29 +
  30 + @Override
  31 + public PageInfo search_exp(String awba, String flightDate, String flightNo, int pageNum, int pageSize) {
  32 + Page<PREPAREMASTER> page = PageHelper.startPage(pageNum,pageSize);
  33 + String carrier = StringUtils.isEmpty(flightNo) ? "" : flightNo.substring(0,2);
  34 + String flight = StringUtils.isEmpty(flightNo) ? "" : flightNo.substring(2);
  35 + List<PREPAREMASTER> list = preparemasterMapper.searchTree(awba,flight,flightDate,carrier);
  36 + PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
  37 + return result;
  38 + }
28 } 39 }
@@ -47,6 +47,6 @@ @@ -47,6 +47,6 @@
47 <property name="enableSubPackages" value="false"/> 47 <property name="enableSubPackages" value="false"/>
48 </javaClientGenerator> 48 </javaClientGenerator>
49 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 49 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
50 - <table schema="CGONMS" tableName="FFM_INFO" domainObjectName="FFM_INFO" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 50 + <table schema="CGONMS" tableName="SENDPLAN" domainObjectName="SENDPLAN" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
51 </context> 51 </context>
52 </generatorConfiguration> 52 </generatorConfiguration>
1 <?xml version="1.0" encoding="UTF-8" ?> 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 -<mapper namespace="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper" >  
4 - <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >  
5 - <result column="AUTOID" property="autoid" jdbcType="VARCHAR" />  
6 - <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />  
7 - <result column="SEGMENT" property="segment" jdbcType="VARCHAR" />  
8 - <result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />  
9 - <result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR" />  
10 - <result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />  
11 - <result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />  
12 - <result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR" />  
13 - <result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR" />  
14 - <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />  
15 - <result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />  
16 - <result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR" />  
17 - <result column="CARRIER1" property="carrier1" jdbcType="VARCHAR" />  
18 - <result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR" />  
19 - <result column="CARRIER2" property="carrier2" jdbcType="VARCHAR" />  
20 - <result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR" />  
21 - <result column="CARRIER3" property="carrier3" jdbcType="VARCHAR" />  
22 - <result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR" />  
23 - <result column="PAYMODE" property="paymode" jdbcType="VARCHAR" />  
24 - <result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />  
25 - <result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" />  
26 - <result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR" />  
27 - <result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR" />  
28 - <result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR" />  
29 - <result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR" />  
30 - <result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR" />  
31 - <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />  
32 - <result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE" />  
33 - <result column="STATUS" property="status" jdbcType="VARCHAR" />  
34 - <result column="ISBATCH" property="isbatch" jdbcType="VARCHAR" />  
35 - <result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR" />  
36 - <result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />  
37 - <result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR" />  
38 - <result column="ISLAST" property="islast" jdbcType="VARCHAR" />  
39 - <result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR" />  
40 - <result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR" />  
41 - <result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR" />  
42 - <result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR" />  
43 - <result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR" />  
44 - <result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR" />  
45 - <result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR" />  
46 - <result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR" />  
47 - <result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR" />  
48 - <result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR" /> 3 +<mapper namespace="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper">
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
  5 + <result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
  6 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
  7 + <result column="SEGMENT" property="segment" jdbcType="VARCHAR"/>
  8 + <result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR"/>
  9 + <result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR"/>
  10 + <result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR"/>
  11 + <result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR"/>
  12 + <result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR"/>
  13 + <result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR"/>
  14 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
  15 + <result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
  16 + <result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
  17 + <result column="CARRIER1" property="carrier1" jdbcType="VARCHAR"/>
  18 + <result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR"/>
  19 + <result column="CARRIER2" property="carrier2" jdbcType="VARCHAR"/>
  20 + <result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR"/>
  21 + <result column="CARRIER3" property="carrier3" jdbcType="VARCHAR"/>
  22 + <result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR"/>
  23 + <result column="PAYMODE" property="paymode" jdbcType="VARCHAR"/>
  24 + <result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR"/>
  25 + <result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
  26 + <result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR"/>
  27 + <result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR"/>
  28 + <result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR"/>
  29 + <result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR"/>
  30 + <result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
  31 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
  32 + <result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE"/>
  33 + <result column="STATUS" property="status" jdbcType="VARCHAR"/>
  34 + <result column="ISBATCH" property="isbatch" jdbcType="VARCHAR"/>
  35 + <result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR"/>
  36 + <result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR"/>
  37 + <result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR"/>
  38 + <result column="ISLAST" property="islast" jdbcType="VARCHAR"/>
  39 + <result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR"/>
  40 + <result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR"/>
  41 + <result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR"/>
  42 + <result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR"/>
  43 + <result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR"/>
  44 + <result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR"/>
  45 + <result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR"/>
  46 + <result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR"/>
  47 + <result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR"/>
  48 + <result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR"/>
  49 + <result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
49 </resultMap> 50 </resultMap>
50 <sql id="Base_Column_List"> 51 <sql id="Base_Column_List">
51 AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE 52 AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE
52 </sql> 53 </sql>
53 - <insert id="insert" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" > 54 + <resultMap id="TreeMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
  55 + <result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
  56 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
  57 + <result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR"/>
  58 + <result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR"/>
  59 + <result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR"/>
  60 + <result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR"/>
  61 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
  62 + <result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
  63 + <result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
  64 + <result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
  65 + <result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
  66 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
  67 + <result column="FLIGHT_DATE" property="flightDate" jdbcType="DATE"/>
  68 + <result column="STATUS" property="status" jdbcType="VARCHAR"/>
  69 + <result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
  70 + <collection property="chidren"
  71 + column="AUTOID"
  72 + ofType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER"
  73 + select="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper.searchSec">
  74 + </collection>
  75 + </resultMap>
  76 + <insert id="insert" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
54 insert into ORIGINMANIFESTMASTER (AUTOID, WAYBILLNOMASTER, SEGMENT, 77 insert into ORIGINMANIFESTMASTER (AUTOID, WAYBILLNOMASTER, SEGMENT,
55 ORIGINATINGSTATION, DESTINATIONSTATION, 78 ORIGINATINGSTATION, DESTINATIONSTATION,
56 TOTALWEIGHT, TOTALPIECE, MANIFESTTOTALPIECE, 79 TOTALWEIGHT, TOTALPIECE, MANIFESTTOTALPIECE,
@@ -84,273 +107,273 @@ @@ -84,273 +107,273 @@
84 #{specificConsigneename,jdbcType=VARCHAR}, #{specificConsigneePhone,jdbcType=VARCHAR}, 107 #{specificConsigneename,jdbcType=VARCHAR}, #{specificConsigneePhone,jdbcType=VARCHAR},
85 #{consigneePhone,jdbcType=VARCHAR}) 108 #{consigneePhone,jdbcType=VARCHAR})
86 </insert> 109 </insert>
87 - <insert id="insertSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" > 110 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
88 insert into ORIGINMANIFESTMASTER 111 insert into ORIGINMANIFESTMASTER
89 - <trim prefix="(" suffix=")" suffixOverrides="," >  
90 - <if test="autoid != null" > 112 + <trim prefix="(" suffix=")" suffixOverrides=",">
  113 + <if test="autoid != null">
91 AUTOID, 114 AUTOID,
92 </if> 115 </if>
93 - <if test="waybillnomaster != null" > 116 + <if test="waybillnomaster != null">
94 WAYBILLNOMASTER, 117 WAYBILLNOMASTER,
95 </if> 118 </if>
96 - <if test="segment != null" > 119 + <if test="segment != null">
97 SEGMENT, 120 SEGMENT,
98 </if> 121 </if>
99 - <if test="originatingstation != null" > 122 + <if test="originatingstation != null">
100 ORIGINATINGSTATION, 123 ORIGINATINGSTATION,
101 </if> 124 </if>
102 - <if test="destinationstation != null" > 125 + <if test="destinationstation != null">
103 DESTINATIONSTATION, 126 DESTINATIONSTATION,
104 </if> 127 </if>
105 - <if test="totalweight != null" > 128 + <if test="totalweight != null">
106 TOTALWEIGHT, 129 TOTALWEIGHT,
107 </if> 130 </if>
108 - <if test="totalpiece != null" > 131 + <if test="totalpiece != null">
109 TOTALPIECE, 132 TOTALPIECE,
110 </if> 133 </if>
111 - <if test="manifesttotalpiece != null" > 134 + <if test="manifesttotalpiece != null">
112 MANIFESTTOTALPIECE, 135 MANIFESTTOTALPIECE,
113 </if> 136 </if>
114 - <if test="manifesttotalweight != null" > 137 + <if test="manifesttotalweight != null">
115 MANIFESTTOTALWEIGHT, 138 MANIFESTTOTALWEIGHT,
116 </if> 139 </if>
117 - <if test="flightno != null" > 140 + <if test="flightno != null">
118 FLIGHTNO, 141 FLIGHTNO,
119 </if> 142 </if>
120 - <if test="productname != null" > 143 + <if test="productname != null">
121 PRODUCTNAME, 144 PRODUCTNAME,
122 </if> 145 </if>
123 - <if test="customsstatus != null" > 146 + <if test="customsstatus != null">
124 CUSTOMSSTATUS, 147 CUSTOMSSTATUS,
125 </if> 148 </if>
126 - <if test="carrier1 != null" > 149 + <if test="carrier1 != null">
127 CARRIER1, 150 CARRIER1,
128 </if> 151 </if>
129 - <if test="arrivalstation1 != null" > 152 + <if test="arrivalstation1 != null">
130 ARRIVALSTATION1, 153 ARRIVALSTATION1,
131 </if> 154 </if>
132 - <if test="carrier2 != null" > 155 + <if test="carrier2 != null">
133 CARRIER2, 156 CARRIER2,
134 </if> 157 </if>
135 - <if test="arrivalstation2 != null" > 158 + <if test="arrivalstation2 != null">
136 ARRIVALSTATION2, 159 ARRIVALSTATION2,
137 </if> 160 </if>
138 - <if test="carrier3 != null" > 161 + <if test="carrier3 != null">
139 CARRIER3, 162 CARRIER3,
140 </if> 163 </if>
141 - <if test="arrivalstation3 != null" > 164 + <if test="arrivalstation3 != null">
142 ARRIVALSTATION3, 165 ARRIVALSTATION3,
143 </if> 166 </if>
144 - <if test="paymode != null" > 167 + <if test="paymode != null">
145 PAYMODE, 168 PAYMODE,
146 </if> 169 </if>
147 - <if test="specialgoodscode != null" > 170 + <if test="specialgoodscode != null">
148 SPECIALGOODSCODE, 171 SPECIALGOODSCODE,
149 </if> 172 </if>
150 - <if test="customscode != null" > 173 + <if test="customscode != null">
151 CUSTOMSCODE, 174 CUSTOMSCODE,
152 </if> 175 </if>
153 - <if test="shippername != null" > 176 + <if test="shippername != null">
154 SHIPPERNAME, 177 SHIPPERNAME,
155 </if> 178 </if>
156 - <if test="shipperaddress != null" > 179 + <if test="shipperaddress != null">
157 SHIPPERADDRESS, 180 SHIPPERADDRESS,
158 </if> 181 </if>
159 - <if test="consigneename != null" > 182 + <if test="consigneename != null">
160 CONSIGNEENAME, 183 CONSIGNEENAME,
161 </if> 184 </if>
162 - <if test="consigneeaddress != null" > 185 + <if test="consigneeaddress != null">
163 CONSIGNEEADDRESS, 186 CONSIGNEEADDRESS,
164 </if> 187 </if>
165 - <if test="receiptinformation != null" > 188 + <if test="receiptinformation != null">
166 RECEIPTINFORMATION, 189 RECEIPTINFORMATION,
167 </if> 190 </if>
168 - <if test="createdate != null" > 191 + <if test="createdate != null">
169 CREATEDATE, 192 CREATEDATE,
170 </if> 193 </if>
171 - <if test="flightDate != null" > 194 + <if test="flightDate != null">
172 FLIGHT_DATE, 195 FLIGHT_DATE,
173 </if> 196 </if>
174 - <if test="status != null" > 197 + <if test="status != null">
175 STATUS, 198 STATUS,
176 </if> 199 </if>
177 - <if test="isbatch != null" > 200 + <if test="isbatch != null">
178 ISBATCH, 201 ISBATCH,
179 </if> 202 </if>
180 - <if test="originatingstationBill != null" > 203 + <if test="originatingstationBill != null">
181 ORIGINATINGSTATION_BILL, 204 ORIGINATINGSTATION_BILL,
182 </if> 205 </if>
183 - <if test="destinationstationBill != null" > 206 + <if test="destinationstationBill != null">
184 DESTINATIONSTATION_BILL, 207 DESTINATIONSTATION_BILL,
185 </if> 208 </if>
186 - <if test="reportorder != null" > 209 + <if test="reportorder != null">
187 REPORTORDER, 210 REPORTORDER,
188 </if> 211 </if>
189 - <if test="islast != null" > 212 + <if test="islast != null">
190 ISLAST, 213 ISLAST,
191 </if> 214 </if>
192 - <if test="shipperCode != null" > 215 + <if test="shipperCode != null">
193 SHIPPER_CODE, 216 SHIPPER_CODE,
194 </if> 217 </if>
195 - <if test="shipperCountrycode != null" > 218 + <if test="shipperCountrycode != null">
196 SHIPPER_COUNTRYCODE, 219 SHIPPER_COUNTRYCODE,
197 </if> 220 </if>
198 - <if test="shipperPhone != null" > 221 + <if test="shipperPhone != null">
199 SHIPPER_PHONE, 222 SHIPPER_PHONE,
200 </if> 223 </if>
201 - <if test="shipperFax != null" > 224 + <if test="shipperFax != null">
202 SHIPPER_FAX, 225 SHIPPER_FAX,
203 </if> 226 </if>
204 - <if test="consigneeCode != null" > 227 + <if test="consigneeCode != null">
205 CONSIGNEE_CODE, 228 CONSIGNEE_CODE,
206 </if> 229 </if>
207 - <if test="consigneeCountrycode != null" > 230 + <if test="consigneeCountrycode != null">
208 CONSIGNEE_COUNTRYCODE, 231 CONSIGNEE_COUNTRYCODE,
209 </if> 232 </if>
210 - <if test="consigneeFax != null" > 233 + <if test="consigneeFax != null">
211 CONSIGNEE_FAX, 234 CONSIGNEE_FAX,
212 </if> 235 </if>
213 - <if test="specificConsigneename != null" > 236 + <if test="specificConsigneename != null">
214 SPECIFIC_CONSIGNEENAME, 237 SPECIFIC_CONSIGNEENAME,
215 </if> 238 </if>
216 - <if test="specificConsigneePhone != null" > 239 + <if test="specificConsigneePhone != null">
217 SPECIFIC_CONSIGNEE_PHONE, 240 SPECIFIC_CONSIGNEE_PHONE,
218 </if> 241 </if>
219 - <if test="consigneePhone != null" > 242 + <if test="consigneePhone != null">
220 CONSIGNEE_PHONE, 243 CONSIGNEE_PHONE,
221 </if> 244 </if>
222 </trim> 245 </trim>
223 - <trim prefix="values (" suffix=")" suffixOverrides="," >  
224 - <if test="autoid != null" > 246 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  247 + <if test="autoid != null">
225 #{autoid,jdbcType=VARCHAR}, 248 #{autoid,jdbcType=VARCHAR},
226 </if> 249 </if>
227 - <if test="waybillnomaster != null" > 250 + <if test="waybillnomaster != null">
228 #{waybillnomaster,jdbcType=VARCHAR}, 251 #{waybillnomaster,jdbcType=VARCHAR},
229 </if> 252 </if>
230 - <if test="segment != null" > 253 + <if test="segment != null">
231 #{segment,jdbcType=VARCHAR}, 254 #{segment,jdbcType=VARCHAR},
232 </if> 255 </if>
233 - <if test="originatingstation != null" > 256 + <if test="originatingstation != null">
234 #{originatingstation,jdbcType=VARCHAR}, 257 #{originatingstation,jdbcType=VARCHAR},
235 </if> 258 </if>
236 - <if test="destinationstation != null" > 259 + <if test="destinationstation != null">
237 #{destinationstation,jdbcType=VARCHAR}, 260 #{destinationstation,jdbcType=VARCHAR},
238 </if> 261 </if>
239 - <if test="totalweight != null" > 262 + <if test="totalweight != null">
240 #{totalweight,jdbcType=VARCHAR}, 263 #{totalweight,jdbcType=VARCHAR},
241 </if> 264 </if>
242 - <if test="totalpiece != null" > 265 + <if test="totalpiece != null">
243 #{totalpiece,jdbcType=VARCHAR}, 266 #{totalpiece,jdbcType=VARCHAR},
244 </if> 267 </if>
245 - <if test="manifesttotalpiece != null" > 268 + <if test="manifesttotalpiece != null">
246 #{manifesttotalpiece,jdbcType=VARCHAR}, 269 #{manifesttotalpiece,jdbcType=VARCHAR},
247 </if> 270 </if>
248 - <if test="manifesttotalweight != null" > 271 + <if test="manifesttotalweight != null">
249 #{manifesttotalweight,jdbcType=VARCHAR}, 272 #{manifesttotalweight,jdbcType=VARCHAR},
250 </if> 273 </if>
251 - <if test="flightno != null" > 274 + <if test="flightno != null">
252 #{flightno,jdbcType=VARCHAR}, 275 #{flightno,jdbcType=VARCHAR},
253 </if> 276 </if>
254 - <if test="productname != null" > 277 + <if test="productname != null">
255 #{productname,jdbcType=VARCHAR}, 278 #{productname,jdbcType=VARCHAR},
256 </if> 279 </if>
257 - <if test="customsstatus != null" > 280 + <if test="customsstatus != null">
258 #{customsstatus,jdbcType=VARCHAR}, 281 #{customsstatus,jdbcType=VARCHAR},
259 </if> 282 </if>
260 - <if test="carrier1 != null" > 283 + <if test="carrier1 != null">
261 #{carrier1,jdbcType=VARCHAR}, 284 #{carrier1,jdbcType=VARCHAR},
262 </if> 285 </if>
263 - <if test="arrivalstation1 != null" > 286 + <if test="arrivalstation1 != null">
264 #{arrivalstation1,jdbcType=VARCHAR}, 287 #{arrivalstation1,jdbcType=VARCHAR},
265 </if> 288 </if>
266 - <if test="carrier2 != null" > 289 + <if test="carrier2 != null">
267 #{carrier2,jdbcType=VARCHAR}, 290 #{carrier2,jdbcType=VARCHAR},
268 </if> 291 </if>
269 - <if test="arrivalstation2 != null" > 292 + <if test="arrivalstation2 != null">
270 #{arrivalstation2,jdbcType=VARCHAR}, 293 #{arrivalstation2,jdbcType=VARCHAR},
271 </if> 294 </if>
272 - <if test="carrier3 != null" > 295 + <if test="carrier3 != null">
273 #{carrier3,jdbcType=VARCHAR}, 296 #{carrier3,jdbcType=VARCHAR},
274 </if> 297 </if>
275 - <if test="arrivalstation3 != null" > 298 + <if test="arrivalstation3 != null">
276 #{arrivalstation3,jdbcType=VARCHAR}, 299 #{arrivalstation3,jdbcType=VARCHAR},
277 </if> 300 </if>
278 - <if test="paymode != null" > 301 + <if test="paymode != null">
279 #{paymode,jdbcType=VARCHAR}, 302 #{paymode,jdbcType=VARCHAR},
280 </if> 303 </if>
281 - <if test="specialgoodscode != null" > 304 + <if test="specialgoodscode != null">
282 #{specialgoodscode,jdbcType=VARCHAR}, 305 #{specialgoodscode,jdbcType=VARCHAR},
283 </if> 306 </if>
284 - <if test="customscode != null" > 307 + <if test="customscode != null">
285 #{customscode,jdbcType=VARCHAR}, 308 #{customscode,jdbcType=VARCHAR},
286 </if> 309 </if>
287 - <if test="shippername != null" > 310 + <if test="shippername != null">
288 #{shippername,jdbcType=VARCHAR}, 311 #{shippername,jdbcType=VARCHAR},
289 </if> 312 </if>
290 - <if test="shipperaddress != null" > 313 + <if test="shipperaddress != null">
291 #{shipperaddress,jdbcType=VARCHAR}, 314 #{shipperaddress,jdbcType=VARCHAR},
292 </if> 315 </if>
293 - <if test="consigneename != null" > 316 + <if test="consigneename != null">
294 #{consigneename,jdbcType=VARCHAR}, 317 #{consigneename,jdbcType=VARCHAR},
295 </if> 318 </if>
296 - <if test="consigneeaddress != null" > 319 + <if test="consigneeaddress != null">
297 #{consigneeaddress,jdbcType=VARCHAR}, 320 #{consigneeaddress,jdbcType=VARCHAR},
298 </if> 321 </if>
299 - <if test="receiptinformation != null" > 322 + <if test="receiptinformation != null">
300 #{receiptinformation,jdbcType=VARCHAR}, 323 #{receiptinformation,jdbcType=VARCHAR},
301 </if> 324 </if>
302 - <if test="createdate != null" > 325 + <if test="createdate != null">
303 #{createdate,jdbcType=TIMESTAMP}, 326 #{createdate,jdbcType=TIMESTAMP},
304 </if> 327 </if>
305 - <if test="flightDate != null" > 328 + <if test="flightDate != null">
306 #{flightDate,jdbcType=TIMESTAMP}, 329 #{flightDate,jdbcType=TIMESTAMP},
307 </if> 330 </if>
308 - <if test="status != null" > 331 + <if test="status != null">
309 #{status,jdbcType=VARCHAR}, 332 #{status,jdbcType=VARCHAR},
310 </if> 333 </if>
311 - <if test="isbatch != null" > 334 + <if test="isbatch != null">
312 #{isbatch,jdbcType=VARCHAR}, 335 #{isbatch,jdbcType=VARCHAR},
313 </if> 336 </if>
314 - <if test="originatingstationBill != null" > 337 + <if test="originatingstationBill != null">
315 #{originatingstationBill,jdbcType=VARCHAR}, 338 #{originatingstationBill,jdbcType=VARCHAR},
316 </if> 339 </if>
317 - <if test="destinationstationBill != null" > 340 + <if test="destinationstationBill != null">
318 #{destinationstationBill,jdbcType=VARCHAR}, 341 #{destinationstationBill,jdbcType=VARCHAR},
319 </if> 342 </if>
320 - <if test="reportorder != null" > 343 + <if test="reportorder != null">
321 #{reportorder,jdbcType=VARCHAR}, 344 #{reportorder,jdbcType=VARCHAR},
322 </if> 345 </if>
323 - <if test="islast != null" > 346 + <if test="islast != null">
324 #{islast,jdbcType=VARCHAR}, 347 #{islast,jdbcType=VARCHAR},
325 </if> 348 </if>
326 - <if test="shipperCode != null" > 349 + <if test="shipperCode != null">
327 #{shipperCode,jdbcType=VARCHAR}, 350 #{shipperCode,jdbcType=VARCHAR},
328 </if> 351 </if>
329 - <if test="shipperCountrycode != null" > 352 + <if test="shipperCountrycode != null">
330 #{shipperCountrycode,jdbcType=VARCHAR}, 353 #{shipperCountrycode,jdbcType=VARCHAR},
331 </if> 354 </if>
332 - <if test="shipperPhone != null" > 355 + <if test="shipperPhone != null">
333 #{shipperPhone,jdbcType=VARCHAR}, 356 #{shipperPhone,jdbcType=VARCHAR},
334 </if> 357 </if>
335 - <if test="shipperFax != null" > 358 + <if test="shipperFax != null">
336 #{shipperFax,jdbcType=VARCHAR}, 359 #{shipperFax,jdbcType=VARCHAR},
337 </if> 360 </if>
338 - <if test="consigneeCode != null" > 361 + <if test="consigneeCode != null">
339 #{consigneeCode,jdbcType=VARCHAR}, 362 #{consigneeCode,jdbcType=VARCHAR},
340 </if> 363 </if>
341 - <if test="consigneeCountrycode != null" > 364 + <if test="consigneeCountrycode != null">
342 #{consigneeCountrycode,jdbcType=VARCHAR}, 365 #{consigneeCountrycode,jdbcType=VARCHAR},
343 </if> 366 </if>
344 - <if test="consigneeFax != null" > 367 + <if test="consigneeFax != null">
345 #{consigneeFax,jdbcType=VARCHAR}, 368 #{consigneeFax,jdbcType=VARCHAR},
346 </if> 369 </if>
347 - <if test="specificConsigneename != null" > 370 + <if test="specificConsigneename != null">
348 #{specificConsigneename,jdbcType=VARCHAR}, 371 #{specificConsigneename,jdbcType=VARCHAR},
349 </if> 372 </if>
350 - <if test="specificConsigneePhone != null" > 373 + <if test="specificConsigneePhone != null">
351 #{specificConsigneePhone,jdbcType=VARCHAR}, 374 #{specificConsigneePhone,jdbcType=VARCHAR},
352 </if> 375 </if>
353 - <if test="consigneePhone != null" > 376 + <if test="consigneePhone != null">
354 #{consigneePhone,jdbcType=VARCHAR}, 377 #{consigneePhone,jdbcType=VARCHAR},
355 </if> 378 </if>
356 </trim> 379 </trim>
@@ -365,7 +388,7 @@ @@ -365,7 +388,7 @@
365 388
366 <select id="selectByAHBA" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultMap="BaseResultMap"> 389 <select id="selectByAHBA" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultMap="BaseResultMap">
367 select 390 select
368 - <include refid="Base_Column_List" /> 391 + <include refid="Base_Column_List"/>
369 from 392 from
370 ORIGINMANIFESTMASTER 393 ORIGINMANIFESTMASTER
371 where 394 where
@@ -407,4 +430,85 @@ GROUP BY @@ -407,4 +430,85 @@ GROUP BY
407 ORIGINATINGSTATION, 430 ORIGINATINGSTATION,
408 DESTINATIONSTATION 431 DESTINATIONSTATION
409 </select> 432 </select>
  433 + <select id="search" resultMap="TreeMap">
  434 + SELECT
  435 + * FROM (
  436 + SELECT
  437 + autoid,
  438 + flightno,
  439 + flight_date,
  440 + originatingstation,
  441 + destinationstation,
  442 + waybillnomaster,
  443 + manifesttotalpiece AS totalpiece,
  444 + manifesttotalweight AS totalweight,
  445 + customscode,
  446 + createdate,
  447 + status AS status,
  448 + receiptinformation,
  449 + 'MT1201' AS messagetype
  450 + FROM
  451 + originmanifestmaster UNION ALL
  452 + SELECT
  453 + autoid,
  454 + flightno,
  455 + flightdate as flight_date,
  456 + originatingstation,
  457 + destinationstation,
  458 + waybillnomaster,
  459 + tallytotalpiece AS totalpiece,
  460 + tallytotalweight AS totalweight,
  461 + customscode,
  462 + createdate,
  463 + status,
  464 + receiptinformation,
  465 + talltype AS messagetype
  466 + FROM
  467 + tallymaster
  468 + WHERE
  469 + talltype = 'MT5201'
  470 + ) T
  471 + WHERE
  472 + totalpiece>=0 and destinationstation='CGO'
  473 + <if test="waybillnomaster != null and waybillnomaster != ''">
  474 + AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
  475 + </if>
  476 + <if test="flightNo != null and flightNo != ''">
  477 + AND flightno = #{flightNo,jdbcType=VARCHAR}
  478 + </if>
  479 + <if test="flightDate != null and flightDate != ''">
  480 + AND flight_date = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
  481 + </if>
  482 + ORDER BY
  483 + flightno,
  484 + waybillnomaster DESC,
  485 + messagetype ASC
  486 + </select>
  487 +
  488 + <select id="searchSec" parameterType="string" resultMap="BaseResultMap">
  489 + select autoid,
  490 + waybillnosecondary as waybillnomaster,
  491 + manifestpiece as totalpiece,
  492 + manifestweight as totalweight,
  493 + customscode,
  494 + createdate,
  495 + status,
  496 + receiption as receiptinformation,
  497 + 'MT1201-1' as messagetype
  498 + from originmanifestsecondary
  499 + where originmanifestmasterautoid= #{autoid}
  500 + UNION ALL
  501 + select autoid,
  502 + waybillnosecondary as waybillnomaster,
  503 + tallypiece as totalpiece,
  504 + tallyweight as totalweight,
  505 + customscode,
  506 + createdate,
  507 + status,
  508 + receiptinformation,
  509 + 'MT5201-1' as messagetype
  510 + from tallysecondary
  511 + where tallymasterid= #{autoid}
  512 + </select>
  513 +
410 </mapper> 514 </mapper>
@@ -51,6 +51,42 @@ @@ -51,6 +51,42 @@
51 CONSIGNEE_CODE, CONSIGNEE_COUNTRYCODE, CONSIGNEE_FAX, CONSIGNEE_PHONE, SHIPPER_AEO, 51 CONSIGNEE_CODE, CONSIGNEE_COUNTRYCODE, CONSIGNEE_FAX, CONSIGNEE_PHONE, SHIPPER_AEO,
52 CONSIGNEE_AEO, UNLOADINGSTATION, ARRIVED_AHEAD 52 CONSIGNEE_AEO, UNLOADINGSTATION, ARRIVED_AHEAD
53 </sql> 53 </sql>
  54 + <resultMap id="TreeMap" type="com.tianbo.analysis.model.PREPAREMASTER">
  55 + <result column="AUTOID" property="autoid" jdbcType="VARCHAR"/>
  56 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR"/>
  57 + <result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />
  58 + <result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
  59 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR"/>
  60 + <result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR"/>
  61 + <result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR"/>
  62 + <result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR"/>
  63 + <result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR"/>
  64 + <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP"/>
  65 + <result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" />
  66 + <result column="STATUS" property="status" jdbcType="VARCHAR"/>
  67 + <result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
  68 + <collection property="chidren"
  69 + column="AUTOID"
  70 + ofType="com.tianbo.analysis.model.PREPAREMASTER"
  71 + select="com.tianbo.analysis.dao.PREPAREMASTERMapper.searchSec">
  72 + </collection>
  73 + </resultMap>
  74 + <sql id="TreeCondition">
  75 + <where>
  76 + <if test="waybillnomaster != null and waybillnomaster != ''">
  77 + AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
  78 + </if>
  79 + <if test="carrier != null and carrier != ''">
  80 + AND CARRIER = #{carrier,jdbcType=VARCHAR}
  81 + </if>
  82 + <if test="flightNo != null and flightNo != ''">
  83 + AND flightno = #{flightNo,jdbcType=VARCHAR}
  84 + </if>
  85 + <if test="flightDate != null and flightDate != ''">
  86 + AND flightdate = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
  87 + </if>
  88 + </where>
  89 + </sql>
54 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > 90 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
55 select 91 select
56 <include refid="Base_Column_List" /> 92 <include refid="Base_Column_List" />
@@ -538,4 +574,157 @@ @@ -538,4 +574,157 @@
538 where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} 574 where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
539 </update> 575 </update>
540 576
  577 + <select id="searchTree" resultMap="TreeMap">
  578 +select * from(
  579 + SELECT
  580 + autoid,
  581 + concat( carrier, flightno )AS flightno,
  582 + flightdate,
  583 + originatingstation,
  584 + destinationstation,
  585 + waybillnomaster,
  586 + preparetotalpiece AS totalpiece,
  587 + preparetotalweight AS totalweight,
  588 + customscode,
  589 + createdate,
  590 + status AS status,
  591 + concat( receiptinformation, arrived_ahead ) AS receiptinformation,
  592 + 'MT2201' AS messagetype,
  593 + customsstatus
  594 + FROM
  595 + preparemaster
  596 + <include refid="TreeCondition" />
  597 + UNION ALL
  598 + SELECT
  599 + autoid,
  600 + concat( carrier, flightno ) AS flightno,
  601 + flightdate,
  602 + originatingstation,
  603 + destinationstation,
  604 + waybillnomaster,
  605 + arrivedtotalpiece AS totalpiece,
  606 + arrivedtotalweight AS totalweight,
  607 + customscode,
  608 + createdate,
  609 + status,
  610 + receiptinformation,
  611 + 'MT3201' AS messagetype,
  612 + arrived_ahead AS customsstatus
  613 + FROM
  614 + arrivedmaster
  615 + <include refid="TreeCondition" />
  616 + UNION ALL
  617 + SELECT
  618 + id AS autoid,
  619 + flightno,
  620 + flightdate,
  621 + originatingstation,
  622 + destinationstation,
  623 + waybillno AS waybillnomaster,
  624 + stowagepieces AS totalpiece,
  625 + stowageweight AS totalweight,
  626 + customs AS customscode,
  627 + createdate,
  628 + status,
  629 + receiption AS receiptinformation,
  630 + 'MT4201' AS messagetype,
  631 + '' AS customsstatus
  632 + FROM
  633 + departuresloading
  634 + <where>
  635 + <if test="waybillnomaster != null and waybillnomaster != ''">
  636 + AND waybillno= #{waybillnomaster,jdbcType=VARCHAR}
  637 + </if>
  638 + <if test="carrier != null and carrier != ''">
  639 + AND substr(flightno,0,2) = #{carrier,jdbcType=VARCHAR}
  640 + </if>
  641 + <if test="flightNo != null and flightNo != ''">
  642 + AND substr(flightno,3) = #{flightNo,jdbcType=VARCHAR}
  643 + </if>
  644 + <if test="flightDate != null and flightDate != ''">
  645 + AND FLIGHTDATE = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
  646 + </if>
  647 + </where>
  648 + UNION ALL
  649 + SELECT
  650 + autoid,
  651 + flightno,
  652 + flightdate,
  653 + originatingstation,
  654 + destinationstation,
  655 + waybillnomaster,
  656 + tallytotalpiece AS totalpiece,
  657 + tallytotalweight AS totalweight,
  658 + customscode,
  659 + createdate,
  660 + status,
  661 + receiptinformation,
  662 + talltype AS messagetype,
  663 + '' AS customsstatus
  664 + FROM
  665 + tallymaster
  666 + <where>
  667 + talltype = 'MT5202'
  668 + <if test="waybillnomaster != null and waybillnomaster != ''">
  669 + AND waybillnomaster= #{waybillnomaster,jdbcType=VARCHAR}
  670 + </if>
  671 + <if test="carrier != null and carrier != ''">
  672 + AND substr(flightno,0,2) = #{carrier,jdbcType=VARCHAR}
  673 + </if>
  674 + <if test="flightNo != null and flightNo != ''">
  675 + AND substr(flightno,3) = #{flightNo,jdbcType=VARCHAR}
  676 + </if>
  677 + <if test="flightDate != null and flightDate != ''">
  678 + AND FLIGHTDATE = TO_DATE( #{flightDate ,jdbcType=DATE}, 'yyyy-MM-dd' )
  679 + </if>
  680 + </where>
  681 + ) t
  682 + ORDER BY flightno,waybillnomaster DESC,messagetype asc
  683 +
  684 + </select>
  685 +
  686 + <select id="searchSec" parameterType="string" resultMap="BaseResultMap">
  687 + select
  688 + autoid,
  689 + waybillnosecondary as waybillnomaster,
  690 + preparepiece as totalpiece,
  691 + prepareweight as totalweight,
  692 + customscode,
  693 + createdate,
  694 + status,
  695 + receiptinformation,
  696 + 'MT2201-1' as messagetype,
  697 + customsstatus
  698 + from preparesecondary
  699 + where PREPAREMASTERID= #{autoid}
  700 +
  701 + UNION ALL
  702 + select
  703 + autoid,
  704 + waybillnosecondary as waybillnomaster,
  705 + arrivedtotalpiece as totalpiece,
  706 + arrivedtotalweight as totalweight,
  707 + customscode,
  708 + createdate,
  709 + status,
  710 + receiption as receiptinformation,
  711 + 'MT3201-1' as messagetype,
  712 + '' as customsstatus
  713 + from arrivedsecondary
  714 + where ARRIVEDMASTERID= #{autoid}
  715 + UNION ALL
  716 + select
  717 + autoid,
  718 + waybillnosecondary as waybillnomaster,
  719 + tallypiece as totalpiece,
  720 + tallyweight as totalweight,
  721 + customscode,
  722 + createdate,
  723 + status,
  724 + receiptinformation,
  725 + 'MT5202-1' as messagetype,
  726 + '' as customsstatus
  727 + from tallysecondary
  728 + where tallymasterID= #{autoid}
  729 + </select>
541 </mapper> 730 </mapper>
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.tianbo.analysis.dao.SENDPLANMapper" >
  4 + <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.SENDPLAN" >
  5 + <id column="CARRIER" property="carrier" jdbcType="VARCHAR" />
  6 + </resultMap>
  7 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  8 + delete from CGONMS.SENDPLAN
  9 + where CARRIER = #{carrier,jdbcType=VARCHAR}
  10 + </delete>
  11 + <insert id="insert" parameterType="com.tianbo.analysis.model.SENDPLAN" >
  12 + insert into CGONMS.SENDPLAN (CARRIER)
  13 + values (#{carrier,jdbcType=VARCHAR})
  14 + </insert>
  15 + <insert id="insertSelective" parameterType="com.tianbo.analysis.model.SENDPLAN" >
  16 + insert into CGONMS.SENDPLAN
  17 + <trim prefix="(" suffix=")" suffixOverrides="," >
  18 + <if test="carrier != null" >
  19 + CARRIER,
  20 + </if>
  21 + </trim>
  22 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  23 + <if test="carrier != null" >
  24 + #{carrier,jdbcType=VARCHAR},
  25 + </if>
  26 + </trim>
  27 + </insert>
  28 +</mapper>