<iftest="adjustedType != null and adjustedType != ''"> and adjusted_type = #{adjustedType}</if>
<iftest="stocktakeId != null and stocktakeId != ''"> and stocktake_id = #{stocktakeId}</if>
<iftest="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
<iftest="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
...
...
@@ -103,8 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
, st_it.end_time
, st_it.material_range
, st_it.location_range
,(select w.warehouses_name from warehouses w where st_it.warehouse_id = w.warehouses_code and w.is_used = 1) as warehouse_name
,(select sl.location_name from storage_locations sl where st_it.location_id = sl.location_code and sl.is_used = 1) as location_name
,(select w.warehouses_name from warehouses w where st_it.warehouse_id = w.id and w.is_used = 1) as warehouse_name
,(select sl.location_name from storage_locations sl where st_it.location_id = sl.id and sl.is_used = 1) as location_name
,(select dict.dict_label from sys_dict_data dict where st_it.adjusted_type = dict.dict_sort and dict.status =0 and dict.dict_type ='adjusted_type') as adjusted_type
from stocktake_items st_it
where stocktake_id = #{stocktake_id} and is_used = 1
<iftest="adjusted != null and adjusted != ''"> and adjusted = #{adjusted}</if>
...
...
@@ -123,11 +126,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
,dict.dict_label as hazardName
,IFNULL(st_it.variance_quantity, '0') as varianceQuantity
,IFNULL(st_it.variance_amount, '0') as varianceAmount
,(select dict.dict_label from sys_dict_data dict where st_it.adjusted_type = dict.dict_sort and dict.status =0 and dict.dict_type ='adjusted_type') as adjustedType
from stocktakes st
left join stocktake_items st_it on st.id = st_it.stocktake_id and st_it.is_used = 1
left join materials ma on st_it.material_id = ma.sap_no and ma.is_used = 1
left join warehouses w on st_it.warehouse_id = w.warehouses_code and w.is_used = 1
left join storage_locations sl on st_it.location_id = sl.location_code and sl.is_used = 1
left join materials ma on st_it.material_id = ma.id and ma.is_used = 1
left join warehouses w on st_it.warehouse_id = w.id and w.is_used = 1
left join storage_locations sl on st_it.location_id = sl.id and sl.is_used = 1
left join sys_dict_data dict on ma.hazard_id = dict.dict_sort and dict.status =0 and dict.dict_type ='danger_type'
where
st.is_used = 1 and IFNULL(st_it.variance_quantity, 0) != 0
...
...
@@ -152,11 +156,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"