统计篮球订单收益
This commit is contained in:
@@ -42,6 +42,18 @@ public class MemberEnterVeneuLogController extends OmsController {
|
||||
.setPagination(memberEnterVeneuLogService.findPage(pagination, starTime, endTime, orderSn, state));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计篮球订单收益
|
||||
*/
|
||||
@RequestMapping(value = "/member/enter/sum/money", method = RequestMethod.GET)
|
||||
public ResponseDTO orderPageSum(
|
||||
@RequestParam(value = "starTime",required = false) String starTime,
|
||||
@RequestParam(value = "endTime",required = false) String endTime,
|
||||
@RequestParam(value = "orderSn",required = false) String orderSn,
|
||||
@RequestParam(value = "state",required = false) Integer state) {
|
||||
return ResponseDTO.ok().addAttribute("orderSumMoney",memberEnterVeneuLogService.orderPageSum(starTime, endTime, orderSn, state));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询篮球进场订单信息
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.sv.dto.api.MemberEnterOrderDTO;
|
||||
import com.sv.entity.BarcodeOrderTime;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -40,4 +41,6 @@ public interface BarcodeOrderTimeMapper {
|
||||
MemberEnterOrderDTO memberOrderEnterDetail(@Param("memberId") Integer memberId,@Param("enterId") Integer enterId);
|
||||
@NoPlatform
|
||||
List<MemberEnterOrderDTO> findAll(@Param("starTime") String starTime,@Param("endTime") String endTime,@Param("orderSn") String orderSn,@Param("state") Integer state);
|
||||
@NoPlatform
|
||||
BigDecimal orderPageSum(@Param("starTime") String starTime,@Param("endTime") String endTime,@Param("orderSn") String orderSn,@Param("state") Integer state);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Service - 篮球进场订单
|
||||
@@ -126,5 +127,22 @@ public class MemberEnterVenueLogService extends BaseServiceImpl {
|
||||
return pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计篮球订单
|
||||
*
|
||||
* @return 汇总收益金额
|
||||
*/
|
||||
|
||||
public BigDecimal orderPageSum(String starTime,
|
||||
String endTime, String orderSn, Integer state) {
|
||||
BigDecimal result = BigDecimal.ZERO;
|
||||
BigDecimal orderPageSum = barcodeOrderTimeMapper.orderPageSum(starTime,
|
||||
endTime, orderSn, state);
|
||||
if (orderPageSum != null) {
|
||||
result = orderPageSum;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -336,4 +336,31 @@
|
||||
order by t.order_start desc
|
||||
</select>
|
||||
|
||||
<select id="orderPageSum" resultType="java.math.BigDecimal">
|
||||
select
|
||||
sum((select IFNULL(sum(ot.price),0) from sv_order ot
|
||||
where ot.member_id = t.member_id and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
|
||||
) - IFNULL(t.sum_pay_money,0)) orderSumMoney
|
||||
from sv_barcode_order_time t
|
||||
where 1=1
|
||||
<if test="state != null and state == 2">
|
||||
AND (t.status = 1 or t.paying = #{state})
|
||||
</if>
|
||||
<if test="state != null and state == 1">
|
||||
AND t.paying = #{state}
|
||||
</if>
|
||||
<if test="state != null and state == 0">
|
||||
AND t.paying = #{state} and t.status = 0
|
||||
</if>
|
||||
<if test="orderSn != ''">
|
||||
AND t.order_sn = #{orderSn}
|
||||
</if>
|
||||
<if test="starTime != ''">
|
||||
AND t.order_start >= #{starTime}
|
||||
</if>
|
||||
<if test="endTime != ''">
|
||||
AND t.order_start <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user