| | |
| | | <association property="children" resultMap="SampleDefectsChildrenMap" javaType="java.util.List"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectInsOrderPage" resultType="com.yuanchu.mom.dto.SampleOrderDto"> |
| | | select * |
| | | from ( |
| | | SELECT |
| | | io.*, |
| | | ir.id report_id, |
| | | ir.url, |
| | | ir.url_s, |
| | | (select count(*) from ins_sample isa2 |
| | | where isa2.ins_order_id = io.id and isa2.sample_code NOT REGEXP '/') sample_num, |
| | | concat(ROUND((select count(*) from ins_product ip |
| | | where state = 1 and ins_result is not null and ip.ins_sample_id in (select id from ins_sample where |
| | | ins_sample.ins_order_id= io.id )) / (select count(*) from ins_product ip2 |
| | | where state = 1 and ip2.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) * |
| | | 100, 2), '%') insProgress, |
| | | group_concat(distinct isa.sample_code,' ') sample_code, |
| | | group_concat(distinct isa.sample,' ') sample_name, |
| | | group_concat(distinct isa.model,' ') sample_model, |
| | | u.name |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON io.id = isa.ins_order_id |
| | | LEFT JOIN ( SELECT id, ins_order_id, is_ratify, url,url_s FROM ins_report WHERE is_ratify = 1 ) ir ON io.id = |
| | | ir.ins_order_id |
| | | left join user u on io.create_user = u.id |
| | | where 1=1 |
| | | <if test="laboratory!=null and laboratory!=''"> |
| | | and io.laboratory=#{laboratory} |
| | | </if> |
| | | GROUP BY |
| | | io.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <resultMap id="SampleDefectsChildrenMap" type="com.yuanchu.mom.vo.SampleDefectsChildrenVo"> |
| | | <result column="entrust_code" property="entrust_code"/> |
| | | <result column="inspection_item" property="inspection_item"/> |
| | |
| | | create_time, |
| | | state |
| | | from ins_order |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectInsOrderPage" resultType="com.yuanchu.mom.dto.SampleOrderDto"> |
| | | select * |
| | | from ( |
| | | SELECT |
| | | io.*, |
| | | ir.id report_id, |
| | | ir.url, |
| | | ir.url_s, |
| | | (select count(*) from ins_sample isa2 |
| | | where isa2.ins_order_id = io.id and isa2.sample_code NOT REGEXP '/') sample_num, |
| | | concat(ROUND((select count(*) from ins_product ip |
| | | where state = 1 and ins_result is not null and ip.ins_sample_id in (select id from ins_sample where |
| | | ins_sample.ins_order_id= io.id )) / (select count(*) from ins_product ip2 |
| | | where state = 1 and ip2.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) * |
| | | 100, 2), '%') insProgress, |
| | | group_concat(distinct isa.sample_code,' ') sample_code, |
| | | group_concat(distinct isa.sample,' ') sample_name, |
| | | group_concat(distinct isa.model,' ') sample_model, |
| | | u.name |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON io.id = isa.ins_order_id |
| | | LEFT JOIN ( SELECT id, ins_order_id, is_ratify, url,url_s FROM ins_report WHERE is_ratify = 1 ) ir ON io.id = |
| | | ir.ins_order_id |
| | | left join user u on io.create_user = u.id |
| | | GROUP BY |
| | | io.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | |
| | | </where> |
| | | </update> |
| | | <update id="updateStatus"> |
| | | update ins_order set state=3 where id=#{id} |
| | | update ins_order |
| | | set state=3 |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectSampleDefects" resultMap="selectSampleDefectsMap"> |
| | |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="seldepLimsId" resultType="java.lang.String"> |
| | | select name |
| | | from department_lims |
| | | where id = #{depLimsId} |
| | | </select> |
| | | </mapper> |