Commit 9bac55bd by zhu.zewen

修复销毁审批单列表

parent 5d822785
...@@ -33,9 +33,29 @@ ...@@ -33,9 +33,29 @@
</select> </select>
<select id="selectDestroy" resultType="com.jmai.physic.vo.PhysicDestroyNumVO"> <select id="selectDestroy" resultType="com.jmai.physic.vo.PhysicDestroyNumVO">
SELECT
select physic_name,physic_spec,batch_no,factory_name,unit,(IFNULL(sum(physic_num),0) - IFNULL(sum(expend_num),0))as destroyNum from physic_storage_ampoule a.id,
where ((type =2 and destroy_status =0 and accept_dept_id =#{deptId}) or (type =2 and destroy_status =1 and accept_dept_id =#{deptId})) a.order_no AS ampouleOrderNo,
group by physic_name,physic_spec,batch_no,factory_name,accept_dept_id d.order_no AS destroyCheckOrderNo,
a.physic_name,
a.physic_spec,
a.batch_no,
a.factory_name,
a.unit,
(IFNULL(sum(a.physic_num),0) - IFNULL(sum(a.expend_num),0)) AS destroyNum,
a.type,
a.destroy_status,
d.status AS destroyCheckStatus
FROM physic_storage_ampoule a
INNER JOIN physic_destroy_check d ON a.order_no = d.order_no
WHERE a.del_flag = 0
AND a.accept_dept_id = #{deptId}
-- 2-移至销毁
AND a.type = 2
-- 销毁状态:0-待销毁 1-已销毁
AND a.destroy_status = 0
-- 销毁状态:0-5审批中, 6-已销毁
AND d.status != 6
GROUP BY a.physic_name,a.physic_spec,a.batch_no,a.factory_name,a.accept_dept_id
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment