Commit 28cd574a authored by chenying's avatar chenying

3.20修改线路接口

parent f4a76c00
......@@ -43,6 +43,16 @@ public class ResultCircuitVo {
private String remark;
private String createTime;
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getStartLongitude() {
return startLongitude;
}
......
......@@ -68,7 +68,8 @@ public class CircuitController {
" deliveryAddress:交付地址," +
" transportationType:运输类型" +
" circuitState:线路状态(0未开始,1运输中,2完成)," +
" remark:备注")
" remark:备注," +
" createTime:创建线路时间")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
......@@ -110,7 +111,8 @@ public class CircuitController {
" deliveryAddress:交付地址," +
" transportationType:运输类型" +
" circuitState:线路状态(0未开始,1运输中,2完成)," +
" remark:备注")
" remark:备注," +
" createTime:创建线路时间")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
......
......@@ -2,17 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.tdl.mapper.CircuitMapper">
<select id="getAll" resultType="com.example.tdl.domain.vo.ResultCircuitVo">
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity, startAddress,
IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,
endAddress,IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity,
startAddress,startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,endAddress,endTime,transport,
(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark,createTime
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1 order BY c.id DESC
</select>
<select id="getByTerm" resultType="com.example.tdl.domain.vo.ResultCircuitVo" parameterType="com.example.tdl.domain.vo.CircuitTermVo">
SELECT transportationNo,routeNumber,routeName,abbreviation,startCity,IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endCity,
IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity,
startAddress,startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,endAddress,endTime,transport,
(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark,createTime
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1
<if test="transportationNo!=null">
AND transportationNo like CONCAT(CONCAT('%',#{transportationNo,jdbcType=VARCHAR}),'%')
......@@ -127,17 +126,15 @@
</delete>
<select id="getByTransportationNo" resultType="com.example.tdl.domain.vo.ResultCircuitVo" parameterType="String">
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity, startAddress,
IFNULL(from_unixtime((startTime/1000),'%Y-%m-%d %T'),"-") startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,
endAddress,IFNULL(from_unixtime((endTime/1000),'%Y-%m-%d %T'),"-") endTime,transport,(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,
boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark
SELECT transportationNo,routeNumber,routeName,startLongitude,startLatitude,(select city from city_config where id=r.start_id) startCity,
startAddress,startTime,endLongitude,endLatitude,(select city from city_config where id=r.end_id) endCity,endAddress,endTime,transport,
(SELECT alarmType FROM alarm WHERE id=c.alarm_id) alarmType,boxNo,containerNo,deliveryAddress,transportationType,circuitState,c.remark,createTime
from circuit c,route r WHERE c.route_id=r.id AND r.state=1 AND c.state=1 AND transportationNo=#{transportationNo,jdbcType=VARCHAR}
</select>
<select id="getByNo" parameterType="String" resultType="com.example.tdl.domain.vo.ResultGatewayVo">
SELECT SN,`name`,type,state,bConfig,useScene,from_unixtime((createTime/1000),'%Y-%m-%d %T') createTime,from_unixtime((updateTime/1000),'%Y-%m-%d %T') updateTime
from gateway
WHERE id=(SELECT gateway_id from tdldevice where circuit_id =(SELECT id from circuit WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}))
SELECT SN,`name`,type,state,bConfig,useScene,from_unixtime((createTime/1000),'%Y-%m-%d %T') createTime,from_unixtime((updateTime/1000),'%Y-%m-%d %T') updateTime
from gateway WHERE id=(SELECT gateway_id from tdldevice where circuit_id =(SELECT id from circuit WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}))
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment