|
@@ -129,8 +129,12 @@ public interface YfDrugApplyMapper {
|
|
|
"SELECT top ${pageBean.pageSize} * from " +
|
|
|
"(SELECT row_number() over (order by b.mini_stock_amount-b.stock_amount desc) RowNumber," +
|
|
|
" b.charge_code,b.drugname as name,b.specification,b.pack_retprice,b.max_stock_amount,b.mini_stock_amount,b.serial," +
|
|
|
- " b.stock_amount,b.manufactory as manu_code,b.zb_supplyer" +
|
|
|
+ " (b.stock_amount+ y.yfl) as stock_amount,b.manufactory as manu_code,b.zb_supplyer" +
|
|
|
" from yp_base b WITH(NOLOCK)" +
|
|
|
+ " left join (select sum(stock_amount) yfl, charge_code, serial " +
|
|
|
+ " from yp_base_yf WITH ( NOLOCK ) " +
|
|
|
+ " group by charge_code, serial) y" +
|
|
|
+ " on b.charge_code = y.charge_code and b.serial = y.serial " +
|
|
|
" where" +
|
|
|
" <when test='chargeCode!=null and chargeCode!=\"\"'>"+
|
|
|
" b.charge_code =#{chargeCode} and " +
|