chenrui
2025-04-10 2f467298075f6eb3bc40ecfa6da88c009f7fd0f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ruoyi.inspect.mapper.InsUnqualifiedRetestProductMapper">
    <resultMap id="product" type="com.ruoyi.inspect.pojo.InsProduct">
        <id property="id" column="ip_id" jdbcType="INTEGER"/>
        <result property="inspectionItem" column="inspection_item" 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"/>
        <result property="sample" column="ip_sample" jdbcType="VARCHAR"/>
        <result property="model" column="ip_model" jdbcType="VARCHAR"/>
        <result property="sonLaboratory" column="son_laboratory" jdbcType="VARCHAR"/>
        <result property="unit" column="ip_unit" jdbcType="VARCHAR"/>
        <result property="price" column="price" jdbcType="DECIMAL"/>
        <result property="manHour" column="man_hour" jdbcType="DOUBLE"/>
        <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/>
        <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/>
        <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/>
        <result property="deviceGroup" column="device_group" jdbcType="VARCHAR"/>
        <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/>
        <result property="section" column="section" jdbcType="VARCHAR"/>
        <result property="valueType" column="value_type" jdbcType="VARCHAR"/>
        <result property="method" column="method" jdbcType="VARCHAR"/>
        <result property="manDay" column="man_day" jdbcType="INTEGER"/>
        <result property="bsm" column="bsm" jdbcType="VARCHAR"/>
        <result property="ask" column="ask" jdbcType="VARCHAR"/>
        <result property="tell" column="tell" jdbcType="VARCHAR"/>
        <result property="lastValue" column="last_value" jdbcType="VARCHAR"/>
        <result property="insResult" column="ip_ins_result" jdbcType="INTEGER"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="insBushId" column="ins_bush_id" jdbcType="INTEGER"/>
        <result property="insSampleId" column="ins_sample_id" jdbcType="INTEGER"/>
        <result property="createUser" column="ip_create_user" jdbcType="INTEGER"/>
        <result property="updateUser" column="ip_update_user" jdbcType="INTEGER"/>
        <result property="createTime" column="ip_create_time" jdbcType="TIMESTAMP"/>
        <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"/>
        <result property="temperature" column="temperature"/>
        <result property="humidity" column="humidity"/>
        <result property="cableTag" column="cable_tag"/>
        <result property="sort" column="sort"/>
        <collection property="insProductResult" resultMap="insProductResult"/>
    </resultMap>
 
    <resultMap id="insProductResult" type="com.ruoyi.inspect.pojo.InsProductResult">
        <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>
 
       <sql id="getInsProducSql">
            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,
               ip.cable_tag,
               ip.sort
       </sql>
 
    <select id="selectRetestProduct" resultType="com.ruoyi.inspect.pojo.InsUnqualifiedRetestProduct">
        select id ins_product_id,
               inspection_item,
               inspection_item_subclass,
               factory,
               laboratory,
               sample_type,
               sample,
               model,
               son_laboratory,
               unit,
               price,
               man_hour,
               man_hour_group,
               '0' inspection_item_type,
               inspection_value_type,
               device_group,
               checkout_number,
               section,
               value_type,
               method,
               man_day,
               bsm,
               ask,
               tell,
               state,
               ins_sample_id,
               create_user,
               update_user,
               create_time,
               update_time,
               template_id,
               dic,
               method_s,
               ins_fiber_id,
               ins_fibers_id,
               inspection_item_en,
               inspection_item_subclass_en,
               inspection_item_class,
               inspection_item_class_en,
               standard_method_list_id,
               temperature,
               humidity,
               ins_bush_id,
               radius,
               cable_tag,
               raw_material_tag,
               sort,
               '1' retest_tag
        from ins_product
        where id in
        <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
            #{val}
        </foreach>
    </select>
       <select id="getInsProductUnqualifiedRetest1" resultMap="product">
              select <include refid="getInsProducSql"/>
              from ins_unqualified_retest_product ip
              left join ins_unqualified_retest_result ipr on ip.id = ipr.retest_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
              and standard_method_list_id is not null
              and ip.cable_tag is null
              <if test="retestTag != null and retestTag != ''">
                  and ip.retest_tag = #{retestTag}
              </if>
       </select>
       <select id="getInsProductUnqualifiedRetest5" resultMap="product">
           select <include refid="getInsProducSql"/>
           from ins_unqualified_retest_product ip
           left join ins_unqualified_retest_result ipr on ip.id = ipr.retest_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
           and standard_method_list_id is not null
           and ip.cable_tag = #{cableTag}
           and ip.retest_tag = #{retestTag}
       </select>
       <select id="getInsProductUnqualifiedRetest6" resultMap="product">
           select <include refid="getInsProducSql"/>
           from ins_unqualified_retest_product ip
           left join ins_unqualified_retest_result ipr on ip.id = ipr.retest_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
           and standard_method_list_id is not null
           and ip.raw_material_tag = #{rawMaterialTag}
           and ip.retest_tag = #{retestTag}
       </select>
</mapper>