Browse Source

路线 区域

xiao547607 4 years ago
parent
commit
df4817532c

+ 30 - 0
common/src/main/java/com/jpsoft/bus/modules/base/dao/RegionInfoDAO.java

@@ -0,0 +1,30 @@
+package com.jpsoft.bus.modules.base.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.base.entity.RegionInfo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-10-12 16:20
+ */
+@Repository
+public interface RegionInfoDAO {
+
+    int insert(RegionInfo entity);
+    int update(RegionInfo entity);
+    int exist(String id);
+    RegionInfo get(String id);
+    int delete(String id);
+    List<RegionInfo> list();
+    List<RegionInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<RegionInfo> findByParentId(String parentId);
+
+    List<RegionInfo> findTopRegion();
+
+    RegionInfo findByName(String name);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/bus/modules/base/dto/RegionInfoDTO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.bus.modules.base.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-1-21 14:58
+ */
+@Data
+public class RegionInfoDTO {
+
+    private String value;
+
+    private String text;
+
+    private List<RegionInfoDTO> children;
+}

+ 43 - 0
common/src/main/java/com/jpsoft/bus/modules/base/entity/RegionInfo.java

@@ -0,0 +1,43 @@
+package com.jpsoft.bus.modules.base.entity;
+
+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;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-10-12 16:16
+ */
+@Data
+@ApiModel(value = "base_region_info的实体类")
+public class RegionInfo {
+
+    @ApiModelProperty(value = "")
+    private String id;
+    @ApiModelProperty(value = "区域名称")
+    private String name;
+    @ApiModelProperty(value = "上级id")
+    private String parentId;
+    @ApiModelProperty(value = "备注")
+    private String remark;
+    @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;
+    @ApiModelProperty(value = "全称")
+    private String fullName;
+}

+ 29 - 0
common/src/main/java/com/jpsoft/bus/modules/base/service/RegionInfoService.java

@@ -0,0 +1,29 @@
+package com.jpsoft.bus.modules.base.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.base.entity.RegionInfo;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-10-12 16:17
+ */
+public interface RegionInfoService {
+
+    RegionInfo get(String id);
+    boolean exist(String id);
+    int insert(RegionInfo model);
+    int update(RegionInfo model);
+    int delete(String id);
+    List<RegionInfo> list();
+    Page<RegionInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+
+    List<RegionInfo> findByParentId(String parentId);
+
+    List<RegionInfo> findTopRegion();
+
+    RegionInfo findByName(String name);
+}

+ 92 - 0
common/src/main/java/com/jpsoft/bus/modules/base/service/impl/RegionInfoServiceImpl.java

@@ -0,0 +1,92 @@
+package com.jpsoft.bus.modules.base.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.base.dao.RegionInfoDAO;
+import com.jpsoft.bus.modules.base.entity.RegionInfo;
+import com.jpsoft.bus.modules.base.service.RegionInfoService;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-10-12 16:18
+ */
+@Transactional
+@Component(value="regionInfoService")
+public class RegionInfoServiceImpl implements RegionInfoService {
+
+    @Resource(name="regionInfoDAO")
+    private RegionInfoDAO regionInfoDAO;
+
+    @Override
+    public RegionInfo get(String id) {
+        // TODO Auto-generated method stub
+        return regionInfoDAO.get(id);
+    }
+
+    @Override
+    public int insert(RegionInfo model) {
+        // TODO Auto-generated method stub
+        //model.setId(UUID.randomUUID().toString());
+
+        return regionInfoDAO.insert(model);
+    }
+
+    @Override
+    public int update(RegionInfo model) {
+        // TODO Auto-generated method stub
+        return regionInfoDAO.update(model);
+    }
+
+    @Override
+    public int delete(String id) {
+        // TODO Auto-generated method stub
+        return regionInfoDAO.delete(id);
+    }
+
+    @Override
+    public boolean exist(String id) {
+        // TODO Auto-generated method stub
+        int count = regionInfoDAO.exist(id);
+
+        return count > 0 ? true : false;
+    }
+
+    @Override
+    public List<RegionInfo> list() {
+        // TODO Auto-generated method stub
+        return regionInfoDAO.list();
+    }
+
+    @Override
+    public Page<RegionInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize, boolean count, List<Sort> sortList) {
+        Page<RegionInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            regionInfoDAO.search(searchParams,sortList);
+        });
+
+        return page;
+    }
+
+    @Override
+    public List<RegionInfo> findByParentId(String parentId) {
+        return regionInfoDAO.findByParentId(parentId);
+    }
+
+    @Override
+    public List<RegionInfo> findTopRegion() {
+        return regionInfoDAO.findTopRegion();
+    }
+
+    @Override
+    public RegionInfo findByName(String name){
+        return regionInfoDAO.findByName(name);
+    }
+}

+ 5 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dto/RouteInfoDTO.java

@@ -29,4 +29,9 @@ public class RouteInfoDTO {
     private List<StationInfoDTO> removeStationList;
 
     private List<String> pathList;
+
+    @ApiModelProperty(value = "地区id")
+    private String regionId;
+    @ApiModelProperty(value = "地区翻译")
+    private String regionName;
 }

+ 4 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/RouteInfo.java

@@ -47,4 +47,8 @@ public class RouteInfo {
 
     @ApiModelProperty(value = "单位编号")
     private String companyName;
+    @ApiModelProperty(value = "地区id")
+    private String regionId;
+    @ApiModelProperty(value = "地区翻译")
+    private String regionName;
 }

+ 124 - 0
common/src/main/resources/mapper/base/RegionInfo.xml

@@ -0,0 +1,124 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.base.dao.RegionInfoDAO">
+    <resultMap id="RegionInfoMap" type="com.jpsoft.bus.modules.base.entity.RegionInfo">
+        <id property="id" column="id_" />
+        <result property="name" column="name_" />
+        <result property="parentId" column="parent_id" />
+        <result property="remark" column="remark_" />
+        <result property="createBy" column="create_by" />
+        <result property="createTime" column="create_time" />
+        <result property="updateBy" column="update_by" />
+        <result property="updateTime" column="update_time" />
+        <result property="delFlag" column="del_flag" />
+        <result property="fullName" column="full_name" />
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.RegionInfo">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into base_region_info
+	    (id_,name_,parent_id,remark_,create_by,create_time,update_by,update_time,del_flag,full_name)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{name,jdbcType=VARCHAR}
+,#{parentId,jdbcType=VARCHAR}
+,#{remark,jdbcType=VARCHAR}
+,#{createBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+,#{delFlag,jdbcType= NUMERIC }
+,#{fullName,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from base_region_info where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.base.entity.RegionInfo">
+        update base_region_info
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId!=null">
+                parent_id=#{parentId,jdbcType=VARCHAR},
+            </if>
+            <if test="remark!=null">
+                remark_=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="fullName!=null">
+                full_name=#{fullName,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="RegionInfoMap">
+        select * from base_region_info where id_=#{0} and del_flag = 0
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from base_region_info where id_=#{0}
+    </select>
+    <select id="list" resultMap="RegionInfoMap">
+		select * from base_region_info where del_flag = 0
+	</select>
+    <select id="search" parameterType="hashmap" resultMap="RegionInfoMap">
+        <![CDATA[
+			select * from base_region_info
+		]]>
+        <where>
+            and del_flag = 0
+            <if test="searchParams.id != null">
+                and ID_ like #{searchParams.id}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList"  open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+
+    <select id="findByParentId" resultMap="RegionInfoMap">
+        <![CDATA[
+        select * from base_region_info
+        where parent_id = #{0}
+        and del_flag = 0
+        order by create_time desc
+        ]]>
+    </select>
+    <select id="findTopRegion" resultMap="RegionInfoMap">
+        <![CDATA[
+        select * from base_region_info
+        where parent_id is null
+        and del_flag = 0
+        ]]>
+    </select>
+
+    <select id="findByName" resultMap="RegionInfoMap">
+        <![CDATA[
+        select * from base_region_info
+        where name_ = #{0}
+        ]]>
+    </select>
+</mapper>

+ 22 - 5
common/src/main/resources/mapper/bus/RouteInfo.xml

@@ -16,6 +16,9 @@
 			<result property="goodsId" column="goods_id" />
 			<result property="startTime" column="start_time" />
 			<result property="endTime" column="end_time" />
+			<result property="companyName" column="company_name" />
+			<result property="regionId" column="region_id"/>
+			<result property="regionName" column="region_name" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.RouteInfo">
 	<!--
@@ -25,7 +28,8 @@
 	-->
 	<![CDATA[
 		insert into bus_route_info
-	    (id_,name_,create_by,create_time,update_by,update_time,del_flag,map_path,company_id,goods_id,start_time,end_time)
+	    (id_,name_,create_by,create_time,update_by,update_time,del_flag,map_path,company_id,goods_id,start_time,end_time,
+	    region_id)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -40,6 +44,7 @@
 ,#{goodsId,jdbcType=VARCHAR}
 ,#{startTime,jdbcType=VARCHAR}
 ,#{endTime,jdbcType=VARCHAR}
+            ,#{regionId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -82,6 +87,9 @@
 				<if test="endTime!=null">
 		end_time=#{endTime,jdbcType=VARCHAR},
 		</if>
+			<if test="regionId!=null">
+				region_id=#{regionId,jdbcType= VARCHAR },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -96,15 +104,24 @@
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="RouteInfoMap">
 		<![CDATA[
-			select * from bus_route_info
+			select
+			a.*,
+			b.name_ as company_name,
+			c.name_ as region_name
+			from bus_route_info a
+			left join bus_company_info b on a.company_id = b.id_
+            left join base_region_info c on a.region_id = c.id_
 		]]>
 		<where>
-			del_flag = false
+			a.del_flag = false
 			<if test="searchParams.name != null">
-				and name_ like #{searchParams.name}
+				and a.name_ like #{searchParams.name}
 			</if>
 			<if test="searchParams.companyId != null">
-				and company_id = #{searchParams.companyId}
+				and a.company_id = #{searchParams.companyId}
+			</if>
+			<if test="searchParams.regionId != null">
+				and a.region_id = #{searchParams.regionId}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 252 - 0
web/src/main/java/com/jpsoft/bus/modules/base/controller/RegionInfoController.java

@@ -0,0 +1,252 @@
+package com.jpsoft.bus.modules.base.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.base.entity.RegionInfo;
+import com.jpsoft.bus.modules.base.service.RegionInfoService;
+import com.jpsoft.bus.modules.common.dto.MessageResult;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.common.utils.PojoUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+/**
+ * 地区区域信息表
+ * sz
+ * **/
+@RestController
+@RequestMapping("/base/regionInfo")
+@Api(description = "regionInfo")
+public class RegionInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+    @Autowired
+    private RegionInfoService regionInfoService;
+
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<RegionInfo> create(){
+        MessageResult<RegionInfo> msgResult = new MessageResult<>();
+
+        RegionInfo regionInfo = new RegionInfo();
+
+        msgResult.setData(regionInfo);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<RegionInfo> add(@RequestBody RegionInfo regionInfo, @RequestAttribute String subject){
+        MessageResult<RegionInfo> msgResult = new MessageResult<>();
+
+        try {
+            regionInfo.setId(UUID.randomUUID().toString());
+            regionInfo.setDelFlag(false);
+            regionInfo.setCreateBy(subject);
+            regionInfo.setCreateTime(new Date());
+            
+            int affectCount = regionInfoService.insert(regionInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(regionInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<RegionInfo> edit(@PathVariable("id") String id){
+        MessageResult<RegionInfo> msgResult = new MessageResult<>();
+
+        try {
+            RegionInfo regionInfo = regionInfoService.get(id);
+
+            if (regionInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(regionInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<RegionInfo> update(@RequestBody RegionInfo regionInfo, @RequestAttribute String subject){
+        MessageResult<RegionInfo> msgResult = new MessageResult<>();
+
+        try {
+            regionInfo.setUpdateBy(subject);
+            regionInfo.setUpdateTime(new Date());
+            
+            int affectCount = regionInfoService.update(regionInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(regionInfo);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id, @RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            RegionInfo regionInfo = regionInfoService.get(id);
+            regionInfo.setDelFlag(true);
+            regionInfo.setUpdateBy(subject);
+            regionInfo.setUpdateTime(new Date());
+
+            int affectCount = regionInfoService.update(regionInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList, @RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                RegionInfo regionInfo = regionInfoService.get(id);
+                regionInfo.setDelFlag(true);
+                regionInfo.setUpdateBy(subject);
+                regionInfo.setUpdateTime(new Date());
+
+                affectCount += regionInfoService.update(regionInfo);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            @RequestParam(value="sceneId",defaultValue="") String sceneId,
+            @RequestParam(value="useEnable",defaultValue="") String useEnable,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.create_time","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+        if (StringUtils.isNotEmpty(sceneId)) {
+            searchParams.put("sceneId",sceneId);
+        }
+
+        if (StringUtils.isNotEmpty(useEnable)) {
+            searchParams.put("useEnable",useEnable);
+        }
+
+        Page<RegionInfo> page = regionInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="所有地区区域列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<List<RegionInfo>> list(String companyId,String type,@RequestAttribute String subject){
+
+        MessageResult<List<RegionInfo>> msgResult = new MessageResult<>();
+
+        List<RegionInfo> list = regionInfoService.list();
+
+        msgResult.setResult(true);
+        msgResult.setData(list);
+
+        return msgResult;
+    }
+}

+ 8 - 8
web/src/main/java/com/jpsoft/bus/modules/bus/controller/RouteInfoController.java

@@ -161,6 +161,7 @@ public class RouteInfoController {
                 routeInfoDTO.setCompanyId(routeInfo.getCompanyId());
                 routeInfoDTO.setStartTime(routeInfo.getStartTime());
                 routeInfoDTO.setEndTime(routeInfo.getEndTime());
+                routeInfoDTO.setRegionId(routeInfo.getRegionId());
 
                 List<StationInfoDTO> stationInfoDTOList = new ArrayList<>();
 
@@ -232,6 +233,7 @@ public class RouteInfoController {
             routeInfo.setCompanyId(dto.getCompanyId());
             routeInfo.setStartTime(dto.getStartTime());
             routeInfo.setEndTime(dto.getEndTime());
+            routeInfo.setRegionId(dto.getRegionId());
             routeInfo.setUpdateBy(subject);
             routeInfo.setUpdateTime(new Date());
 
@@ -429,6 +431,7 @@ public class RouteInfoController {
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
             String companyId,String name,
+            @RequestParam(value="regionI",defaultValue="") String regionId,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -441,7 +444,7 @@ public class RouteInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","desc"));
+        sortList.add(new Sort("a.create_time","desc"));
 
         if (StringUtils.isNotEmpty(companyId)) {
             searchParams.put("companyId",companyId);
@@ -451,15 +454,12 @@ public class RouteInfoController {
             searchParams.put("name","%" + name + "%");
         }
 
-        Page<RouteInfo> page = routeInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
-
-        for (RouteInfo routeInfo:page) {
-            CompanyInfo companyInfo = companyInfoService.get(routeInfo.getCompanyId());
-            if(companyInfo!=null){
-                routeInfo.setCompanyName(companyInfo.getName());
-            }
+        if (StringUtils.isNotEmpty(regionId)) {
+            searchParams.put("regionId",regionId);
         }
 
+        Page<RouteInfo> page = routeInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));