| | |
| | | and ins_fibers_id is null |
| | | and <!--isa.sample_code NOT REGEXP '/'--> |
| | | isa.id in(select id1 from (select is2.id id1 ,ip.id from ins_sample is2 left join ins_product ip on is2.id = ip.ins_sample_id where ip.id is not null)s ) |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | <select id="getInsOrderAndSample" resultMap="sampleDto"> |
| | | select isa.*, |
| | |
| | | where ins_order_id = #{id} |
| | | and ip.standard_method_list_id is not null |
| | | and state = 1 |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | |
| | | <select id="selectSampleProductListByOrderId3" resultMap="sampleDto3"> |
| | |
| | | <foreach collection="ids" open="(" close=")" item="id" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | |
| | | <select id="getInsProduct1" resultMap="product"> |