From a680563f53b7b5db7507dd0ff6027f724567ea2b Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期四, 20 六月 2024 11:21:27 +0800
Subject: [PATCH] 标准库支持无型号
---
inspect-server/src/main/resources/mapper/InsSampleMapper.xml | 280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 271 insertions(+), 9 deletions(-)
diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
index 1e5bee5..3d0ac72 100644
--- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -16,7 +16,6 @@
<result property="sampleType" column="sample_type" jdbcType="VARCHAR"/>
<result property="sample" column="sample" jdbcType="VARCHAR"/>
<result property="model" column="model" jdbcType="VARCHAR"/>
- <result property="isLeave" column="is_leave" jdbcType="INTEGER"/>
<result property="insState" column="ins_state" jdbcType="INTEGER"/>
<result property="joinNum" column="join_num" jdbcType="INTEGER"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
@@ -29,7 +28,7 @@
<select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO">
select * from(
SELECT
- a.*,ios.ins_state,ios.verify_tell
+ a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user
FROM
(
SELECT
@@ -41,7 +40,7 @@
io.sample_type,
isu.user_id,
ip.son_laboratory,
- io.ins_result
+ io.ins_time
FROM
ins_order io
LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
@@ -49,7 +48,7 @@
LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id
WHERE
io.state = 1
- AND io.ins_state != 5
+# AND io.ins_state != 5
and send_time is not null
and (isu.user_id = #{userId} OR isu.user_id is NULL)
GROUP BY
@@ -57,6 +56,49 @@
io.id
) a
LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
+ left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id
+ ORDER BY
+ a.user_id DESC,
+ a.type DESC,
+ a.id
+ ) b
+ <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
+ ${ew.customSqlSegment}
+ </if>
+ </select>
+
+ <select id="inspectionOrderDetailsTaskSwitching" resultType="com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo">
+ select * from(
+ SELECT
+ a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user
+ FROM
+ (
+ SELECT
+ io.id,
+ io.entrust_code,
+ io.type,
+ io.appointed,
+ io.send_time,
+ io.sample_type,
+ isu.user_id,
+ ip.son_laboratory,
+ io.ins_time
+ FROM
+ ins_order io
+ LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
+ LEFT JOIN ( SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id ) isu ON isu.ins_sample_id = io.id
+ LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id
+ WHERE
+ io.state = 1
+ # AND io.ins_state != 5
+ and send_time is not null
+ and (isu.user_id = #{userId} OR isu.user_id is NULL)
+ GROUP BY
+ ip.son_laboratory,
+ io.id
+ ) a
+ LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
+ left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id
ORDER BY
a.user_id DESC,
a.type DESC,
@@ -71,8 +113,11 @@
select isa.*,
ip.id ip_id,
inspection_item,
- inspection_item_classify,
+ inspection_item_en,
+ inspection_item_class,
+ inspection_item_class_en,
inspection_item_subclass,
+ inspection_item_subclass_en,
ip.factory ip_factory,
ip.laboratory ip_laboratory,
ip.sample_type ip_sample_type,
@@ -111,13 +156,18 @@
left join ins_product_result ipr on ip.id = ipr.ins_product_id
where ins_order_id = #{id}
and state = 1
+ and ins_fiber_id is null
+ and ins_fibers_id is null
</select>
<select id="getInsOrderAndSample" resultMap="sampleDto">
select isa.*,
ip.id ip_id,
inspection_item,
- inspection_item_classify,
+ inspection_item_en,
+ inspection_item_class,
+ inspection_item_class_en,
inspection_item_subclass,
+ inspection_item_subclass_en,
ip.factory ip_factory,
ip.laboratory ip_laboratory,
ip.sample_type ip_sample_type,
@@ -150,13 +200,220 @@
ipr.ins_value,
ipr.com_value,
ipr.equip_value,
- ip.method_s
+ ipr.equip_name,
+ ip.method_s,
+ ip.tell,
+ ip.dic
from ins_sample isa
left join ins_product ip on isa.id = ip.ins_sample_id
left join ins_product_result ipr on ip.id = ipr.ins_product_id
where ins_order_id = #{id}
and state = 1
and ip.son_laboratory = #{laboratory}
+ and ins_fiber_id is null
+ and ins_fibers_id is null
+ </select>
+ <select id="getSampleEn" resultType="java.lang.String">
+ select name_en from `center-lims`.product
+ where name = #{sample}
+ </select>
+ <select id="selectSampleProductListByOrderId2" resultMap="sampleDto">
+ select isa.*,
+ ip.id ip_id,
+ inspection_item,
+ inspection_item_en,
+ inspection_item_subclass,
+ inspection_item_subclass_en,
+ inspection_item_class,
+ inspection_item_class_en,
+ ip.factory ip_factory,
+ ip.laboratory ip_laboratory,
+ ip.sample_type ip_sample_type,
+ ip.sample ip_sample,
+ ip.model ip_model,
+ son_laboratory,
+ ip.unit ip_unit,
+ price,
+ man_hour,
+ man_hour_group,
+ inspection_item_type,
+ inspection_value_type,
+ device_group,
+ checkout_number,
+ section,
+ value_type,
+ method,
+ man_day,
+ bsm,
+ ask,
+ `last_value`,
+ ip.ins_result ip_ins_result,
+ state,
+ ins_sample_id,
+ ip.create_user ip_create_user,
+ ip.update_user ip_update_user,
+ ip.create_time ip_create_time,
+ ip.update_time ip_update_time,
+ template_id,
+ ipr.ins_value,
+ ipr.com_value,
+ ipr.equip_value,
+ ip.method_s
+ from ins_sample isa
+ left join ins_product ip on isa.id = ip.ins_sample_id
+ left join ins_product_result ipr on ip.id = ipr.ins_product_id
+ where ins_order_id = #{id}
+ and state = 1
+ </select>
+ <select id="getInsProduct1" resultMap="product">
+ select ip.id ip_id,
+ inspection_item,
+ inspection_item_en,
+ inspection_item_subclass,
+ inspection_item_subclass_en,
+ ip.factory ip_factory,
+ ip.laboratory ip_laboratory,
+ ip.sample_type ip_sample_type,
+ ip.sample ip_sample,
+ ip.model ip_model,
+ son_laboratory,
+ ip.unit ip_unit,
+ price,
+ man_hour,
+ man_hour_group,
+ inspection_item_type,
+ inspection_value_type,
+ device_group,
+ checkout_number,
+ section,
+ value_type,
+ method,
+ man_day,
+ bsm,
+ ask,
+ `last_value`,
+ ip.ins_result ip_ins_result,
+ state,
+ ins_sample_id,
+ ip.create_user ip_create_user,
+ ip.update_user ip_update_user,
+ ip.create_time ip_create_time,
+ ip.update_time ip_update_time,
+ template_id,
+ ipr.ins_value,
+ ipr.com_value,
+ ipr.equip_value,
+ ipr.equip_name,
+ ip.method_s,
+ ip.tell,
+ ip.dic
+ from ins_product ip
+ left join ins_product_result ipr on ip.id = ipr.ins_product_id
+ where ins_sample_id = #{id}
+ and state = 1
+ and ip.son_laboratory = #{laboratory}
+ and ins_fiber_id is null
+ and ins_fibers_id is null
+ </select>
+ <select id="getInsProduct2" resultMap="product">
+ select ip.id ip_id,
+ inspection_item,
+ inspection_item_en,
+ inspection_item_class,
+ inspection_item_class_en,
+ inspection_item_subclass,
+ inspection_item_subclass_en,
+ ip.factory ip_factory,
+ ip.laboratory ip_laboratory,
+ ip.sample_type ip_sample_type,
+ ip.sample ip_sample,
+ ip.model ip_model,
+ son_laboratory,
+ ip.unit ip_unit,
+ price,
+ man_hour,
+ man_hour_group,
+ inspection_item_type,
+ inspection_value_type,
+ device_group,
+ checkout_number,
+ section,
+ value_type,
+ method,
+ man_day,
+ bsm,
+ ask,
+ `last_value`,
+ ip.ins_result ip_ins_result,
+ state,
+ ins_sample_id,
+ ip.create_user ip_create_user,
+ ip.update_user ip_update_user,
+ ip.create_time ip_create_time,
+ ip.update_time ip_update_time,
+ template_id,
+ ipr.ins_value,
+ ipr.com_value,
+ ipr.equip_value,
+ ipr.equip_name,
+ ip.method_s,
+ ip.tell,
+ ip.dic
+ from ins_product ip
+ left join ins_product_result ipr on ip.id = ipr.ins_product_id
+ where ins_fibers_id = #{id}
+ and state = 1
+ and ins_fiber_id is null
+ </select>
+ <select id="getInsProduct3" resultMap="product">
+ select ip.id ip_id,
+ inspection_item,
+ inspection_item_en,
+ inspection_item_class,
+ inspection_item_class_en,
+ inspection_item_subclass,
+ inspection_item_subclass_en,
+ ip.factory ip_factory,
+ ip.laboratory ip_laboratory,
+ ip.sample_type ip_sample_type,
+ ip.sample ip_sample,
+ ip.model ip_model,
+ son_laboratory,
+ ip.unit ip_unit,
+ price,
+ man_hour,
+ man_hour_group,
+ inspection_item_type,
+ inspection_value_type,
+ device_group,
+ checkout_number,
+ section,
+ value_type,
+ method,
+ man_day,
+ bsm,
+ ask,
+ `last_value`,
+ ip.ins_result ip_ins_result,
+ state,
+ ins_sample_id,
+ ip.create_user ip_create_user,
+ ip.update_user ip_update_user,
+ ip.create_time ip_create_time,
+ ip.update_time ip_update_time,
+ template_id,
+ ipr.ins_value,
+ ipr.com_value,
+ ipr.equip_value,
+ ipr.equip_name,
+ ip.method_s,
+ ip.tell,
+ ip.dic
+ from ins_product ip
+ left join ins_product_result ipr on ip.id = ipr.ins_product_id
+ where ins_fiber_id = #{id}
+ and state = 1
+ and ins_fibers_id is null
</select>
<resultMap id="sampleDto" type="com.yuanchu.mom.dto.SampleProductDto">
@@ -171,7 +428,6 @@
<result property="sampleType" column="sample_type" jdbcType="VARCHAR"/>
<result property="sample" column="sample" jdbcType="VARCHAR"/>
<result property="model" column="model" jdbcType="VARCHAR"/>
- <result property="isLeave" column="is_leave" jdbcType="INTEGER"/>
<result property="insState" column="ins_state" jdbcType="INTEGER"/>
<result property="joinNum" column="join_num" jdbcType="INTEGER"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
@@ -187,8 +443,11 @@
<resultMap id="product" type="com.yuanchu.mom.pojo.InsProduct">
<id property="id" column="ip_id" jdbcType="INTEGER"/>
<result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/>
- <result property="inspectionItemClassify" column="inspection_item_classify" jdbcType="VARCHAR"/>
+ <result property="inspectionItemEn" column="inspection_item_en" jdbcType="VARCHAR"/>
<result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/>
+ <result property="inspectionItemSubclassEn" column="inspection_item_subclass_en" jdbcType="VARCHAR"/>
+ <result property="inspectionItemClass" column="inspection_item_class" jdbcType="VARCHAR"/>
+ <result property="inspectionItemClassEn" column="inspection_item_class_en" jdbcType="VARCHAR"/>
<result property="factory" column="ip_factory" jdbcType="VARCHAR"/>
<result property="laboratory" column="ip_laboratory" jdbcType="VARCHAR"/>
<result property="sampleType" column="ip_sample_type" jdbcType="VARCHAR"/>
@@ -219,6 +478,8 @@
<result property="updateTime" column="ip_update_time" jdbcType="TIMESTAMP"/>
<result property="templateId" column="template_id" jdbcType="INTEGER"/>
<result property="methodS" column="method_s"/>
+ <result property="tell" column="tell"/>
+ <result property="dic" column="dic"/>
<collection property="insProductResult" resultMap="insProductResult"/>
</resultMap>
@@ -226,5 +487,6 @@
<result property="insValue" column="ins_value" jdbcType="VARCHAR"/>
<result property="comValue" column="com_value" jdbcType="VARCHAR"/>
<result property="equipValue" column="equip_value" jdbcType="VARCHAR"/>
+ <result property="equipName" column="equip_name" jdbcType="VARBINARY"/>
</resultMap>
</mapper>
--
Gitblit v1.9.3