Ver código fonte

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRUCK-API

luobang 3 anos atrás
pai
commit
e430e7857f

+ 1 - 1
pom.xml

@@ -156,7 +156,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>TMSTRUCK_RECEIVE_RESULT</param>
+                        <param>Tmstruck_Abnormal_Result</param>
 
                     </tables>
                 </configuration>

+ 120 - 1
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -15,6 +15,7 @@ import com.steerinfo.route.threeRequest.ZhongJiaoXingLu;
 import com.steerinfo.route.util.DataConversionTool;
 import com.steerinfo.route.util.HTTPRequestUtils;
 import com.steerinfo.route.vo.FullPathVisualizationTo.ViewVisualization;
+import com.steerinfo.route.vo.ResultWarn;
 import com.steerinfo.route.vo.resultJson.SearchPoint;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
 
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -67,7 +69,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     @PostMapping("/savePath")
     public CompletableFuture<String> savePath() throws Exception {
 
-        Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2022032400030239");
+        Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2022040600045906");
         parem.put("turnOf","0");
         return routeService.createTotalResult(parem);
         //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
@@ -135,6 +137,50 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         return success(pageList);
     }
 
+    @ApiOperation("有异常")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer")
+    })
+    @PostMapping("/getHaveAbnormalTruckOrderInfo")
+    public RESTfulResult getHaveAbnormalTruckOrderInfo(@RequestBody Map<String,Object> mapValue,
+                                                    @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
+                                                    @RequestParam(required = false,defaultValue = "1",name = "pageNum")Integer pageNum,
+                                                    @RequestParam(required = false,defaultValue = "20",name = "pageSize")Integer pageSize
+    )
+    {
+        if(mapValue.containsKey("startTime")&&mapValue.containsKey("endTime")){
+            Date  startDate=new Date(Long.parseLong(mapValue.get("startTime").toString())) ;
+            Date  endDate=new Date(Long.parseLong(mapValue.get("endTime").toString())) ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.replace("startTime",startTime1);
+            mapValue.replace("endTime",endTime1);
+        }else {
+            Date  startDate=new Date() ;
+            Date  endDate=new Date() ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.put("startTime",startTime1);
+            mapValue.put("endTime",endTime1);
+        }
+        List<Map<String,Object>> filter= offSiteTransportationService.getHaveAbnormalTruckOrderInfo(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String,Object>> list= offSiteTransportationService.getHaveAbnormalTruckOrderInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, filter,list);
+        return success(pageList);
+    }
+
 
 
     @ApiOperation("查询在途运输")
@@ -311,4 +357,77 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         return "success";
     }
 
+    /**查询是否开启运输报警状态
+     * warnSwitch
+     * @param
+     * @return
+     */
+    @ApiOperation(value="查询是否开启运输报警状态")
+    @ApiImplicitParams({
+    })
+    @PostMapping(value = "/selectWarnSwitch")
+    public RESTfulResult selectWarnSwitch() {
+        Map<String,Object> warnSwitch = offSiteTransportationService.selectWarnSwitch();
+        return success(warnSwitch);
+    }
+
+    /**是否开启运输报警状态
+     * warnSwitchaddTmstruckTotalResult
+     * @param
+     * @returninTransitOrderMileage
+     */
+    @ApiOperation(value="是否开启运输报警状态")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "warnSwitch", value = "运输报警状态", required = false, dataType = "String")
+    })
+    @PostMapping(value = "/inTransitWarn")
+    public RESTfulResult inTransitWarn(@RequestParam String warnSwitch,@RequestParam String radio) {
+        int i = offSiteTransportationService.updateWarnSwitch(warnSwitch,radio);
+        return success(i);
+    }
+
+    @PostMapping("/abnormalLineWarn")
+    public String abnormalLineWarn(@RequestParam(value = "data") String data) throws Exception {
+        System.out.println("abnormalLineWarn");
+        System.out.println(data);
+        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
+        int i= offSiteTransportationService.addTransportationAlarm(map);
+        return "success";
+    }
+    @PostMapping("/parkWarn")
+    public String parkWarn(@RequestParam(value = "data",required = false) String data) throws Exception {
+        System.out.println("parkWarn");
+        System.out.println(data);
+        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
+        int i=offSiteTransportationService.addTransportationAlarm(map);
+
+        return "success";
+    }
+    @PostMapping("/offLineWarn")
+    public String offLineWarn(@RequestParam(value = "data") String data) throws Exception {
+        System.out.println("offLineWarn");
+        System.out.println(data);
+        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
+        int i=offSiteTransportationService.addTransportationAlarm(map);
+        return "success";
+    }
+
+    @ApiOperation(value="展示运输在途异常信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(472)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getTransportAbnormalInfo")
+    public RESTfulResult getTransportAbnormalInfo(@RequestBody(required=false) Map<String,Object> mapValue,
+                                                  @RequestParam(name = "apiId",defaultValue = "472") Integer apiId,
+                                                  @RequestParam(name = "pageNum") Integer pageNum,
+                                                  @RequestParam(name = "pageSize") Integer pageSize){
+        List<Map<String, Object>> transportAbnormalInfo = offSiteTransportationService.getTransportAbnormalInfo(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> transportAbnormalInfo1 = offSiteTransportationService.getTransportAbnormalInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,transportAbnormalInfo,transportAbnormalInfo1);
+        return success(pageList);
+    }
 }

+ 16 - 0
src/main/java/com/steerinfo/dil/mapper/OffSiteTransportationMapper.java

@@ -1,7 +1,9 @@
 package com.steerinfo.dil.mapper;
 
+import com.steerinfo.dil.model.TmstruckAbnormalResult;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -22,4 +24,18 @@ public interface OffSiteTransportationMapper {
     List<Map<String, Object>> getReceiptData();
 
     int insertReceive(Map<String, Object> map);
+
+    //查询是否开启运输报警状态
+    Map<String,Object> selectWarnSwitch();
+
+    int insertOrderTripId(Map<String, Object> map);
+    
+
+    BigDecimal selectIsReceiving(String rid);
+
+    void addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult, String rid);
+
+    List<Map<String, Object>> getHaveAbnormalTruckOrderInfo(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue);
 }

+ 15 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckAbnormalResultMapper.java

@@ -0,0 +1,15 @@
+package com.steerinfo.dil.mapper;
+
+
+import com.steerinfo.dil.model.TmstruckAbnormalResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface TmstruckAbnormalResultMapper extends IBaseMapper<TmstruckAbnormalResult, BigDecimal> {
+    BigDecimal selectMaxId();
+
+    BigDecimal getTotalIdByTripId(String tripId);
+}

+ 11 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckInTransitWarnMapper.java

@@ -0,0 +1,11 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstruckInTransitWarn;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface TmstruckInTransitWarnMapper extends IBaseMapper<TmstruckInTransitWarn, BigDecimal> {
+    TmstruckInTransitWarn selectByPrimaryKey(BigDecimal bigDecimal);
+}

+ 2 - 1
src/main/java/com/steerinfo/dil/mapper/TmstruckMeasureCommissionMapper.java

@@ -113,6 +113,7 @@ public interface TmstruckMeasureCommissionMapper extends IBaseMapper<TmstruckMea
     //查询钢材委托
     Map<String, Object> getSteelMeasureCommission(Map<String, Object> map);
 
-    //查询还没计重的物资
+    //查询计重的物资
     Integer getAlreadyWeightMaterialNum(BigDecimal orderId);
+
 }

+ 214 - 0
src/main/java/com/steerinfo/dil/model/TmstruckAbnormalResult.java

@@ -0,0 +1,214 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="汽运异常实绩")
+public class TmstruckAbnormalResult implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(ABNORMAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal abnormalId;
+
+    /**
+     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="总实绩ID",required=false)
+    private BigDecimal resultTotalId;
+
+    /**
+     * 异常选型(0:司机上报异常,1:偏离,2:停车,3:离线)(ABNORMAL_TYPE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="异常选型(0:司机上报异常,1:偏离,2:停车,3:离线)",required=false)
+    private BigDecimal abnormalType;
+
+    /**
+     * 异常时间(ABNORMAL_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="异常时间",required=false)
+    private Date abnormalTime;
+
+    /**
+     * 异常地点(ABNORMAL_ADDRESS,VARCHAR,20)
+     */
+    @ApiModelProperty(value="异常地点",required=false)
+    private String abnormalAddress;
+
+    /**
+     * 异常持续时间(ABNORMAL_DURATION,DECIMAL,0)
+     */
+    @ApiModelProperty(value="异常持续时间",required=false)
+    private BigDecimal abnormalDuration;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 异常情况(ABNORMAL_CONDITION,VARCHAR,100)
+     */
+    @ApiModelProperty(value="异常情况",required=false)
+    private String abnormalCondition;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.abnormalId;
+    }
+
+    @Override
+    public void setId(BigDecimal abnormalId) {
+        this.abnormalId = abnormalId;
+    }
+
+    public BigDecimal getAbnormalId() {
+        return abnormalId;
+    }
+
+    public void setAbnormalId(BigDecimal abnormalId) {
+        this.abnormalId = abnormalId;
+    }
+
+    public BigDecimal getResultTotalId() {
+        return resultTotalId;
+    }
+
+    public void setResultTotalId(BigDecimal resultTotalId) {
+        this.resultTotalId = resultTotalId;
+    }
+
+    public BigDecimal getAbnormalType() {
+        return abnormalType;
+    }
+
+    public void setAbnormalType(BigDecimal abnormalType) {
+        this.abnormalType = abnormalType;
+    }
+
+    public Date getAbnormalTime() {
+        return abnormalTime;
+    }
+
+    public void setAbnormalTime(Date abnormalTime) {
+        this.abnormalTime = abnormalTime;
+    }
+
+    public String getAbnormalAddress() {
+        return abnormalAddress;
+    }
+
+    public void setAbnormalAddress(String abnormalAddress) {
+        this.abnormalAddress = abnormalAddress == null ? null : abnormalAddress.trim();
+    }
+
+    public BigDecimal getAbnormalDuration() {
+        return abnormalDuration;
+    }
+
+    public void setAbnormalDuration(BigDecimal abnormalDuration) {
+        this.abnormalDuration = abnormalDuration;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public String getAbnormalCondition() {
+        return abnormalCondition;
+    }
+
+    public void setAbnormalCondition(String abnormalCondition) {
+        this.abnormalCondition = abnormalCondition == null ? null : abnormalCondition.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", abnormalId=").append(abnormalId);
+        sb.append(", resultTotalId=").append(resultTotalId);
+        sb.append(", abnormalType=").append(abnormalType);
+        sb.append(", abnormalTime=").append(abnormalTime);
+        sb.append(", abnormalAddress=").append(abnormalAddress);
+        sb.append(", abnormalDuration=").append(abnormalDuration);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", abnormalCondition=").append(abnormalCondition);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 161 - 0
src/main/java/com/steerinfo/dil/model/TmstruckInTransitWarn.java

@@ -0,0 +1,161 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="null")
+public class TmstruckInTransitWarn implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(WARN_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal warnId; 
+
+    /**
+     * 预警开关(0:开启;1:关闭)(WARN_SWITCH,VARCHAR,40)
+     */
+    @ApiModelProperty(value="预警开关(0:开启;1:关闭)",required=false)
+    private String warnSwitch;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,40)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,40)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 订阅预警类型
+type=1 异常线路预警
+type=2 异常线路预警
++停车
+type=3 异常线路预警
++离线
+type=4 异常线路预警
++停车+离线(WARN_TYPE,VARCHAR,40)
+     */
+    @ApiModelProperty(value="订阅预警类型type=1 异常线路预警type=2 异常线路预警+停车type=3 异常线路预警+离线type=4 异常线路预警+停车+离线",required=false)
+    private String warnType;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.warnId;
+    }
+
+    @Override
+    public void setId(BigDecimal warnId) {
+        this.warnId = warnId;
+    }
+
+    public BigDecimal getWarnId() {
+        return warnId;
+    }
+
+    public void setWarnId(BigDecimal warnId) {
+        this.warnId = warnId;
+    }
+
+    public String getWarnSwitch() {
+        return warnSwitch;
+    }
+
+    public void setWarnSwitch(String warnSwitch) {
+        this.warnSwitch = warnSwitch == null ? null : warnSwitch.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public String getWarnType() {
+        return warnType;
+    }
+
+    public void setWarnType(String warnType) {
+        this.warnType = warnType == null ? null : warnType.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", warnId=").append(warnId);
+        sb.append(", warnSwitch=").append(warnSwitch);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", warnType=").append(warnType);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 13 - 0
src/main/java/com/steerinfo/dil/service/OffSiteTransportationService.java

