|
|
@@ -1187,56 +1187,44 @@
|
|
|
<select id="wrposition" parameterType="com.muchinfo.mtp3pojos.vo.reportform.TaAccountReportParam"
|
|
|
resultType="com.muchinfo.mtp3pojos.vo.reportform.WrPositionResult">
|
|
|
<choose>
|
|
|
- <when test="vo.cycletype==0">
|
|
|
+ <when test="cycletype==0">
|
|
|
select
|
|
|
- ras.oriqty "oriqty", ras.curqty "curqty", ras.buyqty "buyqty", ras.sellqty "sellqty", ras.buydeliveryqty
|
|
|
- "buydeliveryqty",
|
|
|
- ras.selldeliveryqty "selldeliveryqty", ras.pricedqty "pricedqty", ras.pricedcancelledqty
|
|
|
- "pricedcancelledqty",
|
|
|
- ras.pricedrelatedqty "pricedrelatedqty", (nvl(ras.pricedrelatedqty, 0) - nvl(ras.unpricedrelatedqty, 0))
|
|
|
- "curpricedrelatedqty",
|
|
|
- ras.closedqty "closedqty", ras.accountid "accountid", gudic.enumdicname as "unitname", ras.wrstandardid
|
|
|
- "wrstandardid",
|
|
|
- gd.deliverygoodsname "deliverygoodsname", ws.wrstandardname "wrstandardname", ras.deliverygoodsid
|
|
|
- "deliverygoodsid"
|
|
|
- from Reckon_AccountSpot ras
|
|
|
- left join wrstandard ws on ras.wrstandardid = ws.wrstandardid
|
|
|
- left join DeliveryGoods gd on ras.deliverygoodsid = gd.deliverygoodsid
|
|
|
- left join ENUMDICITEM gudic on gudic.enumdiccode = 'goodsunit' and gudic.enumitemname = ws.unitid
|
|
|
+ dwrs.totalqty "totalqty", dwrs.increaseqty "increaseqty", dwrs.decreaseqty "decreaseqty",
|
|
|
+ dwrs.freezeqty "freezeqty", dwrs.deliverygoodsid "deliverygoodsid", dwrs.accountid "accountid",
|
|
|
+ (dwrs.totalqty - dwrs.freezeqty) "usedqty",
|
|
|
+ (dwrs.totalqty - dwrs.increaseqty + dwrs.decreaseqty) "startqty",
|
|
|
+ gd.deliverygoodsname "deliverygoodsname", ws.wrstandardname "wrstandardname"
|
|
|
+ from Reckon_DayWRStandard dwrs
|
|
|
+ left join wrstandard ws on dwrs.wrstandardid = ws.wrstandardid
|
|
|
+ left join DeliveryGoods gd on gd.deliverygoodsid = dwrs.deliverygoodsid
|
|
|
<where>
|
|
|
<if test="vo.cycletime != null and vo.cycletime !=''">
|
|
|
- and ras.reckondate=#{vo.cycletime}
|
|
|
+ and dwrs.ReckonDate=#{vo.cycletime}
|
|
|
</if>
|
|
|
<if test="vo.accountid != null">
|
|
|
- and ras.accountid=#{vo.accountid}
|
|
|
+ and dwrs.accountid=#{vo.accountid}
|
|
|
</if>
|
|
|
</where>
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
select
|
|
|
- ras.oriqty "oriqty", ras.curqty "curqty", ras.buyqty "buyqty", ras.sellqty "sellqty", ras.buydeliveryqty
|
|
|
- "buydeliveryqty",
|
|
|
- ras.selldeliveryqty "selldeliveryqty", ras.pricedqty "pricedqty", ras.pricedcancelledqty
|
|
|
- "pricedcancelledqty",
|
|
|
- ras.pricedrelatedqty "pricedrelatedqty", (nvl(ras.pricedrelatedqty, 0) - nvl(ras.unpricedrelatedqty, 0))
|
|
|
- "curpricedrelatedqty",
|
|
|
- ras.closedqty "closedqty", ras.accountid "accountid", gudic.enumdicname as "unitname", ras.wrstandardid
|
|
|
- "wrstandardid",
|
|
|
- gd.deliverygoodsname "deliverygoodsname", ws.wrstandardname "wrstandardname", ras.deliverygoodsid
|
|
|
- "deliverygoodsid"
|
|
|
- from Report_AccountSpot ras
|
|
|
- left join wrstandard ws on ras.wrstandardid = ws.wrstandardid
|
|
|
- left join DeliveryGoods gd on ras.deliverygoodsid = gd.deliverygoodsid
|
|
|
- left join ENUMDICITEM gudic on gudic.enumdiccode = 'goodsunit' and gudic.enumitemname = ws.unitid
|
|
|
+ dwrs.totalqty "totalqty", dwrs.increaseqty "increaseqty", dwrs.decreaseqty "decreaseqty",
|
|
|
+ dwrs.freezeqty "freezeqty", dwrs.deliverygoodsid "deliverygoodsid", dwrs.accountid "accountid",
|
|
|
+ (dwrs.totalqty - dwrs.freezeqty) "usedqty",
|
|
|
+ (dwrs.totalqty - dwrs.increaseqty + dwrs.decreaseqty) "startqty",
|
|
|
+ gd.deliverygoodsname "deliverygoodsname", ws.wrstandardname "wrstandardname"
|
|
|
+ from report_daywrstandard dwrs
|
|
|
+ left join wrstandard ws on dwrs.wrstandardid = ws.wrstandardid
|
|
|
+ left join DeliveryGoods gd on gd.deliverygoodsid = dwrs.deliverygoodsid
|
|
|
<where>
|
|
|
<if test="vo.cycletime != null and vo.cycletime !=''">
|
|
|
- and ras.cycletime=#{vo.cycletime}
|
|
|
+ and dwrs.cycletime=#{vo.cycletime}
|
|
|
</if>
|
|
|
<if test="vo.cycletype !=null and vo.cycletype != ''">
|
|
|
- and ras.cycletype=#{vo.cycletype}
|
|
|
+ and dwrs.cycletype=#{vo.cycletype}
|
|
|
</if>
|
|
|
<if test="vo.accountid != null">
|
|
|
- and ras.accountid=#{vo.accountid}
|
|
|
+ and dwrs.accountid=#{vo.accountid}
|
|
|
</if>
|
|
|
</where>
|
|
|
</otherwise>
|