场站列表接口(增加模糊查询)
This commit is contained in:
parent
2347cce36c
commit
bd849f6d26
@ -35,10 +35,10 @@ public class XhpcChargingStationController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
//@PreAuthorize(hasPermi = "system:station:list")
|
//@PreAuthorize(hasPermi = "system:station:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(XhpcChargingStation xhpcChargingStation)
|
public TableDataInfo list(String name,String operatorName)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<Map<String,Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(xhpcChargingStation);
|
List<Map<String,Object>> list = xhpcChargingStationService.selectXhpcChargingStationList(name,operatorName);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xhpc.charging.station.mapper;
|
package com.xhpc.charging.station.mapper;
|
||||||
|
|
||||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -23,11 +24,11 @@ public interface XhpcChargingStationMapper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询电站列表
|
* 查询电站列表
|
||||||
*
|
* @param name 电站名称
|
||||||
* @param xhpcChargingStation 电站
|
* @param operatorName 运营商名称
|
||||||
* @return 电站集合
|
* @return 电站集合
|
||||||
*/
|
*/
|
||||||
List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation);
|
List<Map<String,Object>> selectXhpcChargingStationList(@Param("name")String name, @Param("operatorName")String operatorName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增电站
|
* 新增电站
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public interface IXhpcChargingStationService {
|
|||||||
* @param xhpcChargingStation 电站
|
* @param xhpcChargingStation 电站
|
||||||
* @return 电站集合
|
* @return 电站集合
|
||||||
*/
|
*/
|
||||||
public List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation);
|
public List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增电站
|
* 新增电站
|
||||||
|
|||||||
@ -46,10 +46,10 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
* @return 电站
|
* @return 电站
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String,Object>> selectXhpcChargingStationList(XhpcChargingStation xhpcChargingStation)
|
public List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName)
|
||||||
{
|
{
|
||||||
//桩的统计、该时段金额
|
//桩的统计、该时段金额
|
||||||
List<Map<String,Object>> list = xhpcChargingStationMapper.selectXhpcChargingStationList(xhpcChargingStation);
|
List<Map<String,Object>> list = xhpcChargingStationMapper.selectXhpcChargingStationList(name,operatorName);
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Map<String,Object> map = list.get(i);
|
Map<String,Object> map = list.get(i);
|
||||||
Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString());
|
Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString());
|
||||||
|
|||||||
@ -47,6 +47,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from xhpc_charging_station as cs
|
from xhpc_charging_station as cs
|
||||||
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
|
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
|
||||||
where cs.del_flag =0
|
where cs.del_flag =0
|
||||||
|
<if test="name !=null and name !=''">
|
||||||
|
and cs.name like CONCAT('%',#{name},'%')
|
||||||
|
</if>
|
||||||
|
<if test="operatorName !=null and operatorName !=''">
|
||||||
|
and ope.name like CONCAT('%',#{operatorName},'%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user