| | |
| | | <result column="first_length" property="width"/> |
| | | <result column="second_Length" property="height"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="lack_cout" property="lackCount"/> |
| | | <result column="lack_count" property="lackCount"/> |
| | | <result column="damage_count" property="damageCount"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap"> |
| | |
| | | where flow_card_id = #{flowCardId} |
| | | and tempering_layout_id is null |
| | | and tempering_feed_sequence is null |
| | | ) |
| | | select flow_card_id, |
| | | layer, |
| | | order_sort, |
| | | first_length, |
| | | films_id, |
| | | second_Length, |
| | | thickness, |
| | | count(*) as lack_cout |
| | | from relation_length |
| | | group by flow_card_id, layer, order_sort, films_id, first_length, second_Length, thickness |
| | | ), |
| | | lack_count_temp as ( |
| | | select flow_card_id, |
| | | layer, |
| | | order_sort, |
| | | first_length, |
| | | films_id, |
| | | second_Length, |
| | | thickness, |
| | | count(*) as lack_count |
| | | from relation_length |
| | | group by flow_card_id, layer, order_sort, films_id, first_length, second_Length, thickness |
| | | ), |
| | | damage_count_temp as ( |
| | | select process_id as flow_card_id, |
| | | technology_number as layer, |
| | | order_number as order_sort, |
| | | count(1) as damage_count |
| | | from damage |
| | | where process_id = #{flowCardId} |
| | | group by process_id, technology_number, order_number |
| | | ), |
| | | result_count as ( |
| | | select t.*, IFNULL(t1.damage_count, 0) damage_count |
| | | from lack_count_temp t |
| | | left join damage_count_temp t1 on t.flow_card_id = t1.flow_card_id and t.layer = t1.layer and |
| | | t.order_sort = t1.order_sort |
| | | ) |
| | | select * |
| | | from result_count |
| | | </select> |
| | | <select id="queryLayerByFlowCardId" resultType="java.lang.Integer"> |
| | | select count(distinct layer) |