|
@@ -19,38 +19,31 @@
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- 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
|
|
|
+ id,create_time,update_time,bomName,bomNo, order_no,unqualifiedCount,addOrderCount,
|
|
|
+ order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority, produce_status
|
|
|
</sql>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
<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 (select a.*,b.name as bomName,b.no as bomNo,b.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, unqualifiedCount,addOrderCount,d.produce_status
|
|
|
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
|
|
|
+ (select order_product_id,count(1) as unqualifiedCount,count(u.add_order_id) as 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="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>
|
|
|
|