瀏覽代碼

Merge remote-tracking branch 'origin/master'

zhengqiang 4 年之前
父節點
當前提交
fcc716aee3

+ 64 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/ShiftInfoDTO.java

@@ -0,0 +1,64 @@
+package com.jpsoft.bus.modules.bus.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:bus_shift_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_shift_info的实体类")
+public class ShiftInfoDTO {
+        @ApiModelProperty(value = "车辆班次编号")
+    private String id;
+        @ApiModelProperty(value = "司机")
+    private Long  driverId;
+        @ApiModelProperty(value = "车辆编号")
+    private String vehicleId;
+        @ApiModelProperty(value = "路线编号")
+    private String routeId;
+        @ApiModelProperty(value = "起始站")
+    private String startStationId;
+        @ApiModelProperty(value = "当前站点")
+    private String currentStationId;
+        @ApiModelProperty(value = "状态值")
+    private String status;
+        @ApiModelProperty(value = "终点站")
+    private String endStationId;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag = false;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "是否收班(到达终点站,乘客全部下车)")
+    private Date finishTime;
+
+    @ApiModelProperty(value = "司机")
+    private String driverName;
+    @ApiModelProperty(value = "车辆名称")
+    private String vehicleName;
+    @ApiModelProperty(value = "路线名称")
+    private String routeName;
+    @ApiModelProperty(value = "起始站")
+    private String startStationName;
+    @ApiModelProperty(value = "当前站点")
+    private String currentStationName;
+    @ApiModelProperty(value = "终点站")
+    private String endStationName;
+}

+ 13 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/ShiftInfo.java

@@ -50,4 +50,17 @@ public class ShiftInfo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "是否收班(到达终点站,乘客全部下车)")
     private Date finishTime;
+
+    @ApiModelProperty(value = "司机")
+    private String driverName;
+    @ApiModelProperty(value = "车辆车牌")
+    private String vehicleNumber;
+    @ApiModelProperty(value = "路线名称")
+    private String routeName;
+    @ApiModelProperty(value = "起始站")
+    private String startStationName;
+    @ApiModelProperty(value = "当前站点")
+    private String currentStationName;
+    @ApiModelProperty(value = "终点站")
+    private String endStationName;
 }

+ 27 - 3
common/src/main/resources/mapper/bus/ShiftInfo.xml

@@ -18,6 +18,12 @@
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
 			<result property="finishTime" column="finish_time" />
+			<result property="driverName" column="driver_name" />
+			<result property="vehicleNumber" column="vehicle_number" />
+			<result property="routeName" column="route_name" />
+			<result property="startStationName" column="start_station_name" />
+			<result property="currentStationName" column="current_station_name" />
+			<result property="endStationName" column="end_station_name" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.ShiftInfo">
 	<!--
@@ -106,12 +112,30 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="ShiftInfoMap">
 		<![CDATA[
-			select * from bus_shift_info
+			SELECT
+				a.*,
+				b.name_ AS driver_name,
+				c.license_plate_number AS vehicle_number,
+				d.name_ AS route_name,
+				e.name_ AS start_station_name,
+				f.name_ AS current_station_name,
+				g.name_ AS end_station_name
+			FROM
+				bus_shift_info a
+				LEFT JOIN bus_driver_info b ON a.driver_id = b.id_
+				LEFT JOIN bus_vehicle_info c ON a.vehicle_id = c.id_
+				LEFT JOIN bus_route_info d ON a.route_id = d.id_
+				LEFT JOIN bus_station_info e ON a.start_station_id = e.id_
+				LEFT JOIN bus_station_info f ON a.current_station_id = f.id_
+				LEFT JOIN bus_station_info g ON a.end_station_id = g.id_
 		]]>
 		<where>
-			del_flag = 0
+			a.del_flag = 0
 			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+				and a.ID_ like #{searchParams.id}
+			</if>
+			<if test="searchParams.vehicleNumber != null">
+				and c.license_plate_number like #{searchParams.vehicleNumber}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 7 - 2
web/src/main/java/com/jpsoft/bus/modules/bus/controller/ShiftInfoController.java

@@ -200,7 +200,8 @@ public class ShiftInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            @RequestParam(value="id",defaultValue="") String id,
+            @RequestParam(value="vehicleNumber",defaultValue="") String vehicleNumber,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -213,12 +214,16 @@ public class ShiftInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("a.create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
         }
 
+        if (StringUtils.isNotEmpty(vehicleNumber)) {
+            searchParams.put("vehicleNumber","%" + vehicleNumber + "%");
+        }
+
         Page<ShiftInfo> page = shiftInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
         msgResult.setResult(true);