@@ -9,6 +9,9 @@ import java.util.Map;
 public interface OffSiteTransportationService {
     List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue);
 
+    //修改是否开启运输报警状态
+    int updateWarnSwitch(String warnSwitch,String radio);
+
     Integer getOrderStatus(Map<String, Object> map);
 
     public Map<String, Object> getStartAndEndCapacityNumber(Map<String,Object> map);
@@ -16,4 +19,14 @@ public interface OffSiteTransportationService {
     void insertOrderMileage(Map<String, Object> ordermap);
 
     void removeDate();
+    //查询是否开启运输报警状态
+    Map<String,Object> selectWarnSwitch();
+
+     int insertOrderTripId(Map<String, Object> map);
+
+    int addTransportationAlarm(Map<String, Object> map);
+
+    List<Map<String, Object>> getHaveAbnormalTruckOrderInfo(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue);
 }

+ 119 - 0
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -1,6 +1,10 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.OffSiteTransportationMapper;
+import com.steerinfo.dil.mapper.TmstruckAbnormalResultMapper;
+import com.steerinfo.dil.mapper.TmstruckInTransitWarnMapper;
+import com.steerinfo.dil.model.TmstruckAbnormalResult;
+import com.steerinfo.dil.model.TmstruckInTransitWarn;
 import com.steerinfo.dil.model.TmstruckReceiptResult;
 import com.steerinfo.dil.service.ITmstruckReceiptResultService;
 import com.steerinfo.dil.service.OffSiteTransportationService;
@@ -14,6 +18,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +35,10 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
     private ITmstruckReceiptResultService  tmstruckReceiptResultService;
     @Autowired
     private  ITmstruckReceiptResultChildService  tmstruckReceiptResultChildService;
+    @Autowired
+    private TmstruckInTransitWarnMapper tmstruckInTransitWarnMapper;
+    @Autowired
+    private TmstruckAbnormalResultMapper tmstruckAbnormalResultMapper;
     @Override
     public List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue) {
         return offSiteTransportationMapper.getInTransitTransportation(mapValue);
@@ -78,6 +88,93 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         return offSiteTransportationMapper.orderClose(orderNumber);
     }
 
+    @Override
+    public Map<String,Object> selectWarnSwitch() {
+        return offSiteTransportationMapper.selectWarnSwitch();
+    }
+
+    @Override
+    public int insertOrderTripId(Map<String, Object> map) {
+        //获取运输订单号
+        String orderNumber = (String) map.get("orderNumber");
+        //获取行程线路id
+        String tripId = (String) map.get("rid");
+        //将两个属性放到运输订单中
+        return offSiteTransportationMapper.insertOrderTripId(map);
+    }
+
+    public int addTransportationAlarm(Map<String,Object> map) {
+        String label = (String) map.get("label");
+        //获取行程id
+        String rid = (String) map.get("rid");
+
+        //查询是否已经收货
+        BigDecimal orderStatus = offSiteTransportationMapper.selectIsReceiving(rid);
+        if (orderStatus!=null){
+            if(label.equals("1")&&orderStatus.intValue()==1){
+                //获取异常地点
+                String abnormalAddress = (String) map.get("adr");
+                //获取异常选型
+                String abnormalType = (String) map.get("type");
+                System.out.println("map.get(time)");
+                System.out.println(map);
+                System.out.println(map.get("time"));
+                //获取异常时间
+                String time = map.get("time").toString().length()>13?map.get("time").toString().substring(0,13):map.get("time").toString();
+                long lt = new Long(time);
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date date = new Date(lt);
+                //获取异常持续时间
+                BigDecimal abnormalDuration1 = null;
+                if(map.get("warnTime")!=null){
+                    Integer abnormalDuration = (Integer) map.get("warnTime");
+                    abnormalDuration1 = new BigDecimal(abnormalDuration);
+                }
+                //插入"偏离"、"停车"、"离线"运输报警
+                TmstruckAbnormalResult tmstruckAbnormalResult = new TmstruckAbnormalResult();
+                tmstruckAbnormalResult.setAbnormalAddress(abnormalAddress);
+                tmstruckAbnormalResult.setAbnormalType(new BigDecimal(abnormalType.toString()));
+                tmstruckAbnormalResult.setAbnormalTime(date);
+                tmstruckAbnormalResult.setAbnormalDuration(abnormalDuration1);
+                addTransportationAlarm(tmstruckAbnormalResult,rid);
+            }
+        }
+
+        return 1;
+    }
+
+    @Override
+    public List<Map<String, Object>> getHaveAbnormalTruckOrderInfo(Map<String, Object> mapValue) {
+        return offSiteTransportationMapper.getHaveAbnormalTruckOrderInfo(mapValue);
+    }
+
+    @Override
+    public List<Map<String, Object>> getTransportAbnormalInfo(Map<String, Object> mapValue) {
+        return offSiteTransportationMapper.getTransportAbnormalInfo(mapValue);
+    }
+
+    public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult,String tripId) {
+        long id;
+        if(tmstruckAbnormalResultMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = tmstruckAbnormalResultMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        tmstruckAbnormalResult.setAbnormalId(new BigDecimal(id));
+        //获取并插入总实绩Id
+        BigDecimal truckTotalId = tmstruckAbnormalResultMapper.getTotalIdByTripId(tripId);
+        tmstruckAbnormalResult.setResultTotalId(truckTotalId);
+        //常规字段
+        tmstruckAbnormalResult.setInsertUsername("admin");
+        tmstruckAbnormalResult.setInsertTime(new Date());
+        tmstruckAbnormalResult.setUpdateUsername("admin");
+        tmstruckAbnormalResult.setUpdateTime(new Date());
+        tmstruckAbnormalResult.setInsertUpdateRemark("无");
+        return tmstruckAbnormalResultMapper.insert(tmstruckAbnormalResult);
+    }
+
+
     public String savePath() throws Exception {
 
         Map<String, Object> parem=offSiteTransportationMapper.getTruckFactoryResult("WYSDD2021091000000002");
@@ -142,4 +239,26 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         }
 
     }
