|
|
@@ -476,6 +476,21 @@
|
|
|
</where>
|
|
|
ORDER BY PR_ID DESC
|
|
|
</select>
|
|
|
+ <select id="selectReserveCostByIgnoreWarehouse" resultMap="ProdReserveCostResultMap">
|
|
|
+ select pr_code,pr_spec,pr_detail,pr_unit,sum(pw_onhand) pw_onhand,sum(pw_amount) pw_amount
|
|
|
+ from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
|
|
|
+ <where>
|
|
|
+ <if test="con!=null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="companyId!=null">
|
|
|
+ and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
|
|
|
+ and pw_onhand!=0
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by pr_code,pr_spec,pr_detail,pr_unit,pr_id
|
|
|
+ ORDER BY PR_ID DESC
|
|
|
+ </select>
|
|
|
<select id="getCountFromPurc" resultType="int">
|
|
|
SELECT COUNT(*) FROM PURCHASEDETAIL
|
|
|
WHERE PD_PRODID = #{id} AND COMPANYID=#{companyId}
|