|
@@ -34,17 +34,22 @@
|
|
|
</insert>
|
|
|
<!-- 查询生产领料单 -->
|
|
|
<select id="getAskGoodsfList" resultType="com.tld.model.AskGoods">
|
|
|
- select
|
|
|
- DISTINCT a.ask_goods_id,
|
|
|
- a.ask_goods_code,
|
|
|
- b.name as departmentName,
|
|
|
- a.company_number
|
|
|
- from tld_ask_goods_f a
|
|
|
- join tld_ask_goods d on a.ask_goods_id = d.ask_goods_id
|
|
|
- left join tld_department b on a.department = b.tld_id
|
|
|
- join tld_material c on d.material_id = c.tld_id
|
|
|
- where c.part_type != '半成品'
|
|
|
- order by a.sqrq desc
|
|
|
+ SELECT
|
|
|
+ a.ask_goods_id,
|
|
|
+ a.material_id,
|
|
|
+ IFNULL( a.out_num, 0 ) AS num,
|
|
|
+ e.NAME AS materialName,
|
|
|
+ e.CODE AS materialCode,
|
|
|
+ b.ask_goods_code,
|
|
|
+ b.company_number
|
|
|
+ FROM
|
|
|
+ tld_ask_goods a
|
|
|
+ JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
|
|
|
+ LEFT JOIN tld_department c ON b.department = c.CODE
|
|
|
+ JOIN tld_material e ON a.material_id = e.tld_id
|
|
|
+ WHERE
|
|
|
+ ( a.num + 0 ) <![CDATA[>]]> (
|
|
|
+ IFNULL( a.out_num, 0 ) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
|
|
|
</select>
|
|
|
<!-- 查询指定生产单的物料 -->
|
|
|
<select id="getAskGoodsMaterial" resultType="com.tld.model.AskGoods">
|