|
@@ -1261,6 +1261,119 @@
|
|
|
</trim>
|
|
|
ORDER BY a.id DESC
|
|
|
</select>
|
|
|
+ <!-- 查询质检单任务数量 -->
|
|
|
+ <select id="getShangjia" resultType="int">
|
|
|
+ select count(*) from tld_receive_goods where (warehousing_num + 0) <![CDATA[<]]> (qualified_num + 0)
|
|
|
+ </select>
|
|
|
+ <!-- 查询生产领料任务数量 -->
|
|
|
+ <select id="getJihua" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_ask_goods a
|
|
|
+ JOIN tld_material b on a.material_id = b.tld_id
|
|
|
+ WHERE
|
|
|
+ ( a.out_num + 0 ) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ and b.part_type != '半成品' and b.part_type != '产成品'
|
|
|
+ </select>
|
|
|
+ <!-- 查询非生产领料任务数量 -->
|
|
|
+ <select id="getYaoqing" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_invite a
|
|
|
+ JOIN tld_material b on a.material_id = b.tld_id
|
|
|
+ WHERE
|
|
|
+ ( a.out_num + 0 ) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ and b.part_type != '半成品' and b.part_type != '产成品'
|
|
|
+ </select>
|
|
|
+ <!-- 查询半成品入库任务数量 -->
|
|
|
+ <select id="getBanChenPin" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_notice a
|
|
|
+ join tld_material b on a.material_id = b.tld_id
|
|
|
+ where b.part_type = "半成品" and (warehousing_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 查询产成品入库任务数量 -->
|
|
|
+ <select id="getChanChenPin" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_notice a
|
|
|
+ JOIN tld_material b on a.material_id = b.tld_id
|
|
|
+ where b.part_type = "产成品" and (warehousing_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 销售发货任务数量 -->
|
|
|
+ <select id="getXiaoShou" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_delivery a
|
|
|
+ JOIN tld_material b ON a.material_id = b.tld_id
|
|
|
+ where (out_num + 0) <![CDATA[<]]> (
|
|
|
+ a.gs_delivery_num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId}) and a.status = "0"
|
|
|
+ </select>
|
|
|
+ <!-- 查询其他入库任务数量 -->
|
|
|
+ <select id="getQiTaRu" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_notices a
|
|
|
+ JOIN tld_material b ON a.material_id = b.tld_id
|
|
|
+ where (a.warehousing_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 查询其他出库任务数量 -->
|
|
|
+ <select id="getQiTaChu" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_enquiry a
|
|
|
+ JOIN tld_material b ON a.material_id = b.tld_id
|
|
|
+ where (a.out_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 查询移库任务数量 -->
|
|
|
+ <select id="getYiKu" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_warehouse_transfer a
|
|
|
+ JOIN tld_material b ON a.material_id = b.tld_id
|
|
|
+ where (a.out_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 查询发货追溯任务数量 -->
|
|
|
+ <select id="getZhuiSu" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_warehouse_transfer a
|
|
|
+ JOIN tld_material b ON a.material_id = b.tld_id
|
|
|
+ where (a.out_num + 0) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ </select>
|
|
|
+ <!-- 查询发货追溯任务数量 -->
|
|
|
+ <select id="getBanChenPinChu" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ tld_ask_goods a
|
|
|
+ JOIN tld_material b on a.material_id = b.tld_id
|
|
|
+ WHERE
|
|
|
+ ( a.out_num + 0 ) <![CDATA[<]]> (
|
|
|
+ a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
|
|
|
+ and b.part_type = '半成品'
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<select id="storageLocationNum" resultType="java.util.Map">
|
|
|
SELECT
|