巡检首页接口
This commit is contained in:
parent
1b0ec520b7
commit
fac1f8dca8
@ -29,7 +29,7 @@ public interface XhpcInspectionMapper {
|
||||
|
||||
int stationSum();
|
||||
|
||||
int abnormalStation(@Param("time") String time);
|
||||
Integer abnormalStation(@Param("time") String time);
|
||||
|
||||
int todayOrder(@Param("time") String time);
|
||||
|
||||
|
||||
@ -261,18 +261,24 @@ public class XhpcInspectionServiceImpl implements IXhpcInspectionService {
|
||||
int stationSum = xhpcInspectionMapper.stationSum();
|
||||
map1.put("stationSum",stationSum);
|
||||
String today = DateUtil.today();
|
||||
int abnormalStation = xhpcInspectionMapper.abnormalStation(today);
|
||||
Integer abnormalStation = xhpcInspectionMapper.abnormalStation(today);
|
||||
if(abnormalStation==null){
|
||||
map1.put("abnormalStation",0);
|
||||
}else{
|
||||
map1.put("abnormalStation",abnormalStation);
|
||||
|
||||
}
|
||||
|
||||
int todayOrder = xhpcInspectionMapper.todayOrder(today);
|
||||
map1.put("todayOrder",todayOrder);
|
||||
|
||||
int emptyOrderRate = xhpcInspectionMapper.emptyOrderRate(today);
|
||||
if(emptyOrderRate==0){
|
||||
map1.put("emptyOrderRate",0);
|
||||
}else{
|
||||
double result = (double) todayOrder / emptyOrderRate;
|
||||
String formatted = String.format("%.2f", result);
|
||||
map1.put("emptyOrderRate",formatted);
|
||||
|
||||
}
|
||||
|
||||
String completionRate = xhpcInspectionMapper.completionRate(today);
|
||||
map1.put("completionRate",completionRate);
|
||||
|
||||
@ -367,11 +367,11 @@
|
||||
</select>
|
||||
|
||||
<select id="stationSum" resultType="int">
|
||||
select IFNULL((count(*),0) from xhpc_charging_station where del_flag =0
|
||||
select IFNULL(count(*),0) from xhpc_charging_station where del_flag =0
|
||||
</select>
|
||||
|
||||
<select id="abnormalStation" resultType="int">
|
||||
select IFNULL(count(inspection_id),0) from xhpc_inspection where data_time=#{time} and status=2
|
||||
select count(inspection_id) from xhpc_inspection where data_time=#{time} and status=2
|
||||
group by charging_station_id,data_time
|
||||
</select>
|
||||
|
||||
@ -381,12 +381,12 @@
|
||||
|
||||
<select id="emptyOrderRate" resultType="int">
|
||||
select IFNULL(count(*),0) from xhpc_history_order where DATE_FORMAT(end_time, '%Y-%m-%d') = #{time}
|
||||
and (xh.total_price=0
|
||||
or xh.stop_reason_evcs ='40'
|
||||
or xh.stop_reason_evcs ='41'
|
||||
or xh.stop_reason_evcs ='6E'
|
||||
or xh.stop_reason_evcs ='4E'
|
||||
or xh.stop_reason_evcs ='199')
|
||||
and (total_price=0
|
||||
or stop_reason_evcs ='40'
|
||||
or stop_reason_evcs ='41'
|
||||
or stop_reason_evcs ='6E'
|
||||
or stop_reason_evcs ='4E'
|
||||
or stop_reason_evcs ='199')
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user