From 54d7eb1bc5f141b2f7ac6d9dbf85086efa54f81c Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期二, 23 七月 2024 17:26:50 +0800 Subject: [PATCH] 温度循环调整 --- inspect-server/src/main/resources/mapper/InsSampleMapper.xml | 133 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 125 insertions(+), 8 deletions(-) diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml index c5e2571..6686c39 100644 --- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml +++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml @@ -27,7 +27,7 @@ <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> select * from(select * from( SELECT - a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user + a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,<!--(ios.verify_user = #{userId})--> verify_user FROM ( SELECT @@ -38,28 +38,49 @@ io.send_time, group_concat(distinct isa.sample,' ') sample, isu.user_id, + user.name userName, 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 ( <!--SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id --> + SELECT * + FROM ins_sample_user u + WHERE son_laboratory=#{sonLaboratory} and (ins_sample_id, id) IN ( + SELECT ins_sample_id, MAX(id) + FROM ins_sample_user + WHERE son_laboratory=#{sonLaboratory} + GROUP BY ins_sample_id + ) + ORDER BY ins_sample_id, id + ) isu ON isu.ins_sample_id = io.id LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id + LEFT JOIN user ON isu.user_id = user.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) + <if test="userId !=null and userId!=''"> + and (isu.user_id = #{userId} OR isu.user_id is NULL ) + </if> + 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 + ins_sample_user where son_laboratory=#{sonLaboratory} GROUP BY ins_sample_id) md where td.id = md.id + <if test="userId !=null and userId!=''"> + and user_id = #{userId} OR user_id is NULL + </if> + OR user_id is NULL + ) isu2 on isu2.ins_sample_id = a.id ORDER BY - a.user_id DESC, + <!--a.user_id DESC,--> a.type DESC, a.id ) b @@ -72,8 +93,8 @@ <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 + a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,<!--(ios.verify_user = #{userId})--> verify_user + <!--FROM ( SELECT io.id, @@ -107,7 +128,64 @@ a.user_id DESC, a.type DESC, a.id + ) b--> + FROM + ( + SELECT + io.id, + io.entrust_code, + io.type, + io.appointed, + io.send_time, + group_concat(distinct isa.sample,' ') sample, + isu.user_id, + user.name userName, + 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 --> + SELECT * + FROM ins_sample_user u + WHERE son_laboratory=#{sonLaboratory} and (ins_sample_id, id) IN ( + SELECT ins_sample_id, MAX(id) + FROM ins_sample_user + WHERE son_laboratory=#{sonLaboratory} + GROUP BY ins_sample_id + ) + ORDER BY ins_sample_id, id + ) isu ON isu.ins_sample_id = io.id + LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id + LEFT JOIN user ON isu.user_id = user.id + WHERE + io.state = 1 + # AND io.ins_state != 5 + and send_time is not null + <if test="userId !=null and userId!=''"> + and (isu.user_id = #{userId} OR isu.user_id is NULL ) + </if> + 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 where son_laboratory=#{sonLaboratory} GROUP BY ins_sample_id) md where td.id = md.id + <if test="userId !=null and userId!=''"> + and user_id = #{userId} OR user_id is NULL + </if> + OR user_id is NULL + ) isu2 on + isu2.ins_sample_id = a.id + ORDER BY + <!--a.user_id DESC,--> + a.type DESC, + a.id ) b + where ins_state is not null)A <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> @@ -163,6 +241,7 @@ and state = 1 and ins_fiber_id is null and ins_fibers_id is null + and isa.sample_code NOT REGEXP '/' </select> <select id="getInsOrderAndSample" resultMap="sampleDto"> select isa.*, @@ -253,7 +332,7 @@ method, man_day, bsm, - ask, + tell as ask, `last_value`, ip.ins_result ip_ins_result, state, @@ -271,6 +350,7 @@ 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 ip.standard_method_list_id is not null and state = 1 </select> @@ -304,6 +384,8 @@ 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, @@ -349,6 +431,7 @@ and ip.son_laboratory = #{laboratory} and ins_fiber_id is null and ins_fibers_id is null + and standard_method_list_id is not null </select> <select id="getInsProduct2" resultMap="product"> select ip.id ip_id, @@ -399,6 +482,7 @@ where ins_fibers_id = #{id} and state = 1 and ins_fiber_id is null + and standard_method_list_id is not null </select> <select id="getInsProduct3" resultMap="product"> select ip.id ip_id, @@ -449,6 +533,7 @@ where ins_fiber_id = #{id} and state = 1 and ins_fibers_id is null + and standard_method_list_id is not null </select> <select id="getReportModel" resultType="java.util.Map"> </select> @@ -556,4 +641,36 @@ <result property="equipValue" column="equip_value" jdbcType="VARCHAR"/> <result property="equipName" column="equip_name" jdbcType="VARBINARY"/> </resultMap> + + <resultMap id="sampleVo" type="com.yuanchu.mom.vo.SampleVo"> + <id property="id" column="id" jdbcType="INTEGER"/> + <result property="insResult" column="ins_result" jdbcType="INTEGER"/> + <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> + <result property="joinModel" column="join_model" jdbcType="VARCHAR"/> + <result property="joinName" column="join_name" jdbcType="VARCHAR"/> + <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/> + <result property="factory" column="factory" jdbcType="VARCHAR"/> + <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> + <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> + <result property="sample" column="sample" jdbcType="VARCHAR"/> + <result property="model" column="model" jdbcType="VARCHAR"/> + <result property="insState" column="ins_state" jdbcType="INTEGER"/> + <result property="joinNum" column="join_num" jdbcType="INTEGER"/> + <result property="remark" column="remark" jdbcType="VARCHAR"/> + <result property="createUser" column="create_user" jdbcType="INTEGER"/> + <result property="updateUser" column="update_user" jdbcType="INTEGER"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> + <result property="standardMethodListId" column="standard_method_list_id"/> + <result property="methodName" column="methodName" jdbcType="VARCHAR"/> + <result property="unit" column="unit"/> + </resultMap> + + <select id="getDetailById" resultMap="sampleVo"> + select is2.*, + code methodName + from ins_sample is2 + inner join standard_method sm on standard_method_list_id = sm.id + where is2.id=#{sampleId} + </select> </mapper> -- Gitblit v1.9.3