|  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("订单状态数量") | 
 |  |  |     @PostMapping(value = "/jhy/order/orderStatusCnt") | 
 |  |  |     public JsonResult<Map<Integer, Integer>> orderStatusCnt(HttpServletRequest request) { | 
 |  |  |         return JsonResult.success(jhyOrderService.orderStatusCount(getUserId(request))); | 
 |  |  |     @PostMapping(value = "/jhy/order/orderStatusCnt/{type}") | 
 |  |  |     public JsonResult<Map<Integer, Integer>> orderStatusCnt(@PathVariable("type") Integer type, HttpServletRequest request) { | 
 |  |  |         return JsonResult.success(jhyOrderService.orderStatusCount(type, getUserId(request))); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     List<JhyOrderListVo> selectJhyOrderList(@Param("record") JhyOrderListDto jhyOrderListDto); | 
 |  |  |  | 
 |  |  |     List<JhyStatusCountVo> selectOrderStatusCount(@Param("userId") String userId); | 
 |  |  |     List<JhyStatusCountVo> selectOrderStatusCount(@Param("type") Integer type, @Param("userId") String userId); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         distribService.distribRecord(order.getId(), order.getUserId()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Map<Integer, Integer> orderStatusCount(String userId) { | 
 |  |  |         List<JhyStatusCountVo> count = jhyOrderMapper.selectOrderStatusCount(userId); | 
 |  |  |     public Map<Integer, Integer> orderStatusCount(Integer type, String userId) { | 
 |  |  |         List<JhyStatusCountVo> count = jhyOrderMapper.selectOrderStatusCount(type, userId); | 
 |  |  |  | 
 |  |  |         Map<Integer, Integer> map = new HashMap<>(); | 
 |  |  |         for (int i = 1; i < 6; i++) { | 
 
 |  |  | 
 |  |  |         select | 
 |  |  |            status, | 
 |  |  |            count(1) cnt | 
 |  |  |         from xzx_jhy_order where status=1 | 
 |  |  |         from xzx_jhy_order | 
 |  |  |         <where> | 
 |  |  |             status=1 | 
 |  |  |             <if test="type == 2"> | 
 |  |  |                 and user_id=#{userId} | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |         group by status | 
 |  |  |         union  all | 
 |  |  |         select | 
 |  |  |            status, | 
 |  |  |            count(1) cnt | 
 |  |  |         from xzx_jhy_order | 
 |  |  |         where user_id=#{userId} | 
 |  |  |         <where> | 
 |  |  |             <if test="type == 1"> | 
 |  |  |                 and jhy_id=#{userId} | 
 |  |  |             </if> | 
 |  |  |             <if test="type == 2" > | 
 |  |  |                 and user_id=#{userId} | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |         group by status | 
 |  |  |     </select> | 
 |  |  | </mapper> |