|
@@ -19,22 +19,39 @@
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- id,create_time,update_time,
|
|
|
- order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority
|
|
|
+ id,create_time,update_time,bomName,order_no,unqualifiedCount,addOrderCount,
|
|
|
+ order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority,produceStatus
|
|
|
</sql>
|
|
|
|
|
|
- <select id="getList" parameterType="com.github.zuihou.business.operationManagementCenter.entity.OrderProduct" resultType="com.github.zuihou.business.operationManagementCenter.entity.OrderProduct">
|
|
|
- select a.*,b.name,b.no as bomNo,b.specifications as specifications,b.model,b.brand,ifnull(c.planNum,0) as planNum,
|
|
|
- (ifnull(a.bom_num,0)-ifnull(c.planNum,0)) as stayPlanNum,d.delivery_time as orderDeliveryTime from imcs_o_order_product a
|
|
|
+ <!-- 分页 -->
|
|
|
+ <select id="pageList" parameterType="String" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from (select a.*,b.name bomName,b.no as bomNo,b.specifications as specifications,b.model,b.brand,ifnull(c.planNum,0) as planNum,
|
|
|
+ (ifnull(a.bom_num,0)-ifnull(c.planNum,0)) as stayPlanNum,d.delivery_time as orderDeliveryTime,d.order_no orderNo,unqualifiedCount,addOrderCount,d.produce_status produceStatus
|
|
|
+ from imcs_o_order_product a
|
|
|
left join imcs_b_bom b on a.bom_id = b.id
|
|
|
left join (
|
|
|
select order_product_id,count(1) as planNum from imcs_p_plan_product where 1=1 group by order_product_id
|
|
|
)c on a.id= c.order_product_id
|
|
|
left join imcs_o_order d on a.order_id = d.id
|
|
|
+
|
|
|
+ LEFT JOIN
|
|
|
+ (select order_product_id,count(1) unqualifiedCount,count(u.add_order_id)addOrderCount from
|
|
|
+ imcs_t_task_test_unqualified_bom u
|
|
|
+ GROUP BY u.order_product_id
|
|
|
+ )e on a.id = e.order_product_id
|
|
|
where 1=1
|
|
|
- <if test="orderId != '' and orderId != null " >
|
|
|
- and a.order_id = #{orderId}
|
|
|
- </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ and d.order_no like concat('%', #{orderNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="produceStatus != null and produceStatus != ''">
|
|
|
+ and d.produce_Status = #{produceStatus}
|
|
|
+ </if>
|
|
|
+ <if test="bomName != null and bomName != ''">
|
|
|
+ and b.name like concat('%', #{bomName}, '%')
|
|
|
+ </if>
|
|
|
+ ) s ${ew.customSqlSegment}
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|