order count
This commit is contained in:
parent
9e511829f7
commit
70e4fbd84a
|
|
@ -143,4 +143,16 @@ public class OrderInfoController extends BaseController
|
|||
{
|
||||
return toAjax(orderInfoService.deleteOrderInfoByOrderIds(orderIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单统计信息
|
||||
*/
|
||||
@ApiOperation(value = "订单统计")
|
||||
@RequiresPermissions("order:info:query")
|
||||
@GetMapping(value = "/count")
|
||||
public AjaxResult count()
|
||||
{
|
||||
long count = orderInfoService.count();
|
||||
return success(count);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@ public interface OrderInfoMapper
|
|||
public int deleteOrderInfoByOrderIds(Long[] orderIds);
|
||||
|
||||
public Long selectLastInsertId();
|
||||
|
||||
public long count(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,6 @@ public interface IOrderInfoService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInfoByOrderId(Long orderId);
|
||||
|
||||
public long count();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,4 +118,11 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
{
|
||||
return orderInfoMapper.deleteOrderInfoByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long count()
|
||||
{
|
||||
LoginUser user = SecurityUtils.getLoginUser();
|
||||
return orderInfoMapper.count(user.getUserid());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,4 +192,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectLastInsertId" resultType="Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</select>
|
||||
|
||||
<select id="count" parameterType="Long" resultType="Long">
|
||||
SELECT count(*) from ma_order_info where orderUser = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue