| | |
| | | <result property="radius" column="radius"/> |
| | | <result property="cableTag" column="cable_tag"/> |
| | | <result property="structureItemParameterId" column="structure_item_parameter_id"/> |
| | | <result property="checkUserId" column="check_user_id"/> |
| | | <collection property="insProductResult" resultMap="insProductResult"/> |
| | | </resultMap> |
| | | |
| | |
| | | <result property="comValue" column="com_value" jdbcType="VARCHAR"/> |
| | | <result property="equipValue" column="equip_value" jdbcType="VARCHAR"/> |
| | | <result property="equipName" column="equip_name" jdbcType="VARBINARY"/> |
| | | <result property="testStartTime" column="test_start_time" jdbcType="VARBINARY"/> |
| | | <result property="testEndTime" column="test_end_time" jdbcType="VARBINARY"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="sampleVo" type="com.ruoyi.inspect.vo.SampleVo"> |
| | |
| | | ip.dic, |
| | | ip.sort, |
| | | ip.cable_tag, |
| | | ip.structure_item_parameter_id |
| | | ip.structure_item_parameter_id, |
| | | ip.check_user_id, |
| | | ip.radius, |
| | | ipr.test_start_time, |
| | | ipr.test_end_time |
| | | </sql> |
| | | |
| | | |
| | | <select id="findInsSampleAndOrder" resultType="com.ruoyi.inspect.vo.InsOrderPlanVO"> |
| | | select * from(select * from( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user |
| | | select * from( |
| | | select * from( |
| | | SELECT a.*,ios.ins_state,ios.verify_tell,verify_user |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | io.appointed, |
| | | io.send_time, |
| | | io.order_type, |
| | | io.work_shop_id, |
| | | case when |
| | | io.type_source = 0 |
| | | then io.sample_view |
| | | else io.sample end sample, |
| | | io.type_source = 0 |
| | | then io.sample_view |
| | | else io.sample end sample, |
| | | GROUP_CONCAT(DISTINCT isa.model SEPARATOR ' ') AS sample_model, |
| | | userName, |
| | | checkName, |
| | | T4.userName, |
| | | ip.son_laboratory, |
| | | io.ins_time, |
| | | io.laboratory, |
| | |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id |
| | | LEFT JOIN ins_report ira ON ira.ins_order_id = io.id |
| | | LEFT JOIN ifs_inventory_quantity iiq ON iiq.id = io.ifs_inventory_id |
| | | LEFT JOIN ( |
| | | SELECT ins_sample_id,GROUP_CONCAT( DISTINCT uu.name SEPARATOR ',') AS userName |
| | | FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state=0 |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and son_laboratory=#{sonLaboratory} |
| | | </if> |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id |
| | | ) isu ON isu.ins_sample_id = io.id |
| | | LEFT JOIN ( |
| | | SELECT ins_sample_id,uu.name checkName |
| | | FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state=1 |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and son_laboratory=#{sonLaboratory} |
| | | </if> |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id |
| | | )isu2 ON isu2.ins_sample_id = io.id |
| | | LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id |
| | | LEFT JOIN ins_sample_user isu ON isa.id = isu.user_id |
| | | LEFT JOIN user uu ON ip.check_user_id = uu.id |
| | | LEFT JOIN ( |
| | | SELECT T1.ins_order_id,GROUP_CONCAT( DISTINCT T3.name SEPARATOR ', ' ) AS userName FROM ins_sample T1 LEFT JOIN |
| | | ins_product T2 ON T1.id = T2.ins_sample_id LEFT JOIN user T3 ON T2.check_user_id = T3.id GROUP BY |
| | | T1.ins_order_id |
| | | ) T4 ON T4.ins_order_id = io.id |
| | | WHERE io.state = 1 and send_time is not null |
| | | <if test="isCheck != null"> |
| | | <if test="userName !=null and userName!=''"> |
| | | and checkName like CONCAT ('%', #{userName},'%') |
| | | -- 非检测管理员 |
| | | <if test="otherParam.testAdminFlag != null and !otherParam.testAdminFlag"> |
| | | <if test="otherParam.checkUserFlag != null and otherParam.checkUserFlag"> |
| | | AND ( |
| | | isu.user_id = #{otherParam.userId} OR ip.check_user_id = #{otherParam.userId} |
| | | ) |
| | | </if> |
| | | </if> |
| | | <if test="isCheck == null"> |
| | | <if test="userName !=null and userName!=''"> |
| | | and userName like CONCAT ('%', #{userName},'%') |
| | | -- 是检测管理员 |
| | | <if test="otherParam.testAdminFlag != null and otherParam.testAdminFlag"> |
| | | <if test="otherParam.viewMySelfFlag != null and otherParam.viewMySelfFlag"> |
| | | AND ( |
| | | isu.user_id = #{otherParam.userId} OR ip.check_user_id = #{otherParam.userId} |
| | | ) |
| | | </if> |
| | | </if> |
| | | <if test="sonLaboratory!= null and sonLaboratory != ''"> |
| | | and ip.son_laboratory = #{sonLaboratory} |
| | | </if> |
| | | GROUP BY |
| | | ip.son_laboratory, |
| | | io.id |
| | | GROUP BY io.id |
| | | ) a |
| | | LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory |
| | | ORDER BY |
| | | a.type DESC, |
| | | a.id |
| | | ORDER BY a.type DESC,a.id |
| | | ) b |
| | | where ins_state is not null |
| | | <if test="laboratory!=null and laboratory!=''"> |
| | | and laboratory=#{laboratory} |
| | | </if> |
| | | )A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | ORDER BY send_time asc |
| | | </select> |
| | | |
| | | <select id="inspectionOrderDetailsTaskSwitching" resultType="com.ruoyi.inspect.vo.InsOrderPlanTaskSwitchVo"> |
| | |
| | | select <include refid="getInsProducSql"/> |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join user ur ON ip.check_user_id = ur.id |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |