作者 xudada

邮单excel导入

package com.tianbo.analysis.controller;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.Originmanifestsecondary;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.UpfileOrigService;
import com.tianbo.analysis.service.UpfileSecondaryService;
import com.tianbo.analysis.tools.ExcelUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
@Controller
@RequestMapping("/upfile")
public class UpfileJsonController {
@Autowired
UpfileOrigService upfileService;
@Autowired
UpfileSecondaryService upfileSecondaryService;
@PostMapping("upfile.json")
@Transactional
@ResponseBody
public ResultJson uploadFileExcel(@RequestParam(value = "file") MultipartFile file, HttpServletRequest request){
int msg=0;
Pattern pattern= Pattern.compile("[0-9]*");
SimpleDateFormat format=new SimpleDateFormat( "yyyy-MM-dd");
List<ArrayList<String>> readResult = null;//总行记录
try {
//判断文件是否为空
if (file.isEmpty()) {
return new ResultJson("400","上传文件为空");
}
//判断文件大小
long size = file.getSize();
String name = file.getOriginalFilename();
if (StringUtils.isBlank(name) || size == 0) {
return new ResultJson("400","上传文件为空");
}
String postfix = ExcelUtils.getPostfix(name);
//读取文件内容
if (StringUtils.equals("xlsx", postfix)) {
readResult = ExcelUtils.readXlsx(file);
} else if (StringUtils.equals("xls", postfix)) {
readResult = ExcelUtils.readXls(file);
} else {
return new ResultJson("400","上传文件类型错误");
}
if (readResult == null || readResult.size() == 0) {
return new ResultJson("400","上传文件解析失败"); }
for (ArrayList<String> arr : readResult) {
ORIGINMANIFESTMASTER or=new ORIGINMANIFESTMASTER();
or.setAutoid(UUID.randomUUID().toString());
if(pattern.matcher(arr.get(2)).matches()){
or.setWaybillnomaster(arr.get(2).substring(0,3)+"-"+arr.get(2).substring(3));
}else{
or.setWaybillnomaster(arr.get(2));
}
or.setSegment(arr.get(103)+"-"+arr.get(104));//航段
or.setOriginatingstation(arr.get(103));//起始站
or.setDestinationstation(arr.get(104));//目的站
or.setTotalweight(arr.get(8));//总重量
or.setTotalpiece(arr.get(6));//总件数
or.setManifesttotalpiece(arr.get(6));//舱单件数
or.setManifesttotalweight(arr.get(8));//舱单重量
or.setFlightno(arr.get(64)+arr.get(65));//航班号
if(pattern.matcher(arr.get(10)).matches()){
or.setProductname("CONSOLE");
}else{
if(arr.get(10).length()>150){
or.setProductname(arr.get(10).substring(0,100));
}else{
or.setProductname(arr.get(10));//货物描述
}
}
or.setCarrier1(arr.get(64));//承运人1
or.setOriginatingstationBill(arr.get(103));
or.setDestinationstationBill(arr.get(104));
or.setArrivalstation1(arr.get(104));//到达城市1
or.setPaymode("PP");//付费方式
or.setCustomscode("4604");//海关关区代码
if(arr.get(89)!=null && arr.get(89)!=""){
or.setShippername(arr.get(89));//发货人名称
}else{
or.setShippername("SHIPPER");
}
or.setShipperaddress(arr.get(105));//发货人地址
if(arr.get(50)!=null && arr.get(50)!=""){
or.setConsigneename(arr.get(50));//收货人名称
}else{
or.setConsigneename("CONSIGNEER");//收货人名称
}
or.setConsigneeaddress(arr.get(47));//收货人地址
or.setCreatedate(new Date());//创建日期yyyy-MM-dd HH:mm:ss
or.setFlightDate(format.parse(arr.get(66)));//航班日期yyyy-MM-dd
or.setStatus("17");//操作状态
or.setIsbatch("T");//分批标识
or.setShipperCountrycode(arr.get(86));//发货人国家代码
or.setShipperPhone(arr.get(106));//发货人联系电话
or.setConsigneeCountrycode(arr.get(49));//收货人国家代码
or.setSpecificConsigneename(arr.get(50));//具体收货人名称
or.setSpecificConsigneePhone(arr.get(51));//具体收货人电话
or.setConsigneePhone(arr.get(51));//收货人电话
int result=upfileService.insert(or);
if(result>0){
msg=1;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return msg>0?new ResultJson("200","导入成功"):new ResultJson("500","导入失效");
}
@PostMapping("upfileSecondary.json")
@Transactional
@ResponseBody
public ResultJson uploadSecondary(@RequestParam(value = "file") MultipartFile file, HttpServletRequest request){
Pattern pattern= Pattern.compile("[0-9]*");
String waybill=null;
int msg=0;
SimpleDateFormat format=new SimpleDateFormat( "yyyy-MM-dd");
List<ArrayList<String>> readResult = null;//总行记录
try{
//判断文件是否为空
if (file.isEmpty()) {
return new ResultJson("400","上传文件为空");
}
//判断文件大小
long size = file.getSize();
String name = file.getOriginalFilename();
if (StringUtils.isBlank(name) || size == 0) {
return new ResultJson("400","上传文件为空");
}
String postfix = ExcelUtils.getPostfix(name);
//读取文件内容
if (StringUtils.equals("xlsx", postfix)) {
readResult = ExcelUtils.readXlsx(file);
} else if (StringUtils.equals("xls", postfix)) {
readResult = ExcelUtils.readXls(file);
} else {
return new ResultJson("400","上传文件类型错误");
}
if (readResult == null || readResult.size() == 0) {
return new ResultJson("400","上传文件解析失败"); }
for (ArrayList<String> arr : readResult) {
Originmanifestsecondary or =new Originmanifestsecondary();
String[] strArr = arr.get(2).split("_");
if(pattern.matcher(strArr[0]).matches()){
waybill=strArr[0].substring(0,3)+"-"+strArr[0].substring(3);
}else{
waybill=strArr[0];
}
ORIGINMANIFESTMASTER originmanifestmaster=upfileService.selectwaybill(waybill);
if(originmanifestmaster!=null){
or.setAutoid(UUID.randomUUID().toString());
or.setWaybillnomaster(waybill);
or.setWaybillnosecondary(strArr[1]);
or.setWeight(arr.get(8));
or.setPiece(arr.get(6));
or.setManifestweight(arr.get(8));
or.setManifestpiece(arr.get(6));
if(pattern.matcher(arr.get(10)).matches()){
or.setProductname("CONSOLE");
}else{
if(arr.get(10).length()>150){
or.setProductname(arr.get(10).substring(0,100));
}else{
or.setProductname(arr.get(10));//货物描述
}
}
or.setPaymode("PP");//付费方式
or.setCustomscode("4604");//海关关区代码
if(arr.get(89)!=null && arr.get(89)!=""){
or.setShippername(arr.get(89));//发货人名称
}else{
or.setShippername("SHIPPER");
}
or.setShipperaddress(arr.get(105));//发货人地址
if(arr.get(50)!=null && arr.get(50)!=""){
or.setConsigneename(arr.get(50));//收货人名称
}else{
or.setConsigneename("CONSIGNEER");//收货人名称
}
or.setConsigneeaddress(arr.get(47));//收货人地址
or.setCreatedate(new Date());//创建日期yyyy-MM-dd HH:mm:ss
or.setOriginmanifestmasterautoid(originmanifestmaster.getAutoid());
or.setStatus("17");//操作状态
or.setShipperCountrycode(arr.get(86));//发货人国家代码
or.setShipperPhone(arr.get(106));//发货人联系电话
or.setConsigneeCountrycode(arr.get(49));//收货人国家代码
or.setSpecificConsigneename(arr.get(50));//具体收货人名称
or.setSpecificConsigneePhone(arr.get(51));//具体收货人电话
or.setConsigneePhone(arr.get(51));//收货人电话
or.setOriginatingstationBill(arr.get(103));
or.setDestinationstationBill(arr.get(104));
int result=upfileSecondaryService.insert(or);
if(result>0){
msg=1;
}
}else{
return new ResultJson("200","没有对应主单");
}
}
}catch (Exception e) {
e.printStackTrace();
}
return msg>0?new ResultJson("200","导入成功"):new ResultJson("500","导入失效");
}
@PostMapping("ediOrig")
public ResultJson ediOrig(@RequestBody ORIGINMANIFESTMASTER originmanifestmaster) throws Exception{
int res=upfileService.ediOrig(originmanifestmaster);
return res>0?new ResultJson("200","更新成功"):new ResultJson("201","更新失败");
}
@PostMapping("ediOrigDary")
public ResultJson ediOrigDary(@RequestBody Originmanifestsecondary originmanifestsecondary) throws Exception{
int res=upfileSecondaryService.ediSecondary(originmanifestsecondary);
return res>0?new ResultJson("200","更新成功"):new ResultJson("201","更新失败");
}
}
... ...
... ... @@ -24,4 +24,11 @@ public interface ORIGINMANIFESTMASTERMapper {
);
List<ORIGINMANIFESTMASTER> searchSec(String autoid);
ORIGINMANIFESTMASTER selectwaybill(@Param("waybillnomaster") String waybillnomaster);
int updateByPrimaryKey(String keywords);
int updateByPrimaryKeySelective(ORIGINMANIFESTMASTER record);
}
... ...
... ... @@ -14,4 +14,7 @@ public interface OriginmanifestsecondaryMapper {
List<Originmanifestsecondary> selectAutoIdByawbAawbH(Originmanifestsecondary record);
int deleteAwbh(String awbhAutoId);
int updateByPrimaryKeySelective(Originmanifestsecondary record);
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
public interface UpfileOrigService {
int insert(ORIGINMANIFESTMASTER originmanifestmaster)throws Exception;
ORIGINMANIFESTMASTER selectwaybill(String waybill)throws Exception;
int updateByPrimaryKey(String autoid)throws Exception;
int ediOrig(ORIGINMANIFESTMASTER originmanifestmaster)throws Exception;
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.Originmanifestsecondary;
public interface UpfileSecondaryService {
int insert(Originmanifestsecondary originmanifestsecondary)throws Exception;
int ediSecondary(Originmanifestsecondary originmanifestsecondary)throws Exception;
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.service.UpfileOrigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UpfileOrigImpl implements UpfileOrigService {
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Override
public int insert(ORIGINMANIFESTMASTER originmanifestmaster) throws Exception {
return originmanifestmasterMapper.insertSelective(originmanifestmaster);
}
@Override
public ORIGINMANIFESTMASTER selectwaybill(String waybill) throws Exception {
return originmanifestmasterMapper.selectwaybill(waybill);
}
@Override
public int updateByPrimaryKey(String autoid) throws Exception {
return originmanifestmasterMapper.updateByPrimaryKey(autoid);
}
@Override
public int ediOrig(ORIGINMANIFESTMASTER originmanifestmaster) throws Exception {
return originmanifestmasterMapper.updateByPrimaryKeySelective(originmanifestmaster);
}
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
import com.tianbo.analysis.model.Originmanifestsecondary;
import com.tianbo.analysis.service.UpfileSecondaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UpfileSecondaryImpl implements UpfileSecondaryService {
@Autowired
OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
@Override
public int insert(Originmanifestsecondary originmanifestsecondary) throws Exception {
return originmanifestsecondaryMapper.insertSelective(originmanifestsecondary);
}
@Override
public int ediSecondary(Originmanifestsecondary originmanifestsecondary) throws Exception {
return originmanifestsecondaryMapper.updateByPrimaryKeySelective(originmanifestsecondary);
}
}
... ...
package com.tianbo.analysis.tools;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* shenhailong
* 2020/4/27/14:29
*/
public class ExcelUtils {
/**
* 读取.xlsx 内容
* @param file
* @return
* @throws
*/
public static List<ArrayList<String>> readXlsx (MultipartFile file) {
List<ArrayList<String>> list = new ArrayList<ArrayList<String>>();
InputStream input = null;
XSSFWorkbook wb = null;
try {
input = file.getInputStream();
//创建文档
wb = new XSSFWorkbook(input);
ArrayList<String> rowList = null;
int totoalRows = 0;//总行数
int totalCells = 0;//总列数
//读取sheet(页)
for (int sheetIndex = 0 ; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) {
XSSFSheet xssfSheet = wb.getSheetAt(sheetIndex);
if (xssfSheet == null) {
continue;
}
totoalRows = xssfSheet.getLastRowNum();
//读取row
for (int rowIndex = 2; rowIndex <= totoalRows; rowIndex++) {
XSSFRow xssfRow = xssfSheet.getRow(rowIndex);
if (xssfRow == null) {
continue;
}
rowList = new ArrayList<String>();
totalCells = xssfRow.getLastCellNum();
//读取列
for (int cellIndex = 0; cellIndex < totalCells; cellIndex++) {
XSSFCell xssfCell = xssfRow.getCell(cellIndex);
if (xssfCell == null) {
rowList.add("");
} else {
// xssfCell.setCellType(Cell.CELL_TYPE_STRING);
rowList.add(String.valueOf(xssfCell.getStringCellValue()));
}
}
list.add(rowList);
}
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {
if ( wb != null) {
wb.close();
}
if (input != null) {
input.close();
}
} catch (Exception e) {
}
}
return list;
}
/**
* 读取 .xls内容
* @param file
* @return
* @throws
*/
public static List<ArrayList<String>> readXls (MultipartFile file) {
List<ArrayList<String>> list = new ArrayList<ArrayList<String>>();
//创建输入流
InputStream input = null;
//创建文档
HSSFWorkbook wb = null;
try {
input = file.getInputStream();
//创建文档
wb = new HSSFWorkbook(input);
ArrayList<String> rowList = null;
int totoalRows = 0;//总行数
int totalCells = 0;//总列数
//读取sheet(页)
for (int sheetIndex = 0 ; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) {
HSSFSheet hssfSheet = wb.getSheetAt(sheetIndex);
if (hssfSheet == null) {
continue;
}
totoalRows = hssfSheet.getLastRowNum();
//读取row
for (int rowIndex = 1; rowIndex <= totoalRows; rowIndex++) {
HSSFRow hssfRow = hssfSheet.getRow(rowIndex);
if (hssfRow == null) {
continue;
}
rowList = new ArrayList<String>();
totalCells = hssfRow.getLastCellNum();
//读取列
for (int cellIndex = 0; cellIndex < totalCells; cellIndex++) {
HSSFCell hssfCell = hssfRow.getCell(cellIndex);
if (hssfCell == null) {
rowList.add("");
} else {
// System.out.println(hssfCell.getCellType());
if(0==hssfCell.getCellType()){
if(DateUtil.isCellDateFormatted(hssfCell)){
//用于转化为日期格式
Date d = hssfCell.getDateCellValue();
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
rowList.add(formater.format(d));
}
}
hssfCell.setCellType(Cell.CELL_TYPE_STRING);
rowList.add(String.valueOf(hssfCell.getStringCellValue()));
}
}
list.add(rowList);
}
}
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {
if ( wb != null) {
// wb.close();
}
if (input != null) {
input.close();
}
} catch (Exception e) {
}
}
return list;
}
public static String getPostfix (String path) {
if (StringUtils.isBlank(path) || !path.contains(".")) {
return null;
}
return path.substring(path.lastIndexOf(".") + 1, path.length()).trim();
}
}
... ...
... ... @@ -514,5 +514,158 @@ GROUP BY
from tallysecondary
where tallymasterid= #{autoid}
</select>
<select id="selectwaybill" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from ORIGINMANIFESTMASTER where 1=1
<if test="waybillnomaster!=null">
AND WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</if>
</select>
<update id="updateByPrimaryKey" parameterType="java.lang.String">
update ORIGINMANIFESTMASTER set STATUS='17' where AUTOID=#{autoid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
update CGONMS.ORIGINMANIFESTMASTER
<set >
<if test="waybillnomaster != null" >
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="segment != null" >
SEGMENT = #{segment,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION = #{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION = #{destinationstation,jdbcType=VARCHAR},
</if>
<if test="totalweight != null" >
TOTALWEIGHT = #{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
TOTALPIECE = #{totalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE = #{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT = #{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="flightno != null" >
FLIGHTNO = #{flightno,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
PRODUCTNAME = #{productname,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS = #{customsstatus,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
CARRIER1 = #{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1 = #{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
CARRIER2 = #{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2 = #{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
CARRIER3 = #{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3 = #{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
PAYMODE = #{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE = #{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
CUSTOMSCODE = #{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
SHIPPERNAME = #{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS = #{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
CONSIGNEENAME = #{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS = #{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="receiptinformation != null" >
RECEIPTINFORMATION = #{receiptinformation,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightDate != null" >
FLIGHT_DATE = #{flightDate,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
ISBATCH = #{isbatch,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL = #{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL = #{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
REPORTORDER = #{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
ISLAST = #{islast,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
SHIPPER_CODE = #{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE = #{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE = #{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
SHIPPER_FAX = #{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE = #{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX = #{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME = #{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE = #{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE = #{consigneePhone,jdbcType=VARCHAR},
</if>
<if test="sgCode != null" >
SG_CODE = #{sgCode,jdbcType=VARCHAR},
</if>
<if test="sgConnectName != null" >
SG_CONNECT_NAME = #{sgConnectName,jdbcType=VARCHAR},
</if>
<if test="sgConnctTel != null" >
SG_CONNCT_TEL = #{sgConnctTel,jdbcType=VARCHAR},
</if>
</set>
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
</mapper>
... ...
... ... @@ -286,4 +286,104 @@
WHERE
AUTOID = #{awbhAutoId,jdbcType=VARCHAR}
</delete>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" >
update CGONMS.ORIGINMANIFESTSECONDARY
<set >
<if test="waybillnomaster != null" >
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="waybillnosecondary != null" >
WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="weight != null" >
WEIGHT = #{weight,jdbcType=VARCHAR},
</if>
<if test="piece != null" >
PIECE = #{piece,jdbcType=VARCHAR},
</if>
<if test="manifestpiece != null" >
MANIFESTPIECE = #{manifestpiece,jdbcType=VARCHAR},
</if>
<if test="manifestweight != null" >
MANIFESTWEIGHT = #{manifestweight,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
PRODUCTNAME = #{productname,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
PAYMODE = #{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE = #{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
CUSTOMSCODE = #{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
SHIPPERNAME = #{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS = #{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
CONSIGNEENAME = #{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS = #{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
</if>
<if test="originmanifestmasterautoid != null" >
ORIGINMANIFESTMASTERAUTOID = #{originmanifestmasterautoid,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS = #{customsstatus,jdbcType=VARCHAR},
</if>
<if test="status != null" >
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="receiption != null" >
RECEIPTION = #{receiption,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL = #{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL = #{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
SHIPPER_CODE = #{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE = #{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE = #{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
SHIPPER_FAX = #{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE = #{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX = #{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME = #{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE = #{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE = #{consigneePhone,jdbcType=VARCHAR},
</if>
</set>
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
</mapper>
... ...