Commit d76a3fc6 authored by hanfeng's avatar hanfeng

修改新闻接口

parent fa363e98
......@@ -9,4 +9,6 @@ public class PageParam {
Integer page;
@ApiModelProperty("每页限制")
Integer limit;
}
......@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde
List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer branchCompanyId);
OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
}
......@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr
List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day);
OrderStatistics monthOrderTotal(Integer companyId);
OrderStatistics monthOrderTotal(@Param("companyId")Integer companyId);
}
......@@ -52,6 +52,11 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
*/
private final Integer TYPE_TOTAL = 4;
/**
* 数据权限
*/
private final Integer DATA_AUTHORITY=1;
@Autowired
private DailyVehicleOrderStatisticsBiz vehicleBiz;
......@@ -77,6 +82,10 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
UserDTO user = userDTOObjectRestResponse.getData();
Integer companyId = user.getCompanyId();
if (DATA_AUTHORITY.equals(user.getDataAll())){
companyId=null;
}
if (TYPE_VEHICLE.equals(type)) {
OrderStatistics vehicle = vehicleBiz.findAll(companyId);
return ObjectRestResponse.succ(vehicle);
......
......@@ -16,33 +16,37 @@
</select>
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
SELECT
IFNULL(sum(gmv),0) as totalGmv
FROM
(
SELECT
ANY_VALUE(id) AS id ,
ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(crt_time) AS crt_time
FROM
daily_members_order_statistics
GROUP BY
one_day,branch_company_id
) m
SELECT
ANY_VALUE(id) AS id ,
ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(crt_time) AS crt_time
FROM
daily_members_order_statistics
GROUP BY
one_day,branch_company_id
) m
WHERE
branch_company_id =#{companyId}
1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv-->
<!-- FROM-->
<!-- daily_members_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{companyId}-->
<!-- and-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')-->
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv-->
<!-- FROM-->
<!-- daily_members_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{companyId}-->
<!-- and-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),interval 1 day),'%Y-%c')-->
<!-- </select>-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -55,31 +55,34 @@
IFNULL(sum(penal_sum) ,0) as totalPenalSum
FROM
(
SELECT
ANY_VALUE(id) AS id,
ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(crt_time) AS crt_time
FROM
daily_travel_order_statistics
GROUP BY
one_day,branch_company_id
) o
SELECT
ANY_VALUE(id) AS id,
ANY_VALUE(branch_company_id) AS branch_company_id,
ANY_VALUE(one_day) AS one_day,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(crt_time) AS crt_time
FROM
daily_travel_order_statistics
GROUP BY
one_day,branch_company_id
) o
WHERE
branch_company_id =#{companyId}
1=1
<if test="companyId != null">
and branch_company_id =#{companyId}
</if>
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
<!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum-->
<!-- FROM-->
<!-- daily_travel_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{branchCompanyId}-->
<!-- AND-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')-->
<!-- </select>-->
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
<!-- IFNULL(sum(penal_sum) ,0) as totalPenalSum-->
<!-- FROM-->
<!-- daily_travel_order_statistics-->
<!-- WHERE-->
<!-- branch_company_id =#{branchCompanyId}-->
<!-- AND-->
<!-- DATE_FORMAT(one_day,'%Y-%c')=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%c')-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -80,6 +80,40 @@
</select>
<!-- 获取赔偿和延期JSON字符串-->
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
1=1
<if test="companyId != null">
and branch_company_id = #{companyId}
</if>
</select>
<!--违章-->
<select id="getCompensationAndPostpone" resultType="HashMap">
SELECT
v.start_company_id AS branchCompanyId,
......@@ -105,7 +139,7 @@
order by v.start_company_id asc
</select>
<!--违章-->
<select id="getViolationMoney" resultType="com.xxfc.platform.order.entity.DailyVehicleOrderStatistics">
SELECT
d.start_company_id AS branchCompanyId,
......@@ -136,37 +170,6 @@
d.start_company_id
</select>
<select id="monthOrderTotal" resultType="com.xxfc.platform.order.entity.OrderStatistics">
SELECT
IFNULL(sum(gmv),0) as totalGmv,
(IFNULL(sum(security_deposit),0)-IFNULL(sum(refund_security_deposit) ,0)) as totalSecurityDeposit,
IFNULL(sum(refund_security_deposit) ,0) as totalRefundSecurityDeposit,
IFNULL(sum(compensation) ,0) as totalCompensation,
IFNULL(sum(forfeit) ,0) as totalForfeit,
IFNULL(sum(penal_sum) ,0) as totalPenalSum,
IFNULL(sum(postpone) ,0) as totalPostpone
FROM
(
SELECT
ANY_VALUE(id) as id,
one_day,
branch_company_id,
ANY_VALUE(gmv) AS gmv,
ANY_VALUE(security_deposit) AS security_deposit,
ANY_VALUE(refund_security_deposit) AS refund_security_deposit,
ANY_VALUE(forfeit) AS forfeit,ANY_VALUE(penal_sum) AS penal_sum,
ANY_VALUE(postpone) AS postpone,ANY_VALUE(crt_time) AS crt_time,
ANY_VALUE(compensation) AS compensation
FROM
daily_vehicle_order_statistics
GROUP BY
one_day,branch_company_id
) a
WHERE
branch_company_id = #{companyId}
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
<!-- IFNULL(sum(gmv),0) as totalGmv,-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment