| | |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id) isu ON isu.ins_sample_id = io.id |
| | | where (io.ifs_inventory_id IS NULL OR TRIM(io.ifs_inventory_id) = '') |
| | | <if test="isOrderAll != null and isOrderAll != ''"> |
| | | <if test="otherParam.isOrderAll != null and otherParam.isOrderAll != ''"> |
| | | AND io.state in (1, 4) |
| | | </if> |
| | | <if test="laboratory!=null and laboratory!=''"> |
| | | AND io.laboratory=#{laboratory} |
| | | <if test="otherParam.laboratory!=null and otherParam.laboratory!=''"> |
| | | AND io.laboratory=#{otherParam.laboratory} |
| | | </if> |
| | | <if test="otherParam.checkUserFlag != null and otherParam.checkUserFlag and otherParam.checkUserId != null "> |
| | | AND io.id IN ( |
| | | SELECT DISTINCT |
| | | ins_sample_id AS orderId |
| | | FROM |
| | | ins_sample_user |
| | | WHERE |
| | | user_id = #{otherParam.checkUserId} UNION |
| | | SELECT |
| | | T2.ins_order_id AS orderId |
| | | FROM |
| | | ins_product T1 |
| | | JOIN ins_sample T2 ON T1.ins_sample_id = T2.id |
| | | WHERE |
| | | T1.check_user_id = #{otherParam.checkUserId} |
| | | ) |
| | | </if> |
| | | GROUP BY io.id,type |
| | | order by type desc,io.id desc |
| | |
| | | i.order_type, |
| | | ip.sort, |
| | | ip.cable_tag, |
| | | ip.radius |
| | | ip.radius, |
| | | ip.check_user_id, |
| | | ur.name AS checkUserName |
| | | from ins_sample isa |
| | | left join ins_order i on isa.ins_order_id = i.id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join user ur on ip.check_user_id = ur.id |
| | | where ip.state = 1 |
| | | and i.id=#{id} |
| | | and ip.is_binding != 1 |