| | |
| | | <result property="previousProcess" column="previous_process"/> |
| | | <result property="nextProcess" column="next_process"/> |
| | | <result property="thisProcess" column="this_process"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="previousProcessQuantity" column="previous_process_quantity"/> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | | <result property="customerName" column="customer_name"/> |
| | |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | <result property="quantity" column="quantity"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | |
| | | o.customer_id, |
| | | o.customer_name, |
| | | o.project, |
| | | SUM(fc.quantity) as quantity, |
| | | SUM(fc.quantity) as previous_process_quantity, |
| | | #{previousProcess} as previous_process, |
| | | #{nextProcess} as next_process, |
| | | #{process} as this_process |
| | | #{process} as this_process, |
| | | ifnull((rw.reviewed_state),1) as reviewed_state -- 下工序审核状态 |
| | | from sd.order as o |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join (select if(count(reviewed_state)>0 and process_id=null,1,0) as reviewed_state , |
| | | process_id |
| | | from reporting_work |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}) as rw |
| | | on rw.process_id = fc.process_id |
| | | where fc.process_id = #{processIdStr} |
| | | and position(fc.technology_number in #{technologyStr}) |
| | | and fc.technology_number = #{technologyStr} |
| | | GROUP BY fc.process_id |
| | | </select> |
| | | |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group` |
| | | |
| | | |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | <if test="process == '夹胶'"> |
| | | AND ogd.`group` = (select `group` |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | | and order_number = ogd.order_number |
| | | and technology_number =#{technologyStr} |
| | | limit 1) |
| | | </if> |
| | | |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id=ogd.production_id |
| | |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装'"> |
| | | AND fc.technology_number = #{technologyStr} |
| | | </if> |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |