12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.emato.cus.supervise.mapper.WmsAcqGoodsSeatMapper">
- <!-- 库位上的货品信息 -->
- <select id="getWmsAcqGoodsSeat" parameterType="java.util.Map" resultType="com.emato.cus.supervise.domain.WmsAcqGoodsOnSeat">
- SELECT
- *
- FROM
- (SELECT DISTINCT
- th.companyCode AS merchSn,
- th.locationCode AS seatNo,
- th.itemName AS goodsName,
- th.itemCode AS codeTs,
- th.itemCode AS skuNo,
- th.itemCode AS goodsId,
- i.unitDesc AS gUnit,
- ( case when (li.qty is null and th.afterOnHandQty = 0) or (li.qty is not null and th.afterOnHandQty = li.qty) then th.afterOnHandQty
- else li.qty end) AS gQty,
- th.warehouseCode AS storeCode,
- CONCAT( i.itemSize, '-', i.itemColor, '-', i.itemStyle ) AS goodsModel
- FROM
- transaction_history th
- LEFT JOIN ( SELECT itemCode, locationCode, SUM( onHandQty ) AS qty FROM location_inventory GROUP BY itemCode, locationCode ) AS li ON
- th.itemCode = li.itemCode AND th.locationCode = li.locationCode
- LEFT JOIN item i ON th.itemCode = i.CODE
- WHERE
- 1 = 1
- AND th.zone IN ( 'A区', 'B区', 'C区', 'GQ区', 'F区', 'P区', 'Y区' )
- AND th.created >= '2018-01-01'
- ORDER BY
- th.created DESC
- ) AS a
- GROUP BY
- skuNo, seatNo
- </select>
- </mapper>
|