|
@@ -123,37 +123,32 @@ public interface YpOutDetlYfMapper {
|
|
|
" a.draw_no," +
|
|
|
" a.group_no," +
|
|
|
" a.out_date," +
|
|
|
- " location=isnull(c.location,'')," +
|
|
|
- " rtrim(a.charge_code)charge_code," +
|
|
|
+ " c.location," +
|
|
|
+ " rtrim(a.charge_code) as charge_code," +
|
|
|
" a.serial," +
|
|
|
" b.name," +
|
|
|
- " specification=b.specification," +
|
|
|
- " pack_retprice=a.pack_retprice," +
|
|
|
+ " b.specification as specification," +
|
|
|
+ " a.pack_retprice as pack_retprice," +
|
|
|
" a.stock_amount," +
|
|
|
" a.confirm_id," +
|
|
|
" a.input_id," +
|
|
|
" a.confirm_date," +
|
|
|
- " buy_price = case when isnull(a.buy_price,0)=0 then b.buy_price else a.buy_price end," +
|
|
|
- " curr_stock_amount=a.stock_amount-a.out_amt," +
|
|
|
- " profit_lossprofit_loss=-a.out_amt," +
|
|
|
- " profit_lossprofit_money=-a.out_amt*a.pack_retprice," +
|
|
|
- " py_code=b.py_code," +
|
|
|
+ " case when isnull(a.buy_price,0)=0 then b.buy_price else a.buy_price end as buy_price," +
|
|
|
+ " a.stock_amount-a.out_amt as curr_stock_amount," +
|
|
|
+ " -a.out_amt as profit_lossprofit_loss," +
|
|
|
+ " -a.out_amt*a.pack_retprice as profit_lossprofit_money," +
|
|
|
+ " b.py_code," +
|
|
|
" b.drug_kind," +
|
|
|
- " kind_name=k.name," +
|
|
|
- " manufactory_name=m.name" +
|
|
|
- " from yp_out_detl_yf a WITH(NOLOCK)," +
|
|
|
- "yp_zd_dict b WITH(NOLOCK) left join yp_zd_manufactory m WITH(NOLOCK) on b.manu_code = m.code" +
|
|
|
- ",yp_base_yf c WITH(NOLOCK) ,yp_zd_drug_kind k WITH(NOLOCK) " +
|
|
|
- " where" +
|
|
|
- " a.draw_no= #{drawNo} and" +
|
|
|
- " a.charge_code = b.code and" +
|
|
|
- " a.serial= b.serial and" +
|
|
|
- " a.charge_code = c.charge_code and" +
|
|
|
- " a.serial= c.serial and" +
|
|
|
- " a.group_no = c.group_no and" +
|
|
|
- " b.drug_kind = k.code and" +
|
|
|
- " out_type>=6 and" +
|
|
|
- " out_type<=8 order by b.drug_kind asc,c.location asc" )
|
|
|
+ " k.name as kind_name," +
|
|
|
+ " m.name as manufactory_name" +
|
|
|
+ " from yp_out_detl_yf a WITH(NOLOCK) " +
|
|
|
+ " inner join yp_zd_dict b WITH(NOLOCK) on a.charge_code = b.code and a.serial= b.serial " +
|
|
|
+ " left join yp_zd_manufactory m WITH(NOLOCK) on b.manu_code = m.code" +
|
|
|
+ " inner join yp_base_yf c WITH(NOLOCK) on a.charge_code = c.charge_code and a.serial= c.serial and a.group_no = c.group_no " +
|
|
|
+ " inner join yp_zd_drug_kind k WITH(NOLOCK) on b.drug_kind = k.code " +
|
|
|
+ " where a.draw_no= #{drawNo} " +
|
|
|
+ " and a.out_type between 6 and 8 " +
|
|
|
+ " order by b.drug_kind, c.location " )
|
|
|
List<YpBaseYfVo> selectYpInventoryPrintData(@Param("drawNo") String drawNo);
|
|
|
|
|
|
/**
|