Browse Source

储量专卡

jidj 5 years ago
parent
commit
6831e7de54

+ 6 - 1
src/main/java/com/chinaitop/depot/storage/mapper/StorageFoodbasicinfoMapper.xml

@@ -967,7 +967,9 @@
967 967
       <if test="warehouseId != null">
968 968
       AND sf.warehouse_id = #{warehouseId} 
969 969
       </if>
970
-      AND sf.warehouse_id
970
+      <if test="id != null">
971
+        AND sf.id = #{id}
972
+      </if>
971 973
       AND sf.history_status = 0
972 974
       ORDER BY
973 975
         sf.id DESC
@@ -1046,6 +1048,9 @@
1046 1048
     <if test="houseId != null">
1047 1049
       AND sf.house_id = #{houseId}
1048 1050
     </if>
1051
+    <if test="id != null">
1052
+      AND sf.id = #{id}
1053
+    </if>
1049 1054
     AND sf.history_status = 0
1050 1055
     ORDER BY
1051 1056
     sf.id DESC

+ 78 - 78
src/main/java/com/chinaitop/depot/storage/mapper/StorageQualitycheckMapper.xml

@@ -148,19 +148,19 @@
148 148
     </where>
149 149
   </sql>
150 150
   <sql id="Base_Column_List">
151
-    id, house_id, warehouse_id, type, sub_type, sub_type_detailed, check_time, check_result, 
152
-    checker, level, capacity, water, impurity, mineral, badpart, colorsmell, keeper_advices, 
153
-    keeper_advices_time, keeper_advices_paint, chief_advices, chief_advices_time, chiet_advices_paint, 
154
-    vice_manager_advices, vice_manager_advices_time, vice_manager_advices_paint, manager_advices, 
155
-    manager_advices_time, manager_advices_paint, improve_result, improve_time, improve_paint, 
156
-    is_firstchecklevel_right, accept_unite, input_time, number, location, keeper, harvest_time, 
157
-    goodpart, chooser, choose_time, boldfat_index, check_type, hot_damage, protein_solution_ratio, 
158
-    eat_score, fat_index, husked_ration, full_good_ration, yellow_part, out_husked_ration, 
159
-    pests, color_ratio, hard_index, gluten_water_count, remarks, approver, mildew_count, 
160
-    damage_ratio, hot_damage_ratio, husked_rice_weight, reviewer, apply_check_time, check_time_type, 
161
-    check_result_time, store_quality, is_pest, inspection_standard_basis, quality, seal_date, 
162
-    seal_status, auth_code, org_id, history_status, intermixing_rate, smelltaste, transparency, 
163
-    peroxide_value, smoke_point, reeze_test, residual_solvent, lead, total_arsenic, aflatoxin, 
151
+    id, house_id, warehouse_id, type, sub_type, sub_type_detailed, check_time, check_result,
152
+    checker, level, capacity, water, impurity, mineral, badpart, colorsmell, keeper_advices,
153
+    keeper_advices_time, keeper_advices_paint, chief_advices, chief_advices_time, chiet_advices_paint,
154
+    vice_manager_advices, vice_manager_advices_time, vice_manager_advices_paint, manager_advices,
155
+    manager_advices_time, manager_advices_paint, improve_result, improve_time, improve_paint,
156
+    is_firstchecklevel_right, accept_unite, input_time, number, location, keeper, harvest_time,
157
+    goodpart, chooser, choose_time, boldfat_index, check_type, hot_damage, protein_solution_ratio,
158
+    eat_score, fat_index, husked_ration, full_good_ration, yellow_part, out_husked_ration,
159
+    pests, color_ratio, hard_index, gluten_water_count, remarks, approver, mildew_count,
160
+    damage_ratio, hot_damage_ratio, husked_rice_weight, reviewer, apply_check_time, check_time_type,
161
+    check_result_time, store_quality, is_pest, inspection_standard_basis, quality, seal_date,
162
+    seal_status, auth_code, org_id, history_status, intermixing_rate, smelltaste, transparency,
163
+    peroxide_value, smoke_point, reeze_test, residual_solvent, lead, total_arsenic, aflatoxin,
164 164
     butyl_phenol
165 165
   </sql>
166 166
   <select id="selectByExample" parameterType="com.chinaitop.depot.storage.model.StorageQualitycheckExample" resultMap="BaseResultMap">
@@ -178,7 +178,7 @@
178 178
     </if>
179 179
   </select>
180 180
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
181
-    select 
181
+    select
182 182
     <include refid="Base_Column_List" />
183 183
     from storage_qualitycheck
184 184
     where id = #{id,jdbcType=INTEGER}
@@ -194,64 +194,64 @@
194 194
     </if>
195 195
   </delete>
196 196
   <insert id="insert" parameterType="com.chinaitop.depot.storage.model.StorageQualitycheck">
197
-    insert into storage_qualitycheck (id, house_id, warehouse_id, 
198
-      type, sub_type, sub_type_detailed, 
199
-      check_time, check_result, checker, 
200
-      level, capacity, water, 
201
-      impurity, mineral, badpart, 
202
-      colorsmell, keeper_advices, keeper_advices_time, 
203
-      keeper_advices_paint, chief_advices, chief_advices_time, 
204
-      chiet_advices_paint, vice_manager_advices, 
205
-      vice_manager_advices_time, vice_manager_advices_paint, 
206
-      manager_advices, manager_advices_time, manager_advices_paint, 
207
-      improve_result, improve_time, improve_paint, 
208
-      is_firstchecklevel_right, accept_unite, input_time, 
209
-      number, location, keeper, 
210
-      harvest_time, goodpart, chooser, 
211
-      choose_time, boldfat_index, check_type, 
212
-      hot_damage, protein_solution_ratio, eat_score, 
213
-      fat_index, husked_ration, full_good_ration, 
214
-      yellow_part, out_husked_ration, pests, 
215
-      color_ratio, hard_index, gluten_water_count, 
216
-      remarks, approver, mildew_count, 
217
-      damage_ratio, hot_damage_ratio, husked_rice_weight, 
218
-      reviewer, apply_check_time, check_time_type, 
219
-      check_result_time, store_quality, is_pest, 
220
-      inspection_standard_basis, quality, seal_date, 
221
-      seal_status, auth_code, org_id, 
222
-      history_status, intermixing_rate, smelltaste, 
223
-      transparency, peroxide_value, smoke_point, 
224
-      reeze_test, residual_solvent, lead, 
197
+    insert into storage_qualitycheck (id, house_id, warehouse_id,
198
+      type, sub_type, sub_type_detailed,
199
+      check_time, check_result, checker,
200
+      level, capacity, water,
201
+      impurity, mineral, badpart,
202
+      colorsmell, keeper_advices, keeper_advices_time,
203
+      keeper_advices_paint, chief_advices, chief_advices_time,
204
+      chiet_advices_paint, vice_manager_advices,
205
+      vice_manager_advices_time, vice_manager_advices_paint,
206
+      manager_advices, manager_advices_time, manager_advices_paint,
207
+      improve_result, improve_time, improve_paint,
208
+      is_firstchecklevel_right, accept_unite, input_time,
209
+      number, location, keeper,
210
+      harvest_time, goodpart, chooser,
211
+      choose_time, boldfat_index, check_type,
212
+      hot_damage, protein_solution_ratio, eat_score,
213
+      fat_index, husked_ration, full_good_ration,
214
+      yellow_part, out_husked_ration, pests,
215
+      color_ratio, hard_index, gluten_water_count,
216
+      remarks, approver, mildew_count,
217
+      damage_ratio, hot_damage_ratio, husked_rice_weight,
218
+      reviewer, apply_check_time, check_time_type,
219
+      check_result_time, store_quality, is_pest,
220
+      inspection_standard_basis, quality, seal_date,
221
+      seal_status, auth_code, org_id,
222
+      history_status, intermixing_rate, smelltaste,
223
+      transparency, peroxide_value, smoke_point,
224
+      reeze_test, residual_solvent, lead,
225 225
       total_arsenic, aflatoxin, butyl_phenol
226 226
       )
227
-    values (#{id,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, 
228
-      #{type,jdbcType=VARCHAR}, #{subType,jdbcType=INTEGER}, #{subTypeDetailed,jdbcType=INTEGER}, 
229
-      #{checkTime,jdbcType=TIMESTAMP}, #{checkResult,jdbcType=VARCHAR}, #{checker,jdbcType=VARCHAR}, 
230
-      #{level,jdbcType=INTEGER}, #{capacity,jdbcType=VARCHAR}, #{water,jdbcType=VARCHAR}, 
231
-      #{impurity,jdbcType=VARCHAR}, #{mineral,jdbcType=VARCHAR}, #{badpart,jdbcType=VARCHAR}, 
232
-      #{colorsmell,jdbcType=VARCHAR}, #{keeperAdvices,jdbcType=VARCHAR}, #{keeperAdvicesTime,jdbcType=VARCHAR}, 
233
-      #{keeperAdvicesPaint,jdbcType=VARCHAR}, #{chiefAdvices,jdbcType=VARCHAR}, #{chiefAdvicesTime,jdbcType=TIMESTAMP}, 
234
-      #{chietAdvicesPaint,jdbcType=VARCHAR}, #{viceManagerAdvices,jdbcType=VARCHAR}, 
235
-      #{viceManagerAdvicesTime,jdbcType=TIMESTAMP}, #{viceManagerAdvicesPaint,jdbcType=VARCHAR}, 
236
-      #{managerAdvices,jdbcType=VARCHAR}, #{managerAdvicesTime,jdbcType=TIMESTAMP}, #{managerAdvicesPaint,jdbcType=VARCHAR}, 
237
-      #{improveResult,jdbcType=VARCHAR}, #{improveTime,jdbcType=TIMESTAMP}, #{improvePaint,jdbcType=VARCHAR}, 
238
-      #{isFirstchecklevelRight,jdbcType=VARCHAR}, #{acceptUnite,jdbcType=VARCHAR}, #{inputTime,jdbcType=TIMESTAMP}, 
239
-      #{number,jdbcType=VARCHAR}, #{location,jdbcType=INTEGER}, #{keeper,jdbcType=VARCHAR}, 
240
-      #{harvestTime,jdbcType=INTEGER}, #{goodpart,jdbcType=VARCHAR}, #{chooser,jdbcType=VARCHAR}, 
241
-      #{chooseTime,jdbcType=TIMESTAMP}, #{boldfatIndex,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR}, 
242
-      #{hotDamage,jdbcType=VARCHAR}, #{proteinSolutionRatio,jdbcType=VARCHAR}, #{eatScore,jdbcType=VARCHAR}, 
243
-      #{fatIndex,jdbcType=VARCHAR}, #{huskedRation,jdbcType=VARCHAR}, #{fullGoodRation,jdbcType=VARCHAR}, 
244
-      #{yellowPart,jdbcType=VARCHAR}, #{outHuskedRation,jdbcType=VARCHAR}, #{pests,jdbcType=VARCHAR}, 
245
-      #{colorRatio,jdbcType=VARCHAR}, #{hardIndex,jdbcType=VARCHAR}, #{glutenWaterCount,jdbcType=VARCHAR}, 
246
-      #{remarks,jdbcType=VARCHAR}, #{approver,jdbcType=VARCHAR}, #{mildewCount,jdbcType=VARCHAR}, 
247
-      #{damageRatio,jdbcType=VARCHAR}, #{hotDamageRatio,jdbcType=VARCHAR}, #{huskedRiceWeight,jdbcType=VARCHAR}, 
248
-      #{reviewer,jdbcType=VARCHAR}, #{applyCheckTime,jdbcType=TIMESTAMP}, #{checkTimeType,jdbcType=VARCHAR}, 
249
-      #{checkResultTime,jdbcType=TIMESTAMP}, #{storeQuality,jdbcType=VARCHAR}, #{isPest,jdbcType=VARCHAR}, 
250
-      #{inspectionStandardBasis,jdbcType=VARCHAR}, #{quality,jdbcType=VARCHAR}, #{sealDate,jdbcType=TIMESTAMP}, 
251
-      #{sealStatus,jdbcType=VARCHAR}, #{authCode,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, 
252
-      #{historyStatus,jdbcType=INTEGER}, #{intermixingRate,jdbcType=VARCHAR}, #{smelltaste,jdbcType=VARCHAR}, 
253
-      #{transparency,jdbcType=VARCHAR}, #{peroxideValue,jdbcType=VARCHAR}, #{smokePoint,jdbcType=VARCHAR}, 
254
-      #{reezeTest,jdbcType=VARCHAR}, #{residualSolvent,jdbcType=VARCHAR}, #{lead,jdbcType=VARCHAR}, 
227
+    values (#{id,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER},
228
+      #{type,jdbcType=VARCHAR}, #{subType,jdbcType=INTEGER}, #{subTypeDetailed,jdbcType=INTEGER},
229
+      #{checkTime,jdbcType=TIMESTAMP}, #{checkResult,jdbcType=VARCHAR}, #{checker,jdbcType=VARCHAR},
230
+      #{level,jdbcType=INTEGER}, #{capacity,jdbcType=VARCHAR}, #{water,jdbcType=VARCHAR},
231
+      #{impurity,jdbcType=VARCHAR}, #{mineral,jdbcType=VARCHAR}, #{badpart,jdbcType=VARCHAR},
232
+      #{colorsmell,jdbcType=VARCHAR}, #{keeperAdvices,jdbcType=VARCHAR}, #{keeperAdvicesTime,jdbcType=VARCHAR},
233
+      #{keeperAdvicesPaint,jdbcType=VARCHAR}, #{chiefAdvices,jdbcType=VARCHAR}, #{chiefAdvicesTime,jdbcType=TIMESTAMP},
234
+      #{chietAdvicesPaint,jdbcType=VARCHAR}, #{viceManagerAdvices,jdbcType=VARCHAR},
235
+      #{viceManagerAdvicesTime,jdbcType=TIMESTAMP}, #{viceManagerAdvicesPaint,jdbcType=VARCHAR},
236
+      #{managerAdvices,jdbcType=VARCHAR}, #{managerAdvicesTime,jdbcType=TIMESTAMP}, #{managerAdvicesPaint,jdbcType=VARCHAR},
237
+      #{improveResult,jdbcType=VARCHAR}, #{improveTime,jdbcType=TIMESTAMP}, #{improvePaint,jdbcType=VARCHAR},
238
+      #{isFirstchecklevelRight,jdbcType=VARCHAR}, #{acceptUnite,jdbcType=VARCHAR}, #{inputTime,jdbcType=TIMESTAMP},
239
+      #{number,jdbcType=VARCHAR}, #{location,jdbcType=INTEGER}, #{keeper,jdbcType=VARCHAR},
240
+      #{harvestTime,jdbcType=INTEGER}, #{goodpart,jdbcType=VARCHAR}, #{chooser,jdbcType=VARCHAR},
241
+      #{chooseTime,jdbcType=TIMESTAMP}, #{boldfatIndex,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR},
242
+      #{hotDamage,jdbcType=VARCHAR}, #{proteinSolutionRatio,jdbcType=VARCHAR}, #{eatScore,jdbcType=VARCHAR},
243
+      #{fatIndex,jdbcType=VARCHAR}, #{huskedRation,jdbcType=VARCHAR}, #{fullGoodRation,jdbcType=VARCHAR},
244
+      #{yellowPart,jdbcType=VARCHAR}, #{outHuskedRation,jdbcType=VARCHAR}, #{pests,jdbcType=VARCHAR},
245
+      #{colorRatio,jdbcType=VARCHAR}, #{hardIndex,jdbcType=VARCHAR}, #{glutenWaterCount,jdbcType=VARCHAR},
246
+      #{remarks,jdbcType=VARCHAR}, #{approver,jdbcType=VARCHAR}, #{mildewCount,jdbcType=VARCHAR},
247
+      #{damageRatio,jdbcType=VARCHAR}, #{hotDamageRatio,jdbcType=VARCHAR}, #{huskedRiceWeight,jdbcType=VARCHAR},
248
+      #{reviewer,jdbcType=VARCHAR}, #{applyCheckTime,jdbcType=TIMESTAMP}, #{checkTimeType,jdbcType=VARCHAR},
249
+      #{checkResultTime,jdbcType=TIMESTAMP}, #{storeQuality,jdbcType=VARCHAR}, #{isPest,jdbcType=VARCHAR},
250
+      #{inspectionStandardBasis,jdbcType=VARCHAR}, #{quality,jdbcType=VARCHAR}, #{sealDate,jdbcType=TIMESTAMP},
251
+      #{sealStatus,jdbcType=VARCHAR}, #{authCode,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER},
252
+      #{historyStatus,jdbcType=INTEGER}, #{intermixingRate,jdbcType=VARCHAR}, #{smelltaste,jdbcType=VARCHAR},
253
+      #{transparency,jdbcType=VARCHAR}, #{peroxideValue,jdbcType=VARCHAR}, #{smokePoint,jdbcType=VARCHAR},
254
+      #{reezeTest,jdbcType=VARCHAR}, #{residualSolvent,jdbcType=VARCHAR}, #{lead,jdbcType=VARCHAR},
255 255
       #{totalArsenic,jdbcType=VARCHAR}, #{aflatoxin,jdbcType=VARCHAR}, #{butylPhenol,jdbcType=VARCHAR}
256 256
       )
257 257
   </insert>
@@ -1625,12 +1625,12 @@
1625 1625
     bs.storeHouse_name storehouseName,
1626 1626
     bw.warehouse_name wareHouseName,
1627 1627
     bb.storageTank_name tankName,
1628
-    sfo.id foodbasicinfoId
1628
+    sf.foodbasicinfo_id foodbasicinfoId
1629 1629
     FROM storage_qualitycheck sqk
1630 1630
     LEFT JOIN basic_storehouse bs on bs.storehouse_id = sqk.house_id
1631 1631
     LEFT JOIN basic_warehouse bw  on bw.warehouse_id = sqk.warehouse_id
1632 1632
     LEFT JOIN basic_tank bb on bb.id = sqk.tank_id
1633
-    LEFT JOIN storage_foodbasicinfo sfo on sfo.house_id = sqk.house_id and sfo.warehouse_id = sqk.warehouse_id
1633
+    LEFT JOIN storage_foodbasicinfochecks sf on sf.qualitycheck_id = sqk.id
1634 1634
     <where>
1635 1635
       <if test="id !=null">
1636 1636
         and sqk.id = #{id}
@@ -1666,8 +1666,8 @@
1666 1666
         and sqk.check_result = #{checkResult}
1667 1667
       </if>
1668 1668
     </where>
1669
-    /*GROUP BY sqk.id
1670
-    order by sqk.id desc*/
1669
+    GROUP BY sqk.id
1670
+    order by sqk.id desc
1671 1671
   </select>
1672 1672
 
1673 1673
   <select id="getStoreQualityList"  resultType="java.util.Map" parameterType="java.lang.Integer">
@@ -1678,7 +1678,7 @@
1678 1678
     type=5 and history_status=0 and store_quality=1 and org_id =#{orgId} ;
1679 1679
   </select>
1680 1680
 
1681
-  
1681
+
1682 1682
   <select id="getTrdStoreQualityList" resultType="java.util.Map">
1683 1683
     select
1684 1684
       house_id,warehouse_id,quality,sub_type_detailed,level,number
@@ -1689,7 +1689,7 @@
1689 1689
 
1690 1690
 
1691 1691
   <select id="getDataByZJId" resultMap="BaseResultMap" parameterType="java.util.Map" >
1692
-  
1692
+
1693 1693
   <if test="planType == '7121'"><!-- 油 -->
1694 1694
 	SELECT
1695 1695
 		quality.*, acceptance.id acceptanceId,
@@ -1702,7 +1702,7 @@
1702 1702
 	WHERE
1703 1703
 		acceptance.plan_id = #{ZZid,jdbcType=VARCHAR} and acceptance.id =#{id}
1704 1704
   </if>
1705
-  
1705
+
1706 1706
    <if test="planType == '3156'"><!-- 粮 -->
1707 1707
 		SELECT
1708 1708
 			quality.*, acceptance.id acceptanceId,
@@ -1717,7 +1717,7 @@
1717 1717
 		WHERE
1718 1718
 			acceptance.plan_id = #{ZZid,jdbcType=VARCHAR} and acceptance.id =#{id}
1719 1719
    </if>
1720
-    
1720
+
1721 1721
   </select>
1722 1722
 
1723 1723
   <!--封仓的数据(油罐)-->