order count

This commit is contained in:
sxu 2023-12-07 13:53:04 +08:00
parent 9e511829f7
commit 70e4fbd84a
5 changed files with 27 additions and 0 deletions

View File

@ -143,4 +143,16 @@ public class OrderInfoController extends BaseController
{ {
return toAjax(orderInfoService.deleteOrderInfoByOrderIds(orderIds)); return toAjax(orderInfoService.deleteOrderInfoByOrderIds(orderIds));
} }
/**
* 获取订单统计信息
*/
@ApiOperation(value = "订单统计")
@RequiresPermissions("order:info:query")
@GetMapping(value = "/count")
public AjaxResult count()
{
long count = orderInfoService.count();
return success(count);
}
} }

View File

@ -65,4 +65,6 @@ public interface OrderInfoMapper
public int deleteOrderInfoByOrderIds(Long[] orderIds); public int deleteOrderInfoByOrderIds(Long[] orderIds);
public Long selectLastInsertId(); public Long selectLastInsertId();
public long count(Long userId);
} }

View File

@ -59,4 +59,6 @@ public interface IOrderInfoService
* @return 结果 * @return 结果
*/ */
public int deleteOrderInfoByOrderId(Long orderId); public int deleteOrderInfoByOrderId(Long orderId);
public long count();
} }

View File

@ -118,4 +118,11 @@ public class OrderInfoServiceImpl implements IOrderInfoService
{ {
return orderInfoMapper.deleteOrderInfoByOrderId(orderId); return orderInfoMapper.deleteOrderInfoByOrderId(orderId);
} }
@Override
public long count()
{
LoginUser user = SecurityUtils.getLoginUser();
return orderInfoMapper.count(user.getUserid());
}
} }

View File

@ -192,4 +192,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectLastInsertId" resultType="Long"> <select id="selectLastInsertId" resultType="Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</select> </select>
<select id="count" parameterType="Long" resultType="Long">
SELECT count(*) from ma_order_info where orderUser = #{userId}
</select>
</mapper> </mapper>