提交 b9b7aad9 authored 作者: Phyday's avatar Phyday

交通量查询

上级 78b1a916
package com.elephant.framework.galaxy.aroad.module.traffic.controller; package com.elephant.framework.galaxy.aroad.module.traffic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog; import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection;
import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficRoadsectionService; import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficRoadsectionService;
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/** /**
...@@ -32,7 +31,7 @@ public class TrafficRoadsectionController extends BaseController { ...@@ -32,7 +31,7 @@ public class TrafficRoadsectionController extends BaseController {
*/ */
@GetMapping("/page") @GetMapping("/page")
public R getTrafficRoadsectionPage(Page page, TrafficRoadsection trafficRoadsection) { public R getTrafficRoadsectionPage(Page page, TrafficRoadsection trafficRoadsection) {
return new R<>(trafficRoadsectionService.page(page,Wrappers.query(trafficRoadsection))); return new R<>(trafficRoadsectionService.getTrafficRoadsectionPage(page,trafficRoadsection));
} }
......
package com.elephant.framework.galaxy.aroad.module.traffic.controller; package com.elephant.framework.galaxy.aroad.module.traffic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog; import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficRouteService; import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficRouteService;
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/** /**
...@@ -32,7 +31,7 @@ public class TrafficRouteController extends BaseController { ...@@ -32,7 +31,7 @@ public class TrafficRouteController extends BaseController {
*/ */
@GetMapping("/page") @GetMapping("/page")
public R getTrafficRoutePage(Page page, TrafficRoute trafficRoute) { public R getTrafficRoutePage(Page page, TrafficRoute trafficRoute) {
return new R<>(trafficRouteService.page(page,Wrappers.query(trafficRoute))); return new R<>(trafficRouteService.getTrafficRoutePage(page,trafficRoute));
} }
......
package com.elephant.framework.galaxy.aroad.module.traffic.controller; package com.elephant.framework.galaxy.aroad.module.traffic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog; import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficSpotService; import com.elephant.framework.galaxy.aroad.module.traffic.service.TrafficSpotService;
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/** /**
...@@ -32,7 +31,7 @@ public class TrafficSpotController extends BaseController { ...@@ -32,7 +31,7 @@ public class TrafficSpotController extends BaseController {
*/ */
@GetMapping("/page") @GetMapping("/page")
public R getTrafficSpotPage(Page page, TrafficSpot trafficSpot) { public R getTrafficSpotPage(Page page, TrafficSpot trafficSpot) {
return new R<>(trafficSpotService.page(page,Wrappers.query(trafficSpot))); return new R<>(trafficSpotService.getTrafficSpotPage(page,trafficSpot));
} }
......
package com.elephant.framework.galaxy.aroad.module.traffic.mapper; package com.elephant.framework.galaxy.aroad.module.traffic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection;
/** /**
...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsect ...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsect
* @date 2019-04-30 10:48:34 * @date 2019-04-30 10:48:34
*/ */
public interface TrafficRoadsectionMapper extends BaseMapper<TrafficRoadsection> { public interface TrafficRoadsectionMapper extends BaseMapper<TrafficRoadsection> {
IPage<TrafficRoadsection> getTrafficRoadsectionPage(Page<TrafficRoadsection> page, TrafficRoadsection trafficRoadsection);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.mapper; package com.elephant.framework.galaxy.aroad.module.traffic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
/** /**
...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; ...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
* @date 2019-04-30 10:44:18 * @date 2019-04-30 10:44:18
*/ */
public interface TrafficRouteMapper extends BaseMapper<TrafficRoute> { public interface TrafficRouteMapper extends BaseMapper<TrafficRoute> {
IPage<TrafficRoute> getTrafficRoutePage(Page<TrafficRoute> page, TrafficRoute trafficRoute);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.mapper; package com.elephant.framework.galaxy.aroad.module.traffic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
/** /**
...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; ...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
* @date 2019-04-29 14:38:10 * @date 2019-04-29 14:38:10
*/ */
public interface TrafficSpotMapper extends BaseMapper<TrafficSpot> { public interface TrafficSpotMapper extends BaseMapper<TrafficSpot> {
IPage<TrafficSpot> getTrafficSpotPage(Page<TrafficSpot> page, TrafficSpot trafficSpot);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service; package com.elephant.framework.galaxy.aroad.module.traffic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection;
...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsect ...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsect
* @date 2019-04-30 10:48:34 * @date 2019-04-30 10:48:34
*/ */
public interface TrafficRoadsectionService extends IService<TrafficRoadsection> { public interface TrafficRoadsectionService extends IService<TrafficRoadsection> {
IPage<TrafficRoadsection> getTrafficRoadsectionPage(Page<TrafficRoadsection> page, TrafficRoadsection trafficRoadsection);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service; package com.elephant.framework.galaxy.aroad.module.traffic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; ...@@ -10,5 +12,6 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
* @date 2019-04-30 10:44:18 * @date 2019-04-30 10:44:18
*/ */
public interface TrafficRouteService extends IService<TrafficRoute> { public interface TrafficRouteService extends IService<TrafficRoute> {
IPage<TrafficRoute> getTrafficRoutePage(Page<TrafficRoute> page, TrafficRoute trafficRoute);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service; package com.elephant.framework.galaxy.aroad.module.traffic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
...@@ -11,4 +13,5 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; ...@@ -11,4 +13,5 @@ import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
*/ */
public interface TrafficSpotService extends IService<TrafficSpot> { public interface TrafficSpotService extends IService<TrafficSpot> {
IPage<TrafficSpot> getTrafficSpotPage(Page<TrafficSpot> page, TrafficSpot trafficSpot);
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service.impl; package com.elephant.framework.galaxy.aroad.module.traffic.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection;
import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRoadsectionMapper; import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRoadsectionMapper;
...@@ -14,5 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -14,5 +16,7 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class TrafficRoadsectionServiceImpl extends ServiceImpl<TrafficRoadsectionMapper, TrafficRoadsection> implements TrafficRoadsectionService { public class TrafficRoadsectionServiceImpl extends ServiceImpl<TrafficRoadsectionMapper, TrafficRoadsection> implements TrafficRoadsectionService {
public IPage<TrafficRoadsection> getTrafficRoadsectionPage(Page<TrafficRoadsection> page, TrafficRoadsection trafficRoadsection){
return baseMapper.getTrafficRoadsectionPage(page, trafficRoadsection);
}
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service.impl; package com.elephant.framework.galaxy.aroad.module.traffic.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRouteMapper; import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRouteMapper;
...@@ -14,5 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -14,5 +16,7 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class TrafficRouteServiceImpl extends ServiceImpl<TrafficRouteMapper, TrafficRoute> implements TrafficRouteService { public class TrafficRouteServiceImpl extends ServiceImpl<TrafficRouteMapper, TrafficRoute> implements TrafficRouteService {
public IPage<TrafficRoute> getTrafficRoutePage(Page<TrafficRoute> page, TrafficRoute trafficRoute){
return baseMapper.getTrafficRoutePage(page, trafficRoute);
}
} }
package com.elephant.framework.galaxy.aroad.module.traffic.service.impl; package com.elephant.framework.galaxy.aroad.module.traffic.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot; import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficSpot;
import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficSpotMapper; import com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficSpotMapper;
...@@ -15,4 +17,7 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +17,7 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TrafficSpotServiceImpl extends ServiceImpl<TrafficSpotMapper, TrafficSpot> implements TrafficSpotService { public class TrafficSpotServiceImpl extends ServiceImpl<TrafficSpotMapper, TrafficSpot> implements TrafficSpotService {
public IPage<TrafficSpot> getTrafficSpotPage(Page<TrafficSpot> page, TrafficSpot trafficSpot){
return baseMapper.getTrafficSpotPage(page, trafficSpot);
}
} }
...@@ -26,4 +26,15 @@ ...@@ -26,4 +26,15 @@
<result property="jdcCurrentAmount" column="JDC_current_amount"/> <result property="jdcCurrentAmount" column="JDC_current_amount"/>
<result property="jdcNaturalAmount" column="JDC_natural_amount"/> <result property="jdcNaturalAmount" column="JDC_natural_amount"/>
</resultMap> </resultMap>
<select id="getTrafficRoadsectionPage" resultMap="trafficRoadsectionMap">
select * from traffic_roadsection
<where>
<if test="trafficRoadsection.spotName != null">
spot_name like CONCAT('%',#{trafficRoadsection.spotName},'%')
or
spot_code like CONCAT('%',#{trafficRoadsection.spotName},'%')
</if>
</where>
</select>
</mapper> </mapper>
...@@ -4,27 +4,39 @@ ...@@ -4,27 +4,39 @@
<mapper namespace="com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRouteMapper"> <mapper namespace="com.elephant.framework.galaxy.aroad.module.traffic.mapper.TrafficRouteMapper">
<resultMap id="trafficRouteMap" type="com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute"> <resultMap id="trafficRouteMap" type="com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute">
<id property="id" column="id"/> <id property="id" column="id"/>
<result property="roadCode" column="road_code"/> <result property="roadCode" column="road_code"/>
<result property="roadName" column="road_name"/> <result property="roadName" column="road_name"/>
<result property="spotLength" column="spot_length"/> <result property="spotLength" column="spot_length"/>
<result property="jdcCurrentAmount" column="JDC_current_amount"/> <result property="jdcCurrentAmount" column="JDC_current_amount"/>
<result property="jdcNaturalAmount" column="JDC_natural_amount"/> <result property="jdcNaturalAmount" column="JDC_natural_amount"/>
<result property="qcCurrentAmount" column="QC_current_amount"/> <result property="qcCurrentAmount" column="QC_current_amount"/>
<result property="qcNaturalAmount" column="QC_natural_amount"/> <result property="qcNaturalAmount" column="QC_natural_amount"/>
<result property="qcSTruck" column="QC_s_truck"/> <result property="qcSTruck" column="QC_s_truck"/>
<result property="qcMTruck" column="QC_m_truck"/> <result property="qcMTruck" column="QC_m_truck"/>
<result property="qcLTurck" column="QC_l_turck"/> <result property="qcLTurck" column="QC_l_turck"/>
<result property="qcXlTruck" column="QC_xl_truck"/> <result property="qcXlTruck" column="QC_xl_truck"/>
<result property="qcJzxTruck" column="QC_jzx_truck"/> <result property="qcJzxTruck" column="QC_jzx_truck"/>
<result property="qcSmBus" column="QC_sm_bus"/> <result property="qcSmBus" column="QC_sm_bus"/>
<result property="qcLBus" column="QC_l_bus"/> <result property="qcLBus" column="QC_l_bus"/>
<result property="motor" column="motor"/> <result property="motor" column="motor"/>
<result property="tljCurrentAmount" column="TLJ_current_amount"/> <result property="tljCurrentAmount" column="TLJ_current_amount"/>
<result property="tljNaturalAmount" column="TLJ_natural_amount"/> <result property="tljNaturalAmount" column="TLJ_natural_amount"/>
<result property="driveAmount" column="drive_amount"/> <result property="driveAmount" column="drive_amount"/>
<result property="adaptAmount" column="adapt_amount"/> <result property="adaptAmount" column="adapt_amount"/>
<result property="crowd" column="crowd"/> <result property="crowd" column="crowd"/>
</resultMap> </resultMap>
<select id="getTrafficRoutePage" resultMap="trafficRouteMap"
parameterType="com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute">
select * from traffic_route
<where>
<if test="trafficRoute.roadName != null">
road_name like CONCAT('%',#{trafficRoute.roadName},'%')
or
road_code like CONCAT('%',#{trafficRoute.roadName},'%')
</if>
</where>
</select>
</mapper> </mapper>
...@@ -26,4 +26,15 @@ ...@@ -26,4 +26,15 @@
<result property="landscape" column="landscape"/> <result property="landscape" column="landscape"/>
<result property="stopMonth" column="stop_month"></result> <result property="stopMonth" column="stop_month"></result>
</resultMap> </resultMap>
<select id="getTrafficSpotPage" resultMap="trafficSpotMap">
select * from traffic_spot
<where>
<if test="trafficSpot.roadName != null">
road_name like CONCAT('%',#{trafficSpot.roadName},'%')
or
road_code like CONCAT('%',#{trafficSpot.roadName},'%')
</if>
</where>
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论