feat(sales): 为销售报表添加订单明细查询功能
- 在 CrmOrderItemMapper 中添加根据订单ID列表查询订单明细的方法 - 实现 MyBatis 查询语句支持批量订单ID查询订单明细 - 修改销售报表服务类注入 CrmOrderItemMapper 依赖 - 扩展销售报表查询逻辑以包含订单明细数据 - 在销售报表 VO 中添加订单明细列表字段 - 使用流式处理和分组收集优化订单明细关联逻辑
This commit is contained in:
@@ -19,6 +19,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
<!-- 根据订单ID列表查询订单明细 -->
|
||||
<select id="selectOrderItemsByOrderIds" resultMap="CrmOrderItemResult">
|
||||
SELECT
|
||||
item_id,
|
||||
order_id,
|
||||
product_type,
|
||||
spec_require,
|
||||
product_num,
|
||||
special_require,
|
||||
item_amount,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag
|
||||
FROM crm_order_item
|
||||
WHERE del_flag = 0
|
||||
AND order_id IN
|
||||
<foreach collection="orderIds" item="orderId" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
ORDER BY item_id ASC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user