| | |
| | | GROUP BY io.id,type |
| | | order by type desc,io.id desc |
| | | </select> |
| | | |
| | | <!-- 查询当前时间是否有该检测项的抽样计划订单 --> |
| | | <select id="selectNotSpotCheckOrder" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from (select io.id |
| | | from ins_product ip |
| | | left join ins_sample is2 on is2.id = ip.ins_sample_id |
| | | left join ins_order io on io.id = is2.ins_order_id |
| | | left join spot_check_quarter_item scqi on scqi.quarter_item_id = io.quarter_item_id |
| | | where io.quarter_item_id is not null |
| | | and scqi.spot_check_time between #{startTime} and #{endTime} |
| | | and ip.structure_item_parameter_id = #{itmeId} |
| | | group by io.id) a |
| | | </select> |
| | | </mapper> |