增加大屏按区域统计接口
This commit is contained in:
parent
39b187060c
commit
aeaee7c699
@ -129,7 +129,11 @@ public class XhpcDataBigScreenController extends BaseController {
|
|||||||
return xhpcDataBigScreenService.returnCoreLocation(coreParam);
|
return xhpcDataBigScreenService.returnCoreLocation(coreParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/core-chargingStation")
|
||||||
|
public R<List<Map<String, Object>>> returnCoreChargingStation(CoreParam coreParam) {
|
||||||
|
|
||||||
|
return xhpcDataBigScreenService.returnCoreChargingStation(coreParam);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 工单
|
* 工单
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -27,6 +27,8 @@ public interface XhpcChargingStationMapper {
|
|||||||
*/
|
*/
|
||||||
List<Map<String, Object>> selectByTenantIdAndChargingStationId(@Param("tenantIdsStr") String tenantIdsStr, @Param("chargingStationId") Long chargingStationId);
|
List<Map<String, Object>> selectByTenantIdAndChargingStationId(@Param("tenantIdsStr") String tenantIdsStr, @Param("chargingStationId") Long chargingStationId);
|
||||||
|
|
||||||
|
List<Map<String, Object>> returnCoreChargingStation(@Param("tenantIdsStr") String tenantIdsStr, @Param("chargingStationId") Long chargingStationId, @Param("areaCode") Integer areaCode,@Param("number") Integer number);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author WH
|
* @author WH
|
||||||
* @date 2022/3/3 15:20
|
* @date 2022/3/3 15:20
|
||||||
|
|||||||
@ -25,6 +25,8 @@ public interface XhpcDataBigScreenService {
|
|||||||
*/
|
*/
|
||||||
R<List<Map<String, Object>>> returnCoreLocation(CoreParam coreParam);
|
R<List<Map<String, Object>>> returnCoreLocation(CoreParam coreParam);
|
||||||
|
|
||||||
|
R returnCoreChargingStation(CoreParam coreParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query total count of user
|
* query total count of user
|
||||||
*
|
*
|
||||||
|
|||||||
@ -90,6 +90,30 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R returnCoreChargingStation(CoreParam coreParam) {
|
||||||
|
String tenantIdsStr = coreParam.getTenantIds();
|
||||||
|
if (coreParam.getParamType() == null) {
|
||||||
|
return R.fail("ParamType不能为null");
|
||||||
|
}
|
||||||
|
Integer areaCode = coreParam.getAreaCode();
|
||||||
|
int number =0;
|
||||||
|
if(areaCode !=null){
|
||||||
|
number = xhpcChargingStationMapper.getXhpcAreaLevel(areaCode);
|
||||||
|
}
|
||||||
|
String chargingStationIdStr = coreParam.getChargingStationIds();
|
||||||
|
if(chargingStationIdStr==null || "".equals(chargingStationIdStr)){
|
||||||
|
List<Map<String, Object>> list = xhpcChargingStationMapper.returnCoreChargingStation(tenantIdsStr, null, areaCode, number+1);
|
||||||
|
Object[] objects = list.toArray();
|
||||||
|
return R.ok(objects);
|
||||||
|
}
|
||||||
|
long chargingStationId = Long.parseLong(chargingStationIdStr);
|
||||||
|
//judge care param function
|
||||||
|
List<Map<String, Object>> list = xhpcChargingStationMapper.returnCoreChargingStation(tenantIdsStr, chargingStationId, areaCode, number+1);
|
||||||
|
Object[] objects = list.toArray();
|
||||||
|
return R.ok(objects);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<Object> queryUserTotalCount(CoreParam coreParam) {
|
public R<Object> queryUserTotalCount(CoreParam coreParam) {
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,63 @@
|
|||||||
AND xhpc_charging_station.charging_station_id = #{chargingStationId}
|
AND xhpc_charging_station.charging_station_id = #{chargingStationId}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="returnCoreChargingStation" resultType="map">
|
||||||
|
SELECT
|
||||||
|
name,
|
||||||
|
(SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
|
||||||
|
and find_in_set(tenant_id, #{tenantIdsStr})
|
||||||
|
</if>
|
||||||
|
<if test="areaCode != null and areaCode != '' ">
|
||||||
|
<if test="number ==0">
|
||||||
|
AND area_code in (select code from xhpc_area where pcode in(select code from xhpc_area where pcode =xa.code))
|
||||||
|
</if>
|
||||||
|
<if test="number ==1">
|
||||||
|
AND area_code in (select code from xhpc_area where pcode in(select code from xhpc_area where pcode =xa.code))
|
||||||
|
</if>
|
||||||
|
<if test="number ==2">
|
||||||
|
AND area_code in (select code from xhpc_area where pcode =xa.code)
|
||||||
|
</if>
|
||||||
|
<if test="number ==3">
|
||||||
|
AND area_code =xa.code
|
||||||
|
</if>
|
||||||
|
</if>) value
|
||||||
|
FROM
|
||||||
|
xhpc_area as xa
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="areaCode != null and areaCode != '' ">
|
||||||
|
and xa.level =#{number}
|
||||||
|
<if test="number==0">
|
||||||
|
and (SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
AND area_code in (select code from xhpc_area where pcode in(select code from xhpc_area where pcode =xa.code)))>0
|
||||||
|
</if>
|
||||||
|
<if test="number ==1">
|
||||||
|
and (SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
AND area_code in (select code from xhpc_area where pcode in(select code from xhpc_area where pcode =xa.code)))>0
|
||||||
|
</if>
|
||||||
|
<if test="number ==2">
|
||||||
|
and (SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
AND area_code in (select code from xhpc_area where pcode =xa.code))>0
|
||||||
|
</if>
|
||||||
|
<if test="number ==3">
|
||||||
|
and (SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
AND area_code =xa.code )>0
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
<if test="areaCode==null or areaCode == '' ">
|
||||||
|
and xa.level =1
|
||||||
|
and (SELECT count(charging_station_id) FROM xhpc_charging_station
|
||||||
|
WHERE del_flag = 0
|
||||||
|
AND area_code in (select code from xhpc_area where pcode in(select code from xhpc_area where pcode =xa.code)))>0
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectByTenantIdAndAreaCode" resultType="map">
|
<select id="selectByTenantIdAndAreaCode" resultType="map">
|
||||||
SELECT
|
SELECT
|
||||||
xhpc_charging_station.tenant_id tenantId,
|
xhpc_charging_station.tenant_id tenantId,
|
||||||
|
|||||||
@ -1061,7 +1061,7 @@
|
|||||||
left join xhpc_internet_user as iu on iu.internet_user_id = ss.charging_mode
|
left join xhpc_internet_user as iu on iu.internet_user_id = ss.charging_mode
|
||||||
where ss.del_flag=0 and ss.type=2
|
where ss.del_flag=0 and ss.type=2
|
||||||
<if test="startTime !=null and startTime !=''">
|
<if test="startTime !=null and startTime !=''">
|
||||||
and ss.create_time >= #{startTime}
|
and ss.create_time >= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime !=null and endTime !=''">
|
<if test="endTime !=null and endTime !=''">
|
||||||
and ss.create_time <= #{endTime}
|
and ss.create_time <= #{endTime}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user