+
+    @Override
+    public int updateWarnSwitch(String warnSwitch,String radio) {
+//        //查询数据库中是否有运输预警数据,有,则修改运输报警信息,无,则新增运输报警信息
+        TmstruckInTransitWarn tmstruckInTransitWarn = tmstruckInTransitWarnMapper.selectByPrimaryKey(new BigDecimal(1));
+        if(tmstruckInTransitWarn!=null){
+            tmstruckInTransitWarn.setWarnSwitch(warnSwitch);
+            tmstruckInTransitWarn.setWarnType(radio);
+            return tmstruckInTransitWarnMapper.updateByPrimaryKey(tmstruckInTransitWarn);
+        }else {
+            TmstruckInTransitWarn tmstruckInTransitWarn1 = new TmstruckInTransitWarn();
+            tmstruckInTransitWarn1.setWarnId(new BigDecimal(1));
+            tmstruckInTransitWarn1.setWarnSwitch(warnSwitch);
+            tmstruckInTransitWarn1.setInsertUsername("admin");
+            tmstruckInTransitWarn1.setInsertTime(new Date());
+            tmstruckInTransitWarn1.setUpdateUsername("admin");
+            tmstruckInTransitWarn1.setUpdateTime(new Date());
+            tmstruckInTransitWarn1.setInsertUpdateRemark("无");
+            tmstruckInTransitWarn1.setWarnType("0");
+            return tmstruckInTransitWarnMapper.insertSelective(tmstruckInTransitWarn1);
+        }
+    }
 }

+ 20 - 6
src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java

@@ -43,10 +43,13 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
 
     @Autowired
     private RulesMapper rulesMapper;
+
     @Autowired
-    UtilsMapper utilsMapper;
+    private UtilsMapper utilsMapper;
+
     @Autowired
     private RulesServiceImpl rulesService;
+
     @Autowired
     private TmstruckTareReturnResultMapper tmstruckTareReturnResultMapper;
 
@@ -362,6 +365,14 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 }else if(orderType == 13){
                     measureCommission.put("flowTo","出厂");
                 }else if(orderType == 14){
+                    //查询还有几次未计量实绩
+                    BigDecimal resultTotalId = DataChange.dataToBigDecimal(map.get("resultTotalId"));
+                    Integer count = tmstruckMeasureCommissionMapper.selectNoNetWeightResult(resultTotalId);
+                    if(count > 1){ //第一次进厂
+                        measureCommission.put("materiaName", measureCommission.get("materiaName") + "(出)");
+                    }else { //第二次进厂
+                        measureCommission.put("materiaName", measureCommission.get("materiaName") + "(入)");
+                    }
                     measureCommission.put("flowTo","中转");
                 }else{
                     measureCommission.put("flowTo","退货");
@@ -401,8 +412,8 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
     public int sendDXMeasureCommissionMes(Map<String, Object> map){
         Map<String, Object> measureCommission = null;
         //查询计量委托
-        BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
-        switch (orderType.intValue()){
+        Integer orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
+        switch (orderType){
             case 1:
             case 2:
             case 3:
@@ -452,10 +463,13 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 measureCommission = tmstruckMeasureCommissionMapper.sporadicDXMeasure(map);
                 if(measureCommission == null)
                     return 0;
-                if(orderType.intValue() == 14){
-                    Integer weightResultCount14 = tmstruckMeasureCommissionMapper.selectNoNetWeightResult(DataChange.dataToBigDecimal(map.get("resultTotalId")));
-                    if(weightResultCount14 == 1){
+                if(orderType == 14){
+                    Integer count = tmstruckMeasureCommissionMapper.selectNoNetWeightResult(DataChange.dataToBigDecimal(map.get("resultTotalId")));
+                    if(count > 1){ //第一次进厂
+                        measureCommission.put("goodsName", measureCommission.get("goodsName") + "(出)");
+                    }else {//第二次进厂
                         measureCommission.put("item", measureCommission.get("item") + ",1");
+                        measureCommission.put("goodsName", measureCommission.get("goodsName") + "(入)");
                     }
                 }
                 measureCommission.put("regionName", "无法确定汽车衡"); //无法确定汽车衡

+ 32 - 19
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -4,7 +4,11 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
+import com.steerinfo.dil.service.OffSiteTransportationService;
+import com.steerinfo.dil.service.impl.OffSiteTransportationServiceImpl;
+import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
 import com.steerinfo.route.service.RouteService;
 import com.steerinfo.route.threeRequest.ZhongJiaoXingLu;
 import com.steerinfo.route.util.DataConversionTool;
@@ -16,11 +20,16 @@ import com.steerinfo.route.vo.Map.RouteVo;
 import com.steerinfo.route.vo.Map.RunRoutePoint;
 import com.steerinfo.route.vo.Map.StartAndEndRoute;
 import com.steerinfo.route.vo.resultJson.SearchPoint;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.math.BigDecimal;
 import java.net.URLEncoder;
@@ -39,6 +48,8 @@ public class RouteServiceImpl implements RouteService {
 
     @Autowired
     private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
+    @Autowired
+    private OffSiteTransportationServiceImpl offSiteTransportationService;
     @Value("${str.tengxun.key}")
     private String key;
     @Value("${redis.prefix.order}")
@@ -169,27 +180,28 @@ public class RouteServiceImpl implements RouteService {
 
                         redisTemplate.opsForValue().set(orderUrl+suffix, redisJson);
                         //预警开关判断0开启1关闭
+                        Map<String,Object> resTfulResultValues = offSiteTransportationService.selectWarnSwitch();
+
+
+                        if(!resTfulResultValues.get("switch").toString().equals("0")){
+
+                            redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode());
+                            redisMap.put("destCode",materieldesMap.get("destCode").toString());
+                            redisMap.put("qryBtm",parse.toString());
+                            redisMap.put("qryEtm",calendar.getTime().toString());
+                            redisMap.put("type",resTfulResultValues.get("type").toString());
+                            String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap);
 
+                            JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json);
 
-//                        if(checkTurnOff(vcMeasurerec.getcMaterieldes(),resTfulResultValues.get("switch").toString())){
-//
-//                            redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode());
-//                            redisMap.put("destCode",materieldesMap.get("destCode").toString());
-//                            redisMap.put("qryBtm",parse.toString());
-//                            redisMap.put("qryEtm",calendar.getTime().toString());
-//                            redisMap.put("type",resTfulResultValues.get("type").toString());
-//                            String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap);
-//
-//                            JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json);
-//
-//
-//                            if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){
-//                                HashMap<String,Object> tripMap=new HashMap();
-//                                tripMap.put("orderNumber",tmsData.get("orderNumber").toString());
-//                                tripMap.put("rid",jsonObject.get("result").toString());
-//                                omsFeign.insertOrderTripId(tripMap);
-//                            }
-//                        }
+
+                            if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){
+                                HashMap<String,Object> tripMap=new HashMap();
+                                tripMap.put("orderNumber",mapValue.get("orderNumber").toString());
+                                tripMap.put("rid",jsonObject.get("result").toString());
+                                int i=offSiteTransportationService.insertOrderTripId(tripMap);
+                            }
+                        }
                     }
                     return  CompletableFuture.completedFuture("successful");
                 }
@@ -754,4 +766,5 @@ public class RouteServiceImpl implements RouteService {
 
     }
 
+
 }

+ 275 - 0
src/main/resources/com/steerinfo/dil/mapper/OffSiteTransportationMapper.xml

@@ -7,6 +7,12 @@
     <insert id="insertReceive">
         insert into TMSTRUCK_RECEIVE_RESULT(RESULT_RECEIVE_ID ,result_total_id ,insert_username ,insert_time ,status) values('${RESULTID}','${RESULTTOTALID}','${INSERUSERNAME}', #{INSERTTIME,jdbcType=TIMESTAMP},'${STATUS}')
     </insert>
+    <insert id="addTransportationAlarm">
+    
+    </insert>
+    <update id="insertOrderTripId" parameterType="java.util.Map">
+        update OMSTRUCK_ORDER set TRIP_ID = #{rid} where ORDER_NUMBER = #{orderNumber}
+  </update>
     <update id="orderClose">
         update OMSTRUCK_ORDER set ORDER_STATUS = '2' where ORDER_NUMBER = #{orderNumber}
     </update>
@@ -299,6 +305,275 @@
     <select id="getReceiptData" resultType="java.util.Map">
         select result_id resultId,result_total_id resultTotalId,insert_username inserUserName,insert_time insertTime,status status from TMSTRUCK_RECEIPT_RESULT
     </select>
+    <select id="selectWarnSwitch" resultType="Map">
+    select WARN_SWITCH "switch",WARN_TYPE "type" from TMSTRUCK_IN_TRANSIT_WARN where WARN_ID = 1
+  </select>
+    <select id="selectIsReceiving" resultType="java.math.BigDecimal">
+        select RESULT_TOTAL_ID "totalId"
+        from TMSTRUCK_TOTAL_RESULT t_total
+               left join OMSTRUCK_ORDER o_order
+                         on t_total.ORDER_ID=o_order.ORDER_ID
+        where o_order.TRIP_ID = #{tripId} and o_order.ORDER_STATUS = 1
+    </select>
+    <select id="getHaveAbnormalTruckOrderInfo" resultType="java.util.Map">
+        select
+        *
+        from (
+        select  distinct
+        OO.ORDER_STATUS               "orderStatus",
+        OO.ORDER_NUMBER              "orderNumber", --运单订单号
+        RC.CAPACITY_NUMBER           "capacityNumber",--车牌号
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
+        TWR.RESULT_NET_WEIGHT        "resultNetWeight",--净重
+        TLFR.RESULT_OUT_GATE_TIME    "resultOutGateTime",--出厂时间
+        RGOUT.GATEPOST_NAME          "outGatepostName",--出厂门禁
+        RCR.CARRIER_NAME             "carrierName" , --承运商名称
+        CONCAT( CONCAT( CONCAT(RRA.ADDRESS_PROVINCE,RRA.ADDRESS_DISTRICT),RRA.Address_Town),RRP.ADDRESS_DELIVERY_ADDRESS) "deliveryAddress",  --详细收货地址
+        RM.MATERIAL_NAME             "materialName" , --"物质名称"
+        RM.MATERIAL_SPECIFICATION    "materialSpecification", -- "物质规格"
+        RM.MATERIAL_MODEL            "materialModel", --"物质型号"
+        RCON.CONSIGNEE_COMPANY_NAME   "receiveName"--客户名称
+    
+        from OMSTRUCK_ORDER OO --运输订单
+        left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
+        on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+        left join AMS_SALE_ORDER ASO --销售订单
+        on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+        left join RMS_CONSIGNEE RCON --收货客户
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+        left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
+        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join RMS_WAREHOUSE RW --装卸货仓库
+        on RW.WAREHOUSE_ID = TLR.LOADING_ID
+    
+        left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
+        on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join RMS_GATEPOST RGOUT --门岗
+        on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
+        left join RMS_CAPACITY RC --运力
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+    
+    
+        left join AMS_DISPATCH_SALE_ORDER  ADSO
+        on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
+        left join RMS_CARRIER RCR --承运单位
+        on ADSO.CARRIER_ID=RCR.CARRIER_ID
+    
+    
+        left join RMS_RECEIVE_PLACE RRP  --收货地址
+        on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
+        left join RMS_RECEIVE_ADDRESS RRA
+        on RRP.ADDRESS_ID=RRA.ADDRESS_ID
+    
+        left join AMS_SALE_TRUCKNO_MATERIAL ASTM
+        on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
+    
+        left join AMS_SALE_MATERIAL ASM1
+        on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
+    
+        left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID  and  ASM1.MATERIAL_ID =TWR.MATERIAL_ID
+    
+        left join RMS_MATERIAL RM
+        on ASM1.MATERIAL_ID=RM.MATERIAL_ID
+        left join(
+        select max(RESULT_TOTAL_ID) coun,RESULT_TOTAL_ID RESULT_TOTAL_ID from  TMSTRUCK_ABNORMAL_RESULT
+        group by RESULT_TOTAL_ID
+        ) TAR
+        on TTR.RESULT_TOTAL_ID=TAR.RESULT_TOTAL_ID
+        where TAR.coun is not null and OO.ORDER_TYPE in (1) and TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+        )
+        <where>
+            <if test="orderStatus !=null">
+                and "orderStatus" ='${orderStatus}'
+            </if>
+            <if test="orderNumbers !=null and orderNumbers !=''">
+                and "orderNumber" like '%${orderNumbers}%'
+            </if>
+            <if test="capacityNumbers !=null and capacityNumbers !=''">
+                and "capacityNumber" like '%${capacityNumbers}%'
+            </if>
+            <if test="resultGrossWeightTimes !=null and resultGrossWeightTimes !=''">
+                and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
+            </if>
+            <if test="resultGrossWeightTimes !=null and resultGrossWeightTimes !=''">
+                and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
+            </if>
+            <if test="resultOutGateTimes !=null and resultOutGateTimes !=''">
+                and "resultOutGateTime" like '%${resultOutGateTimes}%'
+            </if>
+            <if test="resultNetWeights !=null and resultNetWeights !=''">
+                and "resultNetWeight" like '%${resultNetWeights}%'
+            </if>
+            <if test="resultOutGateTimes !=null and resultOutGateTimes !=''">
+                and "resultOutGateTime" like '%${resultOutGateTimes}%'
+            </if>
+            <if test="outGatepostNames !=null and outGatepostNames !=''">
+                and "outGatepostName" like '%${outGatepostNames}%'
+            </if>
+            <if test="carrierNames !=null and carrierNames !=''">
+                and "carrierName" like '%${carrierNames}%'
+            </if>
+            <if test="deliveryAddresss !=null and deliveryAddresss !=''">
+                and "deliveryAddress" like '%${deliveryAddresss}%'
+            </if>
+            <if test="materialNames !=null and materialNames !=''">
+                and "materialName" like '%${materialNames}%'
+            </if>
+            <if test="materialSpecifications !=null and materialSpecifications !=''">
+                and "materialSpecification" like '%${materialSpecifications}%'
+            </if>
+            <if test="materialModels !=null and materialModels !=''">
+                and "materialModel" like '%${materialModels}%'
+            </if>
+            <if test="receiveNames !=null and receiveNames!=''">
+                and "receiveName" like '%${receiveNames}%'
+            </if>
+            <if test="startTime != null">
+                and "resultOutGateTime" &gt;= to_date('${startTime}','yyyy-mm-dd')
+            </if>
+            <if test="endTime != null">
+                and "resultOutGateTime" &lt;= to_date('${endTime}','yyyy-mm-dd')
+            </if>
+            <if test="orderNumber !=null">
+                and  "orderNumber" in
+                <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="capacityNumber !=null">
+                and  "capacityNumber" in
+                <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime !=null">
+                and  "resultGrossWeightTime" in
+                <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultNetWeight !=null">
+                and  "resultNetWeight" in
+                <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="resultOutGateTime !=null">
+                and  "resultOutGateTime" in
+                <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="outGatepostName !=null">
+                and  "outGatepostName" in
+                <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="carrierName !=null">
+                and  "carrierName" in
+                <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="deliveryAddress !=null">
+                and  "deliveryAddress" in
+                <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="materialSpecification !=null">
+                and  "materialSpecification" in
+                <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="materialModel !=null">
+                and  "materialModel" in
+                <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+            <if test="receiveName !=null">
+                and  "receiveName" in
+                <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+    </select>
+    <select id="getTransportAbnormalInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select * from(
+        select r_capacity.CAPACITY_NUMBER "capacityNumber",
+        o_torder.ORDER_NUMBER "orderNumber",
+        a_s_order.SALE_NUMBER "saleNumber",
+        t_abnormal.ABNORMAL_TYPE "abnormalType",
+        t_abnormal.ABNORMAL_TIME "abnormalTime",
+        t_abnormal.ABNORMAL_ADDRESS "abnormalAddress",
+        t_abnormal.ABNORMAL_DURATION "abnormalDuration"
+        from TMSTRUCK_ABNORMAL_RESULT t_abnormal
+        left join TMSTRUCK_TOTAL_RESULT t_total
+        on t_abnormal.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER o_torder
+        on t_total.ORDER_ID=o_torder.ORDER_ID
+        left join RMS_CAPACITY r_capacity
+        on o_torder.CAPACITY_ID=r_capacity.CAPACITY_ID
+        left join AMS_SALE_ORDER_MATERIAL sale_material
+        on o_torder.ORDER_PLAN_ID=sale_material.SALE_ORDER_MATERIAL_ID
+        left join AMS_SALE_ORDER a_s_order
+        on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+        where o_torder.ORDER_NUMBER=#{orderNumbers}
+        order by t_abnormal.ABNORMAL_TIME desc)
+        <where>
+            <if test="capacityNumber != null">
+                and
+                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+                    "capacityNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="saleNumber != null">
+                and
+                <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+                    "saleNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="abnormalCondition != null">
+                and
+                <foreach collection="abnormalCondition" item="item" open="(" separator="or" close=")">
+                    "abnormalCondition" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="abnormalTime != null">
+                and
+                <foreach collection="abnormalTime" item="item" open="(" separator="or" close=")">
+                    "abnormalTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="abnormalAddress != null">
+                and
+                <foreach collection="abnormalAddress" item="item" open="(" separator="or" close=")">
+                    "abnormalAddress" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="abnormalDuration != null">
+                and
+                <foreach collection="abnormalDuration" item="item" open="(" separator="or" close=")">
+                    "abnormalDuration" like '%${item}%'
+                </foreach>
+            </if>
+            <include refid="orderBy"></include>
+        </where>
+    </select>
     <sql id="orderBy">
         <if test="orderField != null and orderField != ''">
             order by  "${orderField}"

+ 410 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckAbnormalResultMapper.xml

@@ -0,0 +1,410 @@
+<?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.steerinfo.dil.mapper.TmstruckAbnormalResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckAbnormalResult">
+    <id column="ABNORMAL_ID" jdbcType="DECIMAL" property="abnormalId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="ABNORMAL_TYPE" jdbcType="DECIMAL" property="abnormalType" />
+    <result column="ABNORMAL_TIME" jdbcType="TIMESTAMP" property="abnormalTime" />
+    <result column="ABNORMAL_ADDRESS" jdbcType="VARCHAR" property="abnormalAddress" />
+    <result column="ABNORMAL_DURATION" jdbcType="DECIMAL" property="abnormalDuration" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="ABNORMAL_CONDITION" jdbcType="VARCHAR" property="abnormalCondition" />
+  </resultMap>
+  <sql id="columns">
+    ABNORMAL_ID, RESULT_TOTAL_ID, ABNORMAL_TYPE, ABNORMAL_TIME, ABNORMAL_ADDRESS, ABNORMAL_DURATION, 
+    INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+    ABNORMAL_CONDITION
+  </sql>
+  <sql id="columns_alias">
+    t.ABNORMAL_ID, t.RESULT_TOTAL_ID, t.ABNORMAL_TYPE, t.ABNORMAL_TIME, t.ABNORMAL_ADDRESS, 
+    t.ABNORMAL_DURATION, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, 
+    t.INSERT_UPDATE_REMARK, t.ABNORMAL_CONDITION
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRUCK_ABNORMAL_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_ABNORMAL_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="abnormalId != null">
+        and ABNORMAL_ID = #{abnormalId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="abnormalType != null">
+        and ABNORMAL_TYPE = #{abnormalType}
+      </if>
+      <if test="abnormalTime != null">
+        and TO_CHAR(ABNORMAL_TIME,'yyyy-MM-dd') = #{abnormalTime}
+      </if>
+      <if test="abnormalAddress != null and abnormalAddress != ''">
+        and ABNORMAL_ADDRESS = #{abnormalAddress}
+      </if>
+      <if test="abnormalDuration != null">
+        and ABNORMAL_DURATION = #{abnormalDuration}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="abnormalCondition != null and abnormalCondition != ''">
+        and ABNORMAL_CONDITION = #{abnormalCondition}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="abnormalId != null">
+        and ABNORMAL_ID = #{abnormalId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="abnormalType != null">
+        and ABNORMAL_TYPE = #{abnormalType}
+      </if>
+      <if test="abnormalTime != null">
+        and TO_CHAR(ABNORMAL_TIME,'yyyy-MM-dd') = #{abnormalTime}
+      </if>
+      <if test="abnormalAddress != null and abnormalAddress != ''">
+        and ABNORMAL_ADDRESS LIKE '%${abnormalAddress}%'
+      </if>
+      <if test="abnormalDuration != null">
+        and ABNORMAL_DURATION = #{abnormalDuration}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="abnormalCondition != null and abnormalCondition != ''">
+        and ABNORMAL_CONDITION LIKE '%${abnormalCondition}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_ABNORMAL_RESULT
+    where ABNORMAL_ID = #{abnormalId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_ABNORMAL_RESULT
+    where 1!=1 
+      <if test="resultTotalId != null">
+        or RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="abnormalType != null">
+        or ABNORMAL_TYPE = #{abnormalType}
+      </if>
+      <if test="abnormalTime != null">
+        or TO_CHAR(ABNORMAL_TIME,'yyyy-MM-dd') = '#{abnormalTime}'
+      </if>
+      <if test="abnormalAddress != null and abnormalAddress != ''">
+        or ABNORMAL_ADDRESS = #{abnormalAddress}
+      </if>
+      <if test="abnormalDuration != null">
+        or ABNORMAL_DURATION = #{abnormalDuration}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="abnormalCondition != null and abnormalCondition != ''">
+        or ABNORMAL_CONDITION = #{abnormalCondition}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckAbnormalResult">
+    insert into TMSTRUCK_ABNORMAL_RESULT (ABNORMAL_ID, RESULT_TOTAL_ID, ABNORMAL_TYPE, 
+      ABNORMAL_TIME, ABNORMAL_ADDRESS, ABNORMAL_DURATION, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, ABNORMAL_CONDITION
+      )
+    values (#{abnormalId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{abnormalType,jdbcType=DECIMAL}, 
+      #{abnormalTime,jdbcType=TIMESTAMP}, #{abnormalAddress,jdbcType=VARCHAR}, #{abnormalDuration,jdbcType=DECIMAL}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{abnormalCondition,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckAbnormalResult">
+    insert into TMSTRUCK_ABNORMAL_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="abnormalId != null">
+        ABNORMAL_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="abnormalType != null">
+        ABNORMAL_TYPE,
+      </if>
+      <if test="abnormalTime != null">
+        ABNORMAL_TIME,
+      </if>
+      <if test="abnormalAddress != null">
+        ABNORMAL_ADDRESS,
+      </if>
+      <if test="abnormalDuration != null">
+        ABNORMAL_DURATION,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="abnormalCondition != null">
+        ABNORMAL_CONDITION,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="abnormalId != null">
+        #{abnormalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="abnormalType != null">
+        #{abnormalType,jdbcType=DECIMAL},
+      </if>
+      <if test="abnormalTime != null">
+        #{abnormalTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="abnormalAddress != null">
+        #{abnormalAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="abnormalDuration != null">
+        #{abnormalDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="abnormalCondition != null">
+        #{abnormalCondition,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckAbnormalResult">
+    update TMSTRUCK_ABNORMAL_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      ABNORMAL_TYPE = #{abnormalType,jdbcType=DECIMAL},
+      ABNORMAL_TIME = #{abnormalTime,jdbcType=TIMESTAMP},
+      ABNORMAL_ADDRESS = #{abnormalAddress,jdbcType=VARCHAR},
+      ABNORMAL_DURATION = #{abnormalDuration,jdbcType=DECIMAL},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      ABNORMAL_CONDITION = #{abnormalCondition,jdbcType=VARCHAR}
+    where ABNORMAL_ID = #{abnormalId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckAbnormalResult">
+    update TMSTRUCK_ABNORMAL_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="abnormalType != null">
+        ABNORMAL_TYPE = #{abnormalType,jdbcType=DECIMAL},
+      </if>
+      <if test="abnormalTime != null">
+        ABNORMAL_TIME = #{abnormalTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="abnormalAddress != null">
+        ABNORMAL_ADDRESS = #{abnormalAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="abnormalDuration != null">
+        ABNORMAL_DURATION = #{abnormalDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="abnormalCondition != null">
+        ABNORMAL_CONDITION = #{abnormalCondition,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ABNORMAL_ID = #{abnormalId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where ABNORMAL_ID = #{abnormalId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <select id="selectMaxId" resultType="java.math.BigDecimal">
+  
+  </select>
+  <select id="getTotalIdByTripId" resultType="java.math.BigDecimal">
+     select RESULT_TOTAL_ID "totalId"
+    from TMSTRUCK_TOTAL_RESULT t_total
+           left join OMSTRUCK_ORDER o_order
+                     on t_total.ORDER_ID=o_order.ORDER_ID
+    where o_order.TRIP_ID = #{tripId} and o_order.ORDER_STATUS = 1
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRUCK_ABNORMAL_RESULT 
+      (ABNORMAL_ID, 
+      RESULT_TOTAL_ID, ABNORMAL_TYPE, 
+      ABNORMAL_TIME, ABNORMAL_ADDRESS, 
+      ABNORMAL_DURATION, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      ABNORMAL_CONDITION)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.abnormalId,jdbcType=DECIMAL}, 
+      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.abnormalType,jdbcType=DECIMAL}, 
+      #{item.abnormalTime,jdbcType=TIMESTAMP}, #{item.abnormalAddress,jdbcType=VARCHAR}, 
+      #{item.abnormalDuration,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.abnormalCondition,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRUCK_ABNORMAL_RESULT
+     set
+       ABNORMAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_TOTAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+       </foreach>
+       ,ABNORMAL_TYPE=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalType,jdbcType=DECIMAL}
+       </foreach>
+       ,ABNORMAL_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,ABNORMAL_ADDRESS=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalAddress,jdbcType=VARCHAR}
+       </foreach>
+       ,ABNORMAL_DURATION=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalDuration,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,ABNORMAL_CONDITION=
+       <foreach close="end" collection="list" index="index" item="item" open="case ABNORMAL_ID" separator=" ">
+          when #{item.abnormalId,jdbcType=DECIMAL} then #{item.abnormalCondition,jdbcType=VARCHAR}
+       </foreach>
+     where ABNORMAL_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.abnormalId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_ABNORMAL_RESULT
+    where ABNORMAL_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+ 
+  
+</mapper>

+ 290 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckInTransitWarnMapper.xml

@@ -0,0 +1,290 @@
+<?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.steerinfo.dil.mapper.TmstruckInTransitWarnMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckInTransitWarn">
+    <id column="WARN_ID" jdbcType="DECIMAL" property="warnId" />
+    <result column="WARN_SWITCH" jdbcType="VARCHAR" property="warnSwitch" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="WARN_TYPE" jdbcType="VARCHAR" property="warnType" />
+  </resultMap>
+  <sql id="columns">
+    WARN_ID, WARN_SWITCH, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+    INSERT_UPDATE_REMARK, WARN_TYPE
+  </sql>
+  <sql id="columns_alias">
+    t.WARN_ID, t.WARN_SWITCH, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, 
+    t.INSERT_UPDATE_REMARK, t.WARN_TYPE
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM TMSTRUCK_IN_TRANSIT_WARN
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_IN_TRANSIT_WARN t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="warnId != null">
+        and WARN_ID = #{warnId}
+      </if>
+      <if test="warnSwitch != null and warnSwitch != ''">
+        and WARN_SWITCH = #{warnSwitch}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="warnType != null and warnType != ''">
+        and WARN_TYPE = #{warnType}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="warnId != null">
+        and WARN_ID = #{warnId}
+      </if>
+      <if test="warnSwitch != null and warnSwitch != ''">
+        and WARN_SWITCH LIKE '%${warnSwitch}%'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="warnType != null and warnType != ''">
+        and WARN_TYPE LIKE '%${warnType}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_IN_TRANSIT_WARN
+    where WARN_ID = #{warnId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_IN_TRANSIT_WARN
+    where 1!=1 
+      <if test="warnSwitch != null and warnSwitch != ''">
+        or WARN_SWITCH = #{warnSwitch}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="warnType != null and warnType != ''">
+        or WARN_TYPE = #{warnType}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckInTransitWarn">
+    insert into TMSTRUCK_IN_TRANSIT_WARN (WARN_ID, WARN_SWITCH, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, WARN_TYPE)
+    values (#{warnId,jdbcType=DECIMAL}, #{warnSwitch,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, 
+      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{insertUpdateRemark,jdbcType=VARCHAR}, #{warnType,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckInTransitWarn">
+    insert into TMSTRUCK_IN_TRANSIT_WARN
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="warnId != null">
+        WARN_ID,
+      </if>
+      <if test="warnSwitch != null">
+        WARN_SWITCH,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="warnType != null">
+        WARN_TYPE,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="warnId != null">
+        #{warnId,jdbcType=DECIMAL},
+      </if>
+      <if test="warnSwitch != null">
+        #{warnSwitch,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="warnType != null">
+        #{warnType,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckInTransitWarn">
+    update TMSTRUCK_IN_TRANSIT_WARN
+    set WARN_SWITCH = #{warnSwitch,jdbcType=VARCHAR},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      WARN_TYPE = #{warnType,jdbcType=VARCHAR}
+    where WARN_ID = #{warnId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckInTransitWarn">
+    update TMSTRUCK_IN_TRANSIT_WARN
+    <set>
+      <if test="warnSwitch != null">
+        WARN_SWITCH = #{warnSwitch,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="warnType != null">
+        WARN_TYPE = #{warnType,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where WARN_ID = #{warnId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where WARN_ID = #{warnId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRUCK_IN_TRANSIT_WARN 
+      (WARN_ID, 
+      WARN_SWITCH, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, WARN_TYPE)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.warnId,jdbcType=DECIMAL}, 
+      #{item.warnSwitch,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.warnType,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRUCK_IN_TRANSIT_WARN
+     set
+       WARN_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.warnId,jdbcType=DECIMAL}
+       </foreach>
+       ,WARN_SWITCH=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.warnSwitch,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,WARN_TYPE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case WARN_ID" close="end">
+          when #{item.warnId,jdbcType=DECIMAL} then #{item.warnType,jdbcType=VARCHAR}
+       </foreach>
+     where WARN_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.warnId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_IN_TRANSIT_WARN
+    where WARN_